Questions tagged [p2tr]

Pay to Taproot is the native SegWit v1 output format. It commits directly to a public key which can optionally be tweaked with the hash of a script tree. This combines capabilities of previous output formats which were usually based on either a public key hash or a script hash. P2TR addresses are Bech32m encoded and start with the prefix `bc1p`.

Filter by
Sorted by
Tagged with
13 votes
1 answer
3k views

What is the script assembly and execution in P2TR spend (spend from 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 ...
Dan's user avatar
  • 461
9 votes
1 answer
552 views

BIP-341: Should key-path-only P2TR be eschewed altogether?

Consider BIP-341 "Constructing and spending Taproot outputs" where it says If the spending conditions do not require a script path, the output key should commit to an unspendable script ...
davidbak's user avatar
  • 261
9 votes
1 answer
949 views

Is there an economic incentive to switch from P2WPKH to P2TR?

I have multiple times seen people argue that there is “no economic incentive” to switch from P2WPKH to P2TR. I know that the sum of input and output weight on P2WPKH and P2TR are very similar, but how ...
Murch's user avatar
  • 75.2k
7 votes
2 answers
2k views

How can I find samples for P2TR transactions on mainnet?

Can I ask for a P2TR transaction id example past block 709632? I was trying to debug one of my scripts and something is wrong when searching for witness_v1_keyhash, and couldn't manually find one in ...
Tony Sanak's user avatar
  • 1,689
7 votes
2 answers
705 views

Should the Bitcoin Core wallet (or any wallet) prevent users from sending funds to a Taproot address pre activation?

The Bitcoin Core wallet prevents mainnet Taproot descriptors from being imported pre activation (November 2021) as a safeguard. However, you can send mainnet Bitcoin to a Taproot (P2TR) address pre ...
Michael Folkson's user avatar
6 votes
2 answers
801 views

XPRIV/XPUB type for P2TR

As far as I understand, there is a standard that describes what address types an extended private key or extended public key is intended to derive and it works as such: xpriv/xpub => Legacy ...
Dalit Sairio's user avatar
6 votes
2 answers
1k views

Is a P2TR address a compressed public key?

From what I understand, a public key can be compressed from 64 bytes into 32 bytes, but an additional byte is needed for the sign, so it usually winds up being 33 bytes total. But P2TR addresses only ...
Hunter Beast's user avatar
6 votes
1 answer
437 views

What is the largest multisig quorum currently possible?

Bitcoin script allows for a UTXO to be (un)encumbered by an N-of-N signature. When N is 1, this is referred to as a single signature. What are the limits of N for this application? What is the ...
Matthias's user avatar
6 votes
1 answer
2k views

How can I create P2TR addresses with Bitcoin Core 22.0?

I'm trying to test P2TR with Bitcoin Core, and I don't know how to get taproot addresses. How should I create them using 22.0?
Gustavo Chaín's user avatar
6 votes
1 answer
274 views

Will P2TR make P2WSH obsolete?

Assuming users have upgraded their wallets to handle P2TR outputs and trust the validation rules of P2TR, would there be any advantage of using P2WSH over P2TR?
Darius's user avatar
  • 789
6 votes
0 answers
149 views

Which wallets are spending P2TR with SIGHASH_ALL?

I noticed there are quite a lot of transactions spending taproot key path inputs that use SIGHASH_ALL instead of SIGHASH_DEFAULT in signatures (around 20% in the last two weeks). Recall that ...
Vojtěch Strnad's user avatar
5 votes
1 answer
976 views

How can I spend from a P2TR address on Signet with the Bitcoin Core wallet in 22.0?

Apparently (credit 0xB10C) there are only 20 key-path and 5 script-path spends of P2TR outputs on the Signet blockchain today (July 7th 2021). How can I increase this number today with say the Bitcoin ...
Michael Folkson's user avatar
5 votes
1 answer
508 views

How do you construct witness stack and controlblock in P2TR Script Path outputs?

I have been documenting how to create different types of Tx outputs here, leveraging the Bitcoin Core Test Framework. Particularly for Taproot, I'm working on a scenario of a P2TR Script Path with a ...
Bitcoin_1o1's user avatar
4 votes
1 answer
895 views

How do the fees for taproot transactions compare to P2WPKH?

How would the most basic taproot transactions (not involving scripts) compare to P2WPKH transactions in terms of vbytes or fees?
Darius's user avatar
  • 789
4 votes
1 answer
899 views

How to extract the internal key of a simple P2TR address?

Is it possible to extract the taproot internal key out of a P2TR address?
Orny's user avatar
  • 151
4 votes
1 answer
265 views

Is taproot considered nonstandard to older clients?

When asking an older bitcoind node to broadcast a transaction which includes or spends a p2tr output, how will they respond? Will they broadcast the transaction? Will only certain bitcoind versions ...
arshbot's user avatar
  • 1,778
4 votes
1 answer
577 views

P2TR: Is pub key hashed in address?

Are the new Taproot addresses (SegWit v1) also a hash of the (potentially tweaked) public key, or is the public key directly encoded into the address, without hashing it?
Dalit Sairio's user avatar
4 votes
1 answer
1k views

non-mandatory-script-verify-flag (Invalid Schnorr signature) when I try to send a P2TR tx on testnet

I'm learning to create tx from scratch in order to understand better how bitcoin tx works and how they are structured. I learnt to create tx with legacy address, segwit v0 and I am now learning ...
alemaz98's user avatar
  • 143
4 votes
1 answer
438 views

What is the weight of a P2TR input?

I'm looking for a detailed explanation of the weight, vsize and serialized length of a P2TR input, in the same vein as How big is the input of a P2PKH transaction?.
Murch's user avatar
  • 75.2k
4 votes
1 answer
310 views

How to spend an imported rawtr() descriptor with bitcoin-cli?

I created a transaction that creates a taproot output that can be spent using the private key (KEY) corresponding to the taproot output key. Then I imported the WIF formatted private key into Bitcoin ...
raphjaph's user avatar
4 votes
1 answer
392 views

Which wallets or libraries besides core support (or will support) P2TR descriptors?

I want to help test the WIP Bitcoin Dev Kit "Add support for Taproot and tr() descriptors", PR #593 against other implementations besides Bitcoin Core (already testing again Core 22.0). In ...
Not Mandatory's user avatar
4 votes
0 answers
464 views

P2TR bech32m mismatch

When attempting to create a p2tr address using the private key 0x0000...01 I get, bc1pmfr3p9j00pfxjh0zmgp99y8zftmd3s5pmedqhyptwy6lm87hf5sspknck9 which does not match the provided test vectors provided ...
m1xolyd1an's user avatar
  • 5,636
4 votes
0 answers
369 views

How are taproot scripts represented in general?

I'm pretty familiar with the opcode style of writing down scripts. I can understand the stack-based language nature of bitcoin script where you can write down different script spend paths via ifs like ...
B T's user avatar
  • 1,638
3 votes
1 answer
429 views

Is there a way to convert a P2PKH address into P2TR?

As far as I understand, Taproot enhances privacy by allowing someone to only reveal a specific key path, which in my understanding means that it's fairly flexible - is it possible to construct a P2TR ...
monke's user avatar
  • 45
3 votes
1 answer
396 views

How can I tell if a Taproot input is a key path spend or a script path spend?

In some analyses of chain activity, I sometimes see Taproot spends divided into key path and script path. Why are they called that? Which BIPs should I read to learn more? When I look at a P2TR tx in ...
Hunter Beast's user avatar
3 votes
1 answer
124 views

How do we create funny segwit v1 taproot bech32m addresses?

Look at what this user has broadcasted, destination addresses are interesting: bc1pjjjkkkklllllmmmmmmnnnnnnnpppppppqqqqqqqqqrrrrrrrrraq663x0t ...
Mercedes's user avatar
  • 802
3 votes
1 answer
275 views

How can I find the public key corresponding to a P2TR input?

Can you please tell me what is inside the Taproot Witness data? For P2WPKH, it is defined in BIP-0141 and we have: <signature> <pubkey> But for Taproot, I can't find anything similar. Per ...
Sina Sharifzade's user avatar
3 votes
1 answer
96 views

Error creating a Taproot descriptor with a single key as script path

I need to implement 1 of 2 multisig with P2TR. My friend's Bitcoin public key is 0374d5f29bc6c15066437856c512f7f9e5a14a1eb93cab2776d33b27b4103c62d8. My own Bitcoin public key is ...
Wei's user avatar
  • 51
3 votes
1 answer
185 views

Validation of segwit v0-v1 tx automatically adds OP_CHECKSIG?

When I create a segwit transaction v0 (P2WPKH) or v1 (P2TR key-path spend) I do like that (let's spend a P2TR output): Locking Script (of the P2TR output I'm spending): OP_1 PK_size PK Witness: 1 (...
alemaz98's user avatar
  • 143
3 votes
1 answer
757 views

Where can I find taproot spend examples on testnet/signet?

I am in the middle of writing some Taproot libraries and would like some testnet/signet p2tr spends. Is there an easy way to find them? Most explorers don't have any filters like that. Even a list of ...
Jimmy Song's user avatar
  • 7,759
3 votes
1 answer
705 views

Taproot signing with PSBT: How to determine signing method?

As far as I can tell there are three ways you can produce a valid Schnorr signature in a Taproot environment: For a p2tr output that uses a BIP-0086 commitment (key spend, sign with internal key, ...
guggero's user avatar
  • 238
3 votes
1 answer
368 views

Tests for Pay To Taproot addresses?

I am having trouble finding examples showing a known WIF to a valid mainnet P2TR address. I am working on a tool and want to see if my P2TR conversions/encodings are outputting the correct P2TR ...
m1xolyd1an's user avatar
  • 5,636
2 votes
2 answers
123 views

tracking invoice address type migration

I'd love to see charts with stats on percent of utxos by invoice address type (specially P2PKH, P2SH, P2SH-P2WPKH, P2WPKH, P2TR), over time; and same for percent of coin supply. No doubt I can pay a ...
Mercedes's user avatar
  • 802
2 votes
1 answer
118 views

non-mandatory-script-verify-flag (Invalid Schnorr signature) when trying to reveal a TR output

I'm building a Bitcoin wallet, and I'm trying to spend a Taproot output via a script spend path, but I keep running into this "Invalid Schnorr signature" error from my RPC node: { "...
Sherwin Li's user avatar
2 votes
1 answer
271 views

"Witness program hash mismatch" code -26 when broadcasting a transaction

I'm trying to broadcast a transaction to my RPC provider: curl https://my-quicknode-rpc-provider/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method": &...
Sherwin Li's user avatar
2 votes
2 answers
729 views

Get the scriptPubKey from a Taproot address

I have this function that converts a Bitcoin private key as an integer to a public key and an address. def get_seg_v1_from_pkey(imported_key): imported_key_toint = int(imported_key) ...
ChristianOConnor's user avatar
2 votes
2 answers
430 views

How do you calculate a taproot sighash?

I'm having trouble manually recreating the taproot sighash from the example below. I used btcdeb to pass in an input transaction (with a P2TR output), and a valid tx that spends from it. In the logs ...
Darius's user avatar
  • 789
2 votes
1 answer
172 views

Issue when broadcasting Taproot transaction to older nodes

I'm trying to broadcast a Taproot transaction to random nodes across the network (Testnet3). When I try to broadcast to older nodes like 0.18.0, I get the error "Witness version reserved for soft-...
user avatar
2 votes
1 answer
183 views

How can I spend a mix of UTXOs (p2sh, p2wpkh, p2wsh) along with a p2tr UTXO?

I'm constructing a script to spend multiple distinct UTXOs in a single transaction. I've successfully combined all UTXOs except for two. Succeeding in spending a P2TR with P2PKH UTXO. I encountered a ...
Mohsen Haydari's user avatar
2 votes
1 answer
474 views

Recognizing Taproot outputs in raw transactions

What can be the contents of an P2TR output script? Is it always OP_1 0x20 <32-bit public key>? Can multisig script be there, and if yes - in what format, and more importantly - how do I convert ...
DimaA6_ABC's user avatar
2 votes
1 answer
200 views

Using key aggregation (multsig) in P2TR script path spends

I know that it is possible to create a 2-2 multsig using Taproot by combining both private keys into one public key and defining that as the key path spend. I also know that it is possible to use ...
Hellwerker's user avatar
2 votes
1 answer
187 views

Taproot Script Path Spending can't pass signature verification

I am trying to verify the witness of a P2TR transaction, but the signature verification failed, could you please help? The raw transaction: ...
lj zn's user avatar
  • 31
2 votes
1 answer
300 views

How to create a 1-of-2 multisig with P2TR?

We have two companies and we want to spend funds with 1-of-2 multisig. We successfully did such a multisig with P2SH. How can I do this in P2TR? Can any give me a detailed instruction step by step? ...
Wei's user avatar
  • 51
2 votes
1 answer
195 views

Error validating transaction: unexpected witness payload for non-witness script in a P2TR using script path

I am trying to create a raw transaction P2TR, spending a Taproot UTXO using the script path. I did the following: Create a random private key d and corresponding pubkey P (the internal pubkey) ...
alemaz98's user avatar
  • 143
2 votes
0 answers
31 views

Would exchanges save block space by defaulting deposit addresses to P2TR? [duplicate]

If inputs weigh less in P2TR than other address types, and exchanges conduct big batch transactions for withdrawals, is there a significant efficiency gain in block space they consume if most of their ...
Rex Everything's user avatar
2 votes
0 answers
98 views

Is there a limit on the number and size of script inputs when spending a script path in a P2TR transaction?

From BIP 341, Spending using one of the scripts: A Taproot output can be spent by satisfying any of the scripts used in its construction. To do so, a witness stack consisting of the script's inputs, ...
Pramod Kandel's user avatar
1 vote
1 answer
73 views

How to identify P2TR output type?

The scriptpubkey alone can be used to identify the type of address. However, I'm debugging a library that's having difficulty differentiating the following transaction/scriptpubkey from a p2tr ...
arshbot's user avatar
  • 1,778
1 vote
2 answers
367 views

Is tweak used when spending from script path for Taproot?

I understand that a taproot output can be either spent using key path or script path. With key path, a tweak is applied to the private key and then sign the sighash. The signature is provided as a ...
Joy Wang's user avatar
1 vote
1 answer
66 views

Is it true that we don't care about parity with the key path, but it is not case with the script path? (Taproot)

I am reading materials related to the Taproot (specially, BIP341) and I know that there is two possible ways to spend the output: via key path via script path I also know that the Taproot output ...
LeaBit's user avatar
  • 930
1 vote
1 answer
127 views

Are there plans to make a script invalid if there is more than one element left in the stack?

In BIP62, it was proposed to make a script invalid if there was more than one element left in the stack after execution. This proposal was eventually withdrawn. From what I read, some people have ...
mathboi's user avatar
  • 193