BIP 341 chooses between the two ways of spending a Taproot output by counting witness elements after removing any annex: exactly one element means a key path spend, and two or more mean a script path spend.
Sources and checks
T1BIP 341, TaprootBIP, says this directly
If there is exactly one element left in the witness stack, key path spending is used:
Specification, Script validation rules, key path, read 2026-11-20
T1BIP 341, TaprootBIP, says this directly
If there are at least two witness elements left, script path spending is used:
Specification, Script validation rules, script path, read 2026-11-20
T1Bitcoin Core src/script/interpreter.cpp, VerifyWitnessProgramSource code, says this directly
if (stack.size() >= 2 && !stack.back().empty() && stack.back()[0] == ANNEX_TAG) {
VerifyWitnessProgram, Taproot branch, annex detection, read 2026-11-20
bitcoin/bitcoin at f498a5a671 contains this text in src/script/interpreter.cpp, and still does on the default branch.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/script/interpreter.cpp | grep -nF 'if (stack.size() >= 2 && !stack.back().empty() && stack.back()[0] == ANNEX_TAG) {'Checked at block 976,759, 20 Nov 2026, 17:27 UTC: quotes 3/3, code 1/1
History
Nothing is edited silently; every revision keeps what it replaced.
- 20 Nov 2026, 17:27 UTCblock 976,759
Published Revision 1, run 2026-11-20-seed-taproot