Live prices are currently unavailable — the exchange feed could not be reached and no recent cached reading is held.

Protocol & Mining

Taproot, and the privacy of a script you never reveal

Taproot lets a spending condition be satisfied in two ways: a single signature, or the revelation of one branch of a script tree. On-chain the two are indistinguishable, so a complex arrangement looks exactly like an ordinary payment — which is the point.

Protocol referenceSource: BIP 340, BIP 341, BIP 342The signature scheme, output type and script rules are quoted from the three BIPs named below.

Schnorr signatures, and why they matter

Bitcoin's original signature scheme is ECDSA, and it works, but it has properties that make certain constructions awkward. BIP 340 introduced Schnorr signatures, a different scheme over the same curve with two properties that the protocol had been missing. The first is linearity: Schnorr signatures can be combined, so several signers can produce a single signature that verifies against a single aggregate public key. The second is provable security under a cleaner assumption, which matters for a system that intends to remain in use for decades.

Linearity is the property that makes the rest of Taproot possible. A group of participants can agree on an aggregate key, and a spend authorised by all of them is a single signature against that key. There is no multi-signature script on-chain, no list of public keys, and no indication that more than one party was involved. The arrangement is invisible because there is nothing to see: the transaction looks like any other single-signature spend.

Schnorr signatures are also smaller and cheaper to verify than ECDSA signatures, and they are fixed-length, which removes a source of variability in transaction size. The savings are modest per transaction and meaningful in aggregate, and they compound with the witness discount described on the SegWit page.

Key path and script path

A Taproot output commits to a single public key, and that key can be spent in one of two ways. The key path is the simple one: a signature against the committed key, exactly as an ordinary payment would be spent. The script path is the alternative: the output also commits to the root of a Merkle tree of scripts, and a spender can reveal one leaf of that tree together with the proof that it belongs to the committed root, then satisfy that leaf's condition.

The design decision that makes this useful is that the key used for the key path is not a separate key. It is constructed so that the key path remains available even when a script tree exists, and the participants can agree in advance that the key path is the normal route. A cooperative spend therefore uses the key path and reveals nothing about the tree. Only when cooperation fails — a signer is unavailable, a timelock has not expired, a dispute has arisen — does anyone reveal a script leaf, and even then only the one leaf that is being used.

The privacy gain is precise and worth stating carefully. Taproot does not hide that a transaction occurred, and it does not hide the amounts or the outputs. What it hides is the shape of the spending condition. Before Taproot, a multi-signature arrangement was visible on-chain as a multi-signature script, and an observer could count the keys and infer something about the arrangement. After Taproot, a cooperative multi-signature spend is a single signature against a single key, and it is indistinguishable from a payment made by one person with one key. The observer learns nothing, because there is nothing to learn from.

The script rules that make it work

BIP 342 defines the script semantics for Taproot spends, and it makes several changes to the language that are easy to overlook and important in practice. Signature checking operations are upgraded to verify Schnorr signatures, and the rules about which signature operations are permitted are tightened. The changes are not cosmetic: they are what allow a script leaf to be written with the assumption that a signature check means what it says.

The script tree itself is a Merkle tree, and the commitment is to its root. A spender reveals the leaf being used and the hashes needed to reconstruct the path to the root, and a verifier checks that the reconstruction matches the committed value. The tree can hold as many branches as the participants want, and the cost of a spend depends on the depth of the leaf used rather than on the total size of the tree. An arrangement with a dozen possible outcomes costs the same to spend through its most likely branch as an arrangement with two.

The combination of the two paths is what gives Taproot its character. The common case is cheap and private, and the uncommon cases remain available without being advertised. The Script page covers the language a leaf is written in, and the address types page covers the bech32m encoding a Taproot address uses.

Sources