What is the script assembly and execution in P2TR (pay to Taproot)

So I [have found]( and fundamentally understand how P2PKH is assembled from inputs and outputs to create a bitcoin [forth-like script]( for execution.

I looked at the SegWit BIP [examples section]( and I found them easy enough to understand as well.

But looking at the [Taproot BIP](, I’ve likely reached my limit. It’s very well written, but I just can’t get a handle on it.

Can anyone look at my recent testnet [P2TR spend]( ([raw-ish JSON]( and show me how the `witnessData`, `scriptPubKey`, and `sigScript` data is used to construct a bitcoin forth-like script for execution and validation? I’m only interested in single-sig Taproot. After I grasp that perhaps I can expand to multisig-taproot. I know the python samples are provided in the BIP, but honestly, still just don’t get it.

BTW.. I can provide the testnet privkey if needed, though I might need to rebuild the TXN.

I’ve also [XPosted on SE]( if you need to make some SE-karma

View Reddit by brianddkView Source

Leave a Reply

Your email address will not be published.

GIPHY App Key not set. Please check settings


  1. When you spend a p2tr output, you either just provide a signature (a “key path” spend) or else your witness will include the script and all the inputs to the script. The script here is pretty much the same as a p2sh script.

    The only scripts you can provide are the ones that were encoded in the p2tr output’s merkle tree originally, and you need to provide both the merkle path to that script and the internal pubkey that was combined with the merkle root to generate the original p2tr output.

What do you think?

Square to Consider Building a Bitcoin Mining System

Bitcoin Technical Indicator Suggests Low Probability of ‘Santa Rally’

ADA Price Chart

Cardano (ADA) Shows Recovery but Struggles Around $1.5