Bitcoin Merkle proofs show inclusion, not full validation

Explainer7 min read

Follow a Bitcoin Merkle branch to a block-header root. Learn what Core proof RPCs check and why inclusion does not prove an output is unspent.

Fictional Bitcoin Merkle-proof comic: Brokzi follows a transaction branch to a header-root record while separate block-validity and unspent-status checks remain distinct. No real proof, node, wallet or transaction is tested.
AI-assisted editorial illustration · Brokzi
On this page

A Bitcoin Merkle proof connects a transaction ID to the transaction root recorded in a particular block header. With the right proof structure and a root you can rely on, it provides evidence of inclusion. It does not independently check every spending rule, establish that an output remains unspent or turn an arbitrary header into accepted Bitcoin history.

For readers comparing a wallet's proof, an explorer record or a node response, the useful question is what was checked against what. A matching root is one result. The source of that root, the chain view and the transaction's current outputs need their own context.

This explainer uses the Bitcoin Developer Guide and Bitcoin Core v32.1 source checked November 2, 2026. The tree below contains invented labels, not real hashes or a proof accepted by a node. No wallet, RPC, signature, transaction or inclusion test was performed.

A header commits to a transaction tree

Core's block-header definition contains a field named hashMerkleRoot. The header also contains other information, including a reference to the previous block. A Merkle proof concerns the transaction-root commitment; it does not supply the full block's contents or every check needed to accept them.

The transaction-tree implementation starts its leaves from transaction IDs, or txids. It combines ordered pairs of hashes until one root remains. A branch supplies the sibling information needed to reconstruct that root from a selected leaf, without supplying every other transaction.

Here the relevant leaves are txids, not interchangeable wtxids. Witness data has a separate commitment mechanism. Our txid and wtxid explainer explains those two identifiers. A txid inclusion path alone does not re-run witness or signature validation.

Follow one leaf through a four-transaction example

Imagine four leaves, in order: A, B, C, D. Each letter stands for an already calculated transaction ID. Assume four distinct transaction IDs and the intended Bitcoin pair-hashing rules. No letter is a searchable hash, a payment address or a transaction we created.

For this diagram, H(left, right) means double SHA-256 of the two hashes concatenated in their required binary order. It is notation, not a ready-to-run verifier. A correct implementation must also handle serialization and hash representation correctly; hashing the printed letters would be a different exercise.

AB = H(A, B)
CD = H(C, D)
R  = H(AB, CD)

To check the path for C, the sibling information consists of D on the right, then AB on the left. The positions matter.

StepCurrent valueSupplied siblingPair to combine
1CD, on the rightH(C, D) = CD
2CDAB, on the leftH(AB, CD) = R

The path needs two pair combinations. Each sibling hash is 32 bytes, so these two sibling values occupy 2 × 32 = 64 bytes before any proof-format metadata. That is not a claim that an entire Bitcoin proof, including a header, flags or counts, is 64 bytes.

This four-leaf example avoids an odd-width level. Bitcoin's actual tree rules duplicate the last hash at an odd-width level and include mutation-related checks. Core's implementation documents that boundary. Do not extend this compact diagram into a universal verifier by ignoring tree shape, transaction count or malformed data.

A matching root needs an authenticated context

Suppose the path reconstructs R. You still need to know whether R is the transaction root in the intended block header, and why that header belongs to the chain view you mean to use. Someone providing both an invented root and a matching branch has not established a Bitcoin payment.

The Developer Guide's discussion of simplified payment verification distinguishes header-and-branch evidence from full transaction validation. Header-chain work and connectivity assumptions matter. A branch does not download and check the full transaction history or prove every input's spending conditions.

Our full-node and wallet comparison maps those separate responsibilities. It also explains why full-node behavior needs implementation and configuration context. This article does not prescribe a node setup, assume that an arbitrary explorer has validated its chain, or claim that a particular confirmation count makes reversal impossible.

What Core's gettxoutproof actually produces

The name can invite a wrong conclusion: gettxoutproof is an inclusion-proof function, not a current unspent-output certificate.

In the checked Core v32.1 RPC implementation, its requested identifiers are txids, with an optional block hash. The function finds and reads a block, checks that all requested txids occur in it, then serializes a CMerkleBlock for that selection.

Core's proof data structures contain a block header and a partial Merkle tree. That tree carries transaction-count, hash and flag information. It is not the same object as the two bare sibling hashes in our teaching diagram, and it does not carry the full contents of every transaction.

Finding the block also has practical conditions. The RPC can use an unspent-output record as a location hint, consult a transaction index or use an explicitly supplied block hash. It still needs the block data to construct the proof. That lookup route does not change the resulting proof into evidence that a particular output is unspent now.

For an actual output, the relevant reference combines a txid with an output index. The UTXO explainer covers that inventory and the limits of a node's current view. A transaction's historical inclusion does not disappear merely because one of its outputs is spent later.

verifytxoutproof adds the node's own chain checks

The paired RPC does more than compare two untrusted strings. In v32.1, it extracts the matched txids and reconstructed root, then compares that root with the proof header's root. The partial-tree extraction code also rejects invalid traversal conditions, such as insufficient hashes or inconsistent consumption of proof data.

The RPC then looks up the header's block hash in the node's block index. It requires that block to belong to the node's active chain and have a nonzero recorded transaction count. Before returning the matched txids, it also requires the proof's transaction count to match the node's record.

Those local chain records are part of the result's context. The function does not freshly validate every transaction script in the block as part of checking this proof. A standalone branch checker lacking that chain context is not equivalent to the complete RPC behavior.

Read failures carefully too. A root mismatch can produce an empty result; a block absent from the required chain context raises an error. Malformed serialization can fail while decoding. Neither outcome supplies a universal diagnosis of a real payment, and these source-code observations are not RPC calls we executed.

Keep the conclusions narrower than the proof

Use these distinctions when a screen says "verified":

ObservationWhat still needs separate evidence
A branch reconstructs the claimed rootWhy that root and its header are authentic
A selected txid matches a block commitmentFull transaction validity and witness checks
Core verifies the proof in its active-chain contextWhether a particular output is unspent in the current view
The transaction was includedKey control, recipient intent and any receiving-service account credit

A missing proof is not a proof of non-inclusion. A server may omit information, the requested block data may be unavailable, or the lookup may use the wrong context. The Developer Guide discusses omission as a weakness of naive light-client designs. This is a reason to identify the evidence source, not to infer a failed payment from one missing response.

Keep the intended network, txid, block hash, proof format, root source and observation time together. Record whether the result came from a branch calculation, a particular node's RPC or a website's presentation. Then ask the separate question you need answered: historical inclusion, current spendability or account credit.

Sources

Primary documentation and source checked November 2, 2026. Implementation details are pinned to Core v32.1, the latest stable release at preparation. The Developer Guide supplies the SPV distinction and omission context; its historical wallet-popularity, bandwidth, deployment and fixed-confirmation passages are not used as current measurements or guarantees.

All tree labels and the illustration are fictional. The 64-byte calculation counts only two sibling hashes, not a serialized Core proof. No live block, transaction, proof, UTXO, node, RPC, wallet, signature or exchange-account verification was performed. This is protocol education, not a security audit or financial advice.

See something wrong? Brokzi logs material changes. Prepare a correction note.

About the byline

Brokzi Editorial

The accountable byline for Brokzi’s explainers, definitions, news notes, and corrections.

Editorial responsibility →