diff options
Diffstat (limited to 'bip-0141.mediawiki')
-rw-r--r-- | bip-0141.mediawiki | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bip-0141.mediawiki b/bip-0141.mediawiki index 117ca59..4ba6798 100644 --- a/bip-0141.mediawiki +++ b/bip-0141.mediawiki @@ -43,13 +43,13 @@ By removing this data from the transaction structure committed to the transactio A new data structure, <code>witness</code>, is defined. Each transaction will have 2 IDs. Definition of <code>txid</code> remains unchanged: the double SHA256 of the traditional serialization format: - + [nVersion][txins][txouts][nLockTime] - + A new <code>wtxid</code> is defined: the double SHA256 of the new serialization with witness data: - + [nVersion][marker][flag][txins][txouts][witness][nLockTime] - + Format of <code>nVersion</code>, <code>txins</code>, <code>txouts</code>, and <code>nLockTime</code> are same as traditional serialization. The <code>marker</code> MUST be a 1-byte zero value: <code>0x00</code>. @@ -67,14 +67,14 @@ A new block rule is added which requires a commitment to the <code>wtxid</code>. A <code>witness root hash</code> is calculated with all those <code>wtxid</code> as leaves, in a way similar to the <code>hashMerkleRoot</code> in the block header. The commitment is recorded in a <code>scriptPubKey</code> of the coinbase transaction. It must be at least 38 bytes, with the first 6-byte of <code>0x6a24aa21a9ed</code>, that is: - + 1-byte - OP_RETURN (0x6a) 1-byte - Push the following 36 bytes (0x24) 4-byte - Commitment header (0xaa21a9ed) 32-byte - Commitment hash: Double-SHA256(witness root hash|witness reserved value) - + 39th byte onwards: Optional data with no consensus meaning - + and the coinbase's input's witness must consist of a single 32-byte array for the <code>witness reserved value</code>. If there are more than one <code>scriptPubKey</code> matching the pattern, the one with highest output index is assumed to be the commitment. |