BIP453: Terminology of Transaction Components#2195
Conversation
bbb3268 to
5491adc
Compare
| : Synonym: <code>VarInt</code> (do not use, see [[compactsize|Rationale]]) | ||
|
|
||
| ; condition script | ||
| : [Concept] Umbrella term for scripts that encode the actual spending conditions that must be fulfilled to spend a TXO. Condition scripts may be preceded by one or more forwarding scripts. An output script will either directly contain a condition script in the case of a bare output, or commit to one or multiple condition scripts for other output types. For P2TR both the taproot internal key and each leaf script in the script tree are considered condition scripts. At the time of writing, there are five distinct condition scripts: taproot output key, leaf script, witness script, redeem script (only non-segwit P2SH), and bare output script (P2PK, P2PKH, P2MS, and arbitrary scripts). |
There was a problem hiding this comment.
I think this is somewhat contradictory in multiple ways:
- If a "condition script" is indeed meant to be a script (and the first sentence explicitly confirms it) then the taproot internal key and the taproot output key aren't condition scripts – the former is a part of the control block (itself a witness stack item that's not a script) and the latter is a witness program (a data push in an output script, not a script itself).
- It says a taproot internal key is considered a condition script, but then doesn't include it in the (presumably exhaustive) list of condition scripts.
| : [Artifact] A serialization artifact indicating features used by the transaction. As of writing, the only allowed value is <code>01</code> which indicates that the transaction serialization has a witness structure (see [[https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki|BIP144]]). | ||
|
|
||
| ; forwarding script | ||
| : [Concept] A collective term for scripts that redirect input validation to another script or data structure. Witness programs and P2SH Programs are forwarding scripts. Forwarding scripts make use of script templates that imply additional evaluation steps beyond the explicitly expressed conditions. In the case of P2SH, the output script itself only explicitly specifies that the redeem script must be the preimage of the hash in the output script, but the template prescribes that the redeem script must additionally be satisfied. For witness programs, the output script is even less verbose with more implied meaning. |
There was a problem hiding this comment.
Same problem as above: the witness and P2SH programs aren't scripts, they're byte arrays pushed in an output script. A SegWit/P2SH output script is the forwarding script in this case.
murchandamus
left a comment
There was a problem hiding this comment.
@vostrnad: Thank you for the great review. I took most of your suggestions, I’m still working on the Condition Script and Forwarding Script point.
| : See '''input script'''. | ||
|
|
||
| ; sequence | ||
| : [Component] The sequence number appearing in each transaction input. Serialized as the four-byte <code>nSequence</code> integer field. If any input’s sequence number is less than the maximum allowed value, a transaction is non-final. |
There was a problem hiding this comment.
I realize that I did this for marker, sequence, version, locktime, and sighash-flag. It feels a bit out-of-place in a list of definitions, so I was considering to remove it, but would you think that it should also be added to other components instead?
danielabrozzoni
left a comment
There was a problem hiding this comment.
I only did a first (rather quick) pass. Thanks for taking the time to write this! It was very informational, and helped me clear many of the doubts I had regarding terminology :)
|
Assigned 453 |
|
Thanks. I adopted the assigned number and @danielabrozzoni’s review. Other todos remain open. |
danielabrozzoni
left a comment
There was a problem hiding this comment.
Thanks for picking up my comments! I gave this another read :)
| ; annex | ||
| : [Component] A witness item reserved for future extensions, currently unused (see [[bip-0341.mediawiki#cite_note-5|BIP341]]). | ||
|
|
||
| ; bare output script |
There was a problem hiding this comment.
It took me a second to understand what exactly is a bare output - I think it's clear once you already understand condition and forwarding scripts, but it took me a few re-reads to appreciate this fully. I wonder if it would help to add a short note saying why the other script types are not bare.
Otherwise, it might be helpful to explicitly mention the lack of a forwarding script. That is already implied by "a condition script that is directly defined in the output script field" but repeating it could make the distinction easier to pick up on first read.
| : Synonym: coin | ||
|
|
||
| ; version | ||
| : [Component] Part of the transaction header that specifies the transaction version. Serializes as the four-byte <code>nVersion</code> integer field. `OP_CHECKSEQUENCEVERIFY` requires version 2 or higher (see [[bip-0068.mediawiki|BIP68]]), version 3 transactions are topologically restricted until confirmation (see [[bip-0431.mediawiki|BIP431]]). |
There was a problem hiding this comment.
OP_CHECKSEQUENCEVERIFY should be enclosed in "<code></code>", not in "``"
|
|
||
| ; witness item | ||
| : [Component] An element of a witness stack. At the time of writing, witness items are: witness script (P2WSH only), script arguments, leaf script (P2TR script path only), control block (P2TR script path only), annex (P2TR only). | ||
| : Synonyms: witness element, witness stack element ([bip-0341.mediawiki|BIP341]]) |
There was a problem hiding this comment.
Missing one "[" at the start of bip-0341, should be: ([[bip-0341.mediawiki|BIP341]])
|
|
||
| ; input script | ||
| : [Component] The Bitcoin code base used Hungarian notation when it was published. This transaction field appearing in transaction inputs was named <code>scripSig</code> for containing the signature and being of the type script. Today, this field is better understood as the input script which is used to satisfy spending conditions for non-segwit outputs, redirects validation to the witness stack for wrapped segwit outputs, and is empty for native segwit outputs. The input script may contain an actual script when spending a bare output script, but may only contain push operations for any output type since P2SH. | ||
| : Synonyms: <code>scriptSig</code>, unlocking script (see [[locking_unlocking|Rationale]]) |
There was a problem hiding this comment.
Missing "#" in front of locking_unlocking, should be: [[#locking_unlocking|Rationale]]
|
|
||
| ; output script | ||
| : [Component] Contains either a condition script or a forwarding script. Originally, the Bitcoin code base used Hungarian notation. This field was presumably named <code>scriptPubKey</code> as it was of the type script and because it fulfilled the role of a public key. While the first standard output type, Pay to Public Key, only contained the public key in this field, the use of this field had evolved beyond that even when Bitcoin was published, since the field could already contain more complicated bare scripts. Today, this field is referred to as the output script. | ||
| : Synonyms: <code>scriptPubKey</code>, locking script (see [[locking_unlocking|Rationale]]) |
There was a problem hiding this comment.
Same as above, needs a "#": [[#locking_unlocking|Rationale]]
This informational BIP provides a set of terminology to refer to the various components, scripts, and concepts used to compose Bitcoin transactions.
This proposal was discussed in 2023 on the mailing list and had subsequently been reviewed and developed against my personal BIPs repository. I recently picked it up again to address the outstanding review and would now like to put it forth for broader consideration.
Note on pull request organization: During this initial review phase, I will append commits for each change to make it easier for reviewers to check whether their comments have been addressed adequately. The PR will be reorganized into one or a few commits as this document approaches publication.
Todos: