The witness dedication situated in a single output of the coinbase transaction incorporates:OP_RETURN commitment_prefix|witness_commitment
The place commitment_prefix=0xaa21a9ed
andwitness_commitment=sha256(sha256(witness_merkle_root|witness_reserved_value))
.
The witness_merkle_root
is the foundation of a Merkle tree containing all transactions considering their witness knowledge. For the coinbase transaction we can not use the true hash of the transaction, as we’d have a recursive dependency. To resolve that we use all 0s:
sha256(sha256(E | F))
│
┌──────────────────┴───────────────────┐
│ │
E = sha256(sha256(A | B)) F = sha256(sha256(C | D))
┌───────────────┴───────────────┐ ┌───────────────┴───────────────┐
│ │ │ │
A (CoinbaseTx) B C D
000... txid_2 txid_3 txid_4
Why will we use a tx id set to all 0s as an alternative of simply ignoring the coinbase transaction to create the Merkle root?
The witness dedication situated in a single output of the coinbase transaction incorporates:OP_RETURN commitment_prefix|witness_commitment
The place commitment_prefix=0xaa21a9ed
andwitness_commitment=sha256(sha256(witness_merkle_root|witness_reserved_value))
.
The witness_merkle_root
is the foundation of a Merkle tree containing all transactions considering their witness knowledge. For the coinbase transaction we can not use the true hash of the transaction, as we’d have a recursive dependency. To resolve that we use all 0s:
sha256(sha256(E | F))
│
┌──────────────────┴───────────────────┐
│ │
E = sha256(sha256(A | B)) F = sha256(sha256(C | D))
┌───────────────┴───────────────┐ ┌───────────────┴───────────────┐
│ │ │ │
A (CoinbaseTx) B C D
000... txid_2 txid_3 txid_4
Why will we use a tx id set to all 0s as an alternative of simply ignoring the coinbase transaction to create the Merkle root?