What are Bitcoin’s transaction and script limits?

0
89


A transaction that follows the consensus guidelines is a legitimate transaction. Nevertheless, some additional guidelines had been launched which are referred to as standardness guidelines.

Bitcoin nodes solely relay (propagate) normal transactions. Thus the one option to mine a legitimate however non-standard transaction is by arranging it with a miner.

Transaction dimension restrict

The utmost dimension for legacy (or non-Segwit) transactions is 1 MB, successfully the entire block. The standardness restrict, nonetheless, is 100 kBs. For Segwit transactions the utmost dimension restrict is 4 MBs (the burden restrict). Once more, standardness guidelines scale back that to 400 kBs.

The minimal dimension for legacy transactions is 65 bytes.

Inputs/Outputs restrict

Successfully, as many inputs and outputs because the person desires, supplied that it suits within the transaction dimension restrict.

Naked scripts restrict

Naked scripts have a dimension restrict of 10k bytes by consensus. Nevertheless, standardness guidelines explicitly specify the type of locking scripts allowed and the scripts are a lot smaller (e.g. P2PKH is 25 bytes, P2SH is 23 bytes, and many others).

P2SH scripts limits

P2SH scripts have a dimension restrict of 10k bytes by consensus. Standardness guidelines solely permit for 520 bytes for the redeem script although, which is sufficient for a 15-of-15 multisig. The utmost unlocking script (scriptSig) dimension is 1650 bytes.

P2WSH (Segwit v0) and P2SH-P2WSH limits

P2WSH scripts have a dimension restrict of 10k bytes by consensus. Standardness guidelines solely permit for 3600 bytes for the script witness. As well as, solely 201 non-push opcodes are allowed per script and solely 520 bytes might be pushed per stack aspect.

P2TR (Segwit v1) limits

As P2WSH however the script witness is now restricted solely by the transaction dimension (4MBs by consensus and 400kBs by standardness).

OP_RETURN DATA restrict

The consensus guidelines don’t have any restrict to an OP_RETURN dimension, i.e. the dimensions of the transaction is the restrict. One may have multiple OP_RETURN in a transaction. Nevertheless, standardness guidelines specify that just one OP_RETURN output is allowed per transaction with a most information dimension of 80 bytes.

*EDIT: Particular miners may apply native coverage guidelines along with the consensus guidelines. Since these are customized configurable guidelines they aren’t checklist right here however a listing of potential coverage guidelines might be discovered at https://github.com/bitcoin/bitcoin/tree/grasp/doc/coverage

LEAVE A REPLY

Please enter your comment!
Please enter your name here