THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Bitcoin Taproot Script-Path Spending: Tapscript, Control Blocks, and Conditions

permalink THAMER
#bip342#control-block#taproot-script-path#tapscript

Taproot outputs can be spent through a key path or, when committed script leaves exist, through a script path. A script-path spend reveals the selected script leaf and a control block, while leaving unchosen branches undisclosed.

Key path and script path

A key-path spend proves authorization with a Schnorr signature under the output key. A script-path spend provides the inputs needed to execute a committed tapscript leaf. These are alternative authorization paths, not two signatures required for every Taproot spend.

What the witness reveals

A typical script-path witness includes satisfaction stack elements, the tapscript, and a control block. The control block identifies the internal key and Merkle proof necessary to verify that the revealed leaf was committed by the output. The witness does not reveal every other leaf in the tree.

Tapscript and BIP342

Tapscript defines updated signature-checking behavior and script execution semantics for Taproot script leaves. It uses Schnorr signatures for its signature operations and changes resource accounting and opcode treatment compared with legacy scripts. Script authors must evaluate the actual tapscript rules rather than copy a legacy script and assume identical behavior.

Timelocked recovery branches

A Taproot script tree can include a branch with a recovery key gated by CLTV or CSV. The transaction must meet the script's locktime requirements; the correct control block and satisfaction data must also be supplied. Key-path spending may still be possible if a usable key-path authorization exists.

Privacy and cost tradeoffs

Key-path spends typically reveal less script information. Script-path spends disclose only the selected branch and its proof, but may have a larger witness. A wallet should evaluate both privacy and fee costs, and ensure backups preserve the scripts, leaf versions, control data derivation, and key origins needed for recovery.

Primary references

BIP340 — https://bips.dev/340/
BIP341 — https://bips.dev/341/
BIP342 — https://bips.dev/342/

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects