Questions tagged [p2tr]

Pay to Taproot is the native SegWit v1 output format. It commits directly to a public key which in turn can optionally commit to a script tree, thus combining capabilities of previous output formats. P2TR addresses are Bech32m encoded and start with the prefix `bc1p`.

Filter by
Sorted by
Tagged with
0 votes
1 answer
40 views

Enforcing PSBT Signature Rules: Finalizer/Extractor and Deserialization Implementation

Should PSBT finalizers/extractors and deserialization functions enforce the rule that a taproot schnorr signature should only append a SIGHASH_* unless it is SIGHASH_DEFAULT (0), or is it left to the ...
solar's user avatar
  • 13
1 vote
1 answer
58 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
  • 512
2 votes
1 answer
43 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: { "...
Michael Hamilton's user avatar
0 votes
2 answers
56 views

Why there duplicated transactions on the blockchain? (with different hashes)

I just found a couple of transactions that looks very similar, they have different hashes, but are exactly equal in everything else: 3d69534a43b4396faac62e84ba6092d539335dd1c6601da626020f69082280c1 (...
eloyesp's user avatar
  • 202
1 vote
1 answer
151 views

How to get signature for tweaked public key in P2TR in case of multiple signature?

EDIT: Can we just tweak the signature with the root MAST as well? As I understand, the public key in scriptPubKey for P2TR is obtained by tweaking (let's call it original public key) and the root of ...
LeaBit's user avatar
  • 512
1 vote
1 answer
90 views

What is the way to create public key in P2TR?

I've started learning Taproot and I'm having trouble understanding some of the general story behind how it works in the context of a public key in scriptPubKey. The segWit v1 (Taproot) scriptPubKey ...
LeaBit's user avatar
  • 512
1 vote
1 answer
65 views

What does CTxOut represent in BIP143 and BIP341?

The term CTxOut is mentioned several times in BIP143 and BIP341. However, I can't understand what it actually represents? I assume it's just the transaction output, but I am not sure and the confusion ...
dassd's user avatar
  • 1,029
2 votes
1 answer
73 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": &...
Michael Hamilton's user avatar
3 votes
1 answer
107 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
  • 795
0 votes
1 answer
44 views

Do we pay cheaper fees for less security in P2TR rather than P2PKH?

Answer quote: P2TR now is a spiritual successor of P2PK: it locks funds directly to a key and only requires a signature to spend the funds. If P2TR UTXOs are guarded by Schnorr signatures and P2PKH ...
Mercedes's user avatar
  • 795
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
1 answer
110 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
8 votes
1 answer
747 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
  • 72.7k
5 votes
0 answers
77 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
3 votes
1 answer
208 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
2 votes
0 answers
70 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
2 votes
1 answer
114 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
1 vote
1 answer
182 views

I get an Invalid Schnorr signature when trying to broadcast a taproot transaction

I have 0.00036134 testnet bitcoin at the segwit v1 address: tb1p3au39skpdd8suuhunr4ymp6ca6akv9keq20v5twuagpmyqntqaasl22f4w I wrote this script to achieve 2 things: archive a hash in a transaction and ...
ChristianOConnor's user avatar
2 votes
2 answers
321 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
3 votes
1 answer
180 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
1 vote
0 answers
77 views

I get a not a P2TR scriptPubKey error when trying to generate a bech32m taproot compliant P2TR address with python

I have the following script that is supposed to derive a taproot P2TR address: from bitcointx import set_custom_secp256k1_path set_custom_secp256k1_path('./bitcointx_secp256k1_here/libsecp256k1.2....
ChristianOConnor's user avatar
3 votes
1 answer
74 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
5 votes
1 answer
320 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
2 votes
1 answer
545 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
  • 131
2 votes
1 answer
127 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
  • 133
2 votes
1 answer
180 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
0 votes
2 answers
159 views

How can I create a multi sign for a large number of users

I want to create a DAO-like wallet where each member would have to sign for any given tx. Tx should go through if 51% of the users signed. Is this possible?
pxr_64's user avatar
  • 123
1 vote
2 answers
230 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
6 votes
2 answers
857 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
2 votes
1 answer
161 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
  • 133
4 votes
1 answer
624 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
  • 133
1 vote
1 answer
131 views

How to choose a nothing-up-my-sleeve (NUMS) point on secp256k1 for use in Taproot?

Per BIP-341, if you want to create a Taproot output that is only spendable via the script-path spend (and not a key-path spend), you must "pick as internal key a point with unknown discrete ...
James O'Beirne's user avatar
0 votes
2 answers
193 views

Is Taproot the best address against quantum computers attack?

I'm looking for an address type for long term storage of bitcoin but I don't know what to choose. I'm not sure if Taproot is more secure than segwit. Another question I have about Taproot, is that if ...
Dodi Alf's user avatar
4 votes
1 answer
216 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
0 votes
1 answer
116 views

What are the last bytes for in a taproot script-path sighash?

I am trying to follow BIP341 to understand the signature hash calculation for taproot script path spends. From the bitcoin testing framework code, I see that if the transaction is spending from a ...
Darius's user avatar
  • 779
1 vote
2 answers
148 views

Can one infer the multisig status of a P2TR spend?

Given raw transaction input/output data, is it possible to know if a Taproot output is multisig or not? I'm getting raw block data from a bitcoin node, and want to classify each spend according to the ...
Bryan Oliveira's user avatar
1 vote
1 answer
162 views

What would happen if you tweaked a public key with an odd y-coordinate?

From BIP341 this example code shows how you can tweak an x-only pubkey: def taproot_tweak_pubkey(pubkey, h): t = int_from_bytes(tagged_hash("TapTweak", pubkey + h)) if t >= ...
Darius's user avatar
  • 779
2 votes
2 answers
313 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
  • 779
6 votes
1 answer
395 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
9 votes
1 answer
511 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
4 votes
1 answer
323 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
3 votes
1 answer
487 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
  • 228
4 votes
1 answer
262 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,720
0 votes
1 answer
88 views

Keypath spending: Verify destination address across address formats [duplicate]

In a Tapscript Keypath Transaction (there is an unrelated Scriptpath too) I can have outputs to all possible address? (I.e. to P2PKH, P2SH, P2WPKH / P2WSH and P2TR) I have a list of addresses in all ...
ByteFlowr's user avatar
  • 133
1 vote
0 answers
66 views

which wallets/softwares utilize taproot capabilites?

this question is not about being able to pay/receive to taproot addresses as I know there's a list for that here. I'm curious to see if anyone knows about wallets/software that utilize taproot ...
Ziya_Sadr's user avatar
2 votes
1 answer
315 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
  • 72.7k
13 votes
1 answer
2k 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
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,664
1 vote
1 answer
157 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
5 votes
1 answer
623 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