Merkleized Abstract Syntax Tree (MAST)
A technique, deployed in Bitcoin through Taproot, that places each script branch in a Merkle tree, hiding unused branches for privacy and efficiency.
MAST - Merkleized Abstract Syntax Tree - is a way of structuring complex Bitcoin Scripts so that only the branch actually being executed at spend time needs to appear on-chain. The other branches stay hidden, committed cryptographically via a Merkle root but never revealed unless used.
This is one of the two cryptographic ideas baked into Taproot. The other is Schnorr signatures plus key aggregation.
Why MAST is useful: consider a vault script with multiple spending branches - "owner can spend after 1 confirmation," "owner + trusted backup can spend after 1 day," "trusted backup alone after 1 year." Without MAST, all three branches would be visible in every spend, taking up block space and revealing your security model. With MAST, only the branch you actually use is published. The rest is invisible to chain observers.
Combined with Taproot's "key path spending" (the cooperative-signature option), the privacy gain compounds: if all participants agree, the script never needs to be revealed at all. Observers see what looks like a single-signature spend. If cooperation breaks down, only one branch of the script is exposed.
MAST has been part of Bitcoin since the Taproot soft fork activated in November 2021 (BIP-341 / BIP-342). It's not a separate feature you opt into; it's the way Taproot script-path spending works.
The acronym is a mouthful and the explanation is dense, but the upshot is clean: Bitcoin can now have complex contracts that look the same on-chain as the simplest transactions, until they don't have to.
See How Taproot Actually Works for how the tree is committed and what a script-path spend reveals.
Key takeaways
- Allows separate script branches, revealing only the used path
- Enhances privacy by hiding unused logic
- Reduces on-chain footprint and fees for complex contracts
Related chapters
Corrected
-
Was: The short definition called MAST 'a Taproot-based technique.'
Now: MAST was discussed in Bitcoin from 2013 and had its own proposals, such as BIP-114, before it reached Bitcoin through the Taproot soft fork in November 2021. The definition was changed to describe it as a technique deployed through Taproot. Details
Related terms (5)
Published . Revised . One correction logged for this page.
Edit this page on GitHub