BOMBARCHIVE
Explore

A living reference collection. Written in the wiki, preserved in Git.

The archiveBitcoin

Witness commitment

A witness commitment is the block-level commitment introduced by Segregated Witness (SegWit) to authenticate the witness data of Bitcoin transactions. It is stored in an output of the block's coinbase transaction, rather than directly in the block header. Its presence lets upgraded nodes bind witness-inclusive transaction hashes to the existing block-header Merkle root without changing the header's 80-byte format.

The mechanism is especially important to Inscriptions. An inscription reveal's legacy transaction ID can establish which transaction was mined, but that ID excludes the Taproot witness containing the inscription body. The witness commitment supplies the separate block-level connection to those bytes. Bitcoin still validates scripts and transactions; Ordinals software separately interprets which bytes form an inscription.

From the SegWit proposal to consensus

Pieter Wuille's 7 December 2015 Scaling Bitcoin presentation explained the motivation for separating transaction effects from their authorization evidence. BIP 141, assigned 21 December 2015 to Eric Lombrozo, Johnson Lau and Wuille, specified the witness commitment as part of the soft-fork-compatible design. Mainnet SegWit rules activated at block 481,824 on 24 August 2017. These are a public presentation, a standards-assignment date and a consensus-activation date, respectively, not three descriptions of one launch. December 2015 first-party presentation · BIP 141, primary specification · Segregated Witness

The design placed the new commitment in a coinbase output because the coinbase txid was already a leaf in the older transaction Merkle tree. Bitcoin's header need not learn a new field: a SegWit-aware node can verify the new relationship, while the legacy header still commits to the coinbase transaction. That is the architectural mechanism described by the BIP, not a claim that non-upgraded nodes independently validate witness rules. BIP 141, abstract and commitment structure

How the commitment is made

Two transaction identifiers

A txid hashes a transaction's serialization without witness data. A wtxid hashes the witness-inclusive serialization for transactions with witness data; for a transaction without witness data, its wtxid equals its txid. Bitcoin's ordinary transaction Merkle tree uses txids in block order. The witness tree uses wtxids in that same order, with one special rule: the coinbase transaction's witness-tree leaf is defined to be 32 zero bytes, regardless of the coinbase's actual wtxid. BIP 141, transaction identifiers · Bitcoin Core, two Merkle-root calculations

The zero leaf avoids a circular commitment. The coinbase must carry the hash of the witness tree, and its own serialized witness and outputs would otherwise affect the wtxid used to construct that very tree.

The byte-level rule

BIP 141 defines a coinbase scriptPubKey of at least 38 bytes beginning with:

6a       OP_RETURN
24       push 36 bytes
aa21a9ed commitment marker
[32 bytes of commitment hash]

The commitment hash is the double SHA-256 of the 32-byte witness Merkle root concatenated with a 32-byte witness reserved value from the coinbase input's witness. In pseudocode:

witness_root = MerkleRoot(00...00, wtxid[1], ..., wtxid[n])
commitment   = SHA256d(witness_root || reserved_value)

The reserved value must be the sole item in the coinbase input's witness stack when the commitment is present, and it must be exactly 32 bytes. If multiple coinbase outputs match the marker, the highest-output-index match is the one that counts. Bytes after the required 38-byte prefix have no additional consensus meaning under BIP 141. BIP 141, commitment structure

A commitment is optional when a block has no witness data, but a block cannot carry uncommitted witness data under active SegWit validation. Bitcoin Core's CheckWitnessMalleation path checks the reserved-value shape and commitment hash, rejecting mismatches and unexpected witness data. The separately implemented BlockWitnessMerkleRoot routine explicitly substitutes a zero coinbase leaf. Bitcoin Core, witness validation · Bitcoin Core, witness tree

The path to a block header

The proof relationship runs through both Merkle trees:

reveal witness bytes
    -> witness-inclusive wtxid
    -> witness Merkle root
    -> coinbase commitment output
    -> coinbase txid
    -> ordinary transaction Merkle root
    -> block header

The transaction's ordinary txid also has its own path to that same header root. A witness branch alone establishes a relationship to a claimed witness root; an untrusted commitment output alone is not a trusted root. The coinbase must itself be proved to belong to the identified block. Conversely, the ordinary txid branch authenticates the transaction's non-witness serialization but not the witness-inclusive reveal. BIP 141 · Bitcoin Core commitment construction

Hashes and branch siblings must be handled in their internal byte order. Explorer-displayed txids and block hashes commonly reverse the internal hash bytes for display. A successful hash comparison using a reversed display string by accident is not an authenticated proof.

A preserved example: 0.bitmap

The archive holds a compact witness-inclusion proof for 0.bitmap, the first Bitmap District inscription. Its reveal is transaction 86539aff946c437af8088955827b7e6ff48fc6192836d4071b697b5359b7a732, at zero-based index 953 among 3,139 transactions in block 792,435 (1 June 2023). The proof packet contains serialized reveal and coinbase transactions, the block header, separate Merkle branches for the reveal txid and coinbase txid, and a witness Merkle branch. Preserved primary-data proof packet · 0.bitmap

The coinbase output in that packet begins 6a24aa21a9ed and carries the 32-byte commitment hash:

cb39fc7a52a20372453db3e7137e8e6c561ba426504594441c4522883116b876

Its coinbase witness contains one 32-byte all-zero reserved value. The reveal's witness contains the ord envelope and UTF-8 body 0.bitmap. The stored verification program checks that the reveal's witness-inclusive hash and its 12-sibling witness path produce a root whose commitment matches the coinbase output; it separately checks the coinbase and reveal against the legacy transaction root in the preserved header. Serialized block-artifact data · Offline verifier, direct code evidence

The verifier also has a deliberate negative test in the repository's test suite: changing the claimed inscription body can leave the txid untouched while failing the witness check. This demonstrates why a txid-only proof is inadequate for inscription content. Archive review and test description

What remains outside this proof

  • Mempool observation: before confirmation, an observed reveal is not yet part of a block's witness commitment. See Transaction replacement.
  • Script authorization: witness inclusion does not replace validation of the Taproot script-path spend and its control block.
  • Protocol interpretation: Bitcoin does not assign inscription numbers, Bitmap Districts or ownership semantics from the witness commitment. Those arise from Inscriptions, Ordinal theory and Bitmap rules.
  • Completeness: authenticating one witness does not establish that an indexer discovered all inscriptions or all valid District claims. It only authenticates the presented content and specified placement against the trusted commitment.

Open research

Open question
Reproduce the full witness-root computation directly from every serialized transaction in block 792,435, independently of the compact Merkle branches, and compare it with the archived 0.bitmap packet.
Open question
Trace the 32-byte reserved-value mechanism through the pre-activation BIP 141 edit history and implementation reviews, distinguishing its documented extensibility rationale from uses that were only proposed.
Open question
Assemble an original-block study of witness commitment outputs around SegWit activation in August 2017, distinguishing matching marker bytes from consensus-enforced commitments.