Questions tagged [p2wpkh]

Pay to Witness Public Key Hash is the native SegWit v0 single-sig output format. P2WPKH addresses are Bech32 encoded and start with the prefix `bc1q`.

Filter by
Sorted by
Tagged with
2 votes
1 answer
95 views

What is the content of ScriptPubKey for P2WPKH?

What is the content of ScriptPubKey for P2WPKH? Master bitcoin book 2end edition says the following (link): Example P2WPKH output script 0 ab68025513c3dbd2f7b92a94e0581f5d50f654e7 In programming ...
dassd's user avatar
  • 1,029
2 votes
1 answer
108 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
743 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.6k
1 vote
3 answers
63 views

How can clients know the destination address for this P2WPKH transaction?

This is the raw hex of a random transaction I picked up on the blockchain: ...
Pedro D.'s user avatar
1 vote
1 answer
69 views

Is there authoritative documentation on how to generate a P2WPKH address?

I Googled and found some BIPs but looking through bitcoincore.org, I could not find documentation on the process to generate a P2WPKH address. Looking through other random articles, I see the process ...
Ash's user avatar
  • 111
0 votes
1 answer
51 views

How can I optimize my python script that creates a btc native segwit tx with an OP_RETURN message?

I have the following code that successfully created a bitcoin transaction with an OP_RETURN message: from bitcoinutils.utils import to_satoshis from bitcoinutils.setup import setup from bitcoinutils....
ChristianOConnor's user avatar
1 vote
1 answer
91 views

How do I use python-bitcoin-utils to add an OP_RETURN message into a bitcoin transaction?

I have the following code that successfully created a bitcoin transaction with python-bitcoin-utils: from bitcoinutils.utils import to_satoshis from bitcoinutils.setup import setup from bitcoinutils....
ChristianOConnor's user avatar
0 votes
1 answer
154 views

Generated new p2wpkh address from pubkey of existing address - but found it has old transactions!

this is certainly my lack of understanding, but it challenge what i know about blockchain. I created a new address p2wpkh from public key with bech32 (testnet) on ‎2022-11-10 : ...
Kimboo Rasta's user avatar
1 vote
1 answer
145 views

p2wpkh spending problem

I use unsynced bitcoin core wallet because data is too costly and I do not trust anything other than bitcoin core, people told me to do so. Playing around I originated this transaction id: ...
andre's user avatar
  • 21
0 votes
2 answers
411 views

Bech32 encoded address to scriptPubKey

My goal is to parse a BTC transaction and validate if the transaction was sent to a given BTC address. So I need to transform a BTC address to the scriptPubKey used in the transaction. I got this ...
Niel Deckx's user avatar
6 votes
1 answer
393 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
0 votes
1 answer
112 views

Why does my hash not line up with the one in the scriptPubKey?

I got some btc in testnet, here are the outputs. this is the UTXO that i get my btc { "value": 17.24756333, "n": 1, "scriptPubKey": { "asm": "...
KHJUAF403456ZS3K564WAEF's user avatar
0 votes
1 answer
703 views

sign native P2WPKH with bitcoinjs-lib (signing sighash) (non-mandatory-script-verify-flag)

i experimented a lot with p2wsh multisig configurations with bitcoinjs-lib. but when i tried to sign a standard native segwit p2wpkh to p2wpkh transaction everything goes ok except for bitcoin-cli ...
Antoni's user avatar
  • 277
2 votes
1 answer
826 views

Compute checksum for Bech32 address

The Bitcoin Wiki page for Bech32 addresses explains how one can create a bech32 address from a public key. In step 6 it says- Compute the checksum by using the data from step 5 and the H.R.P (bc for ...
Nissim R's user avatar
  • 123
2 votes
2 answers
121 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
  • 795
0 votes
1 answer
381 views

Missing Witness field in p2wpkh decoded tx hex

I have placed together a raw tx hex but when it's unable to be broadcasted as I keep getting an error below sendrawtransaction RPC error: {"code":-25,"message":"bad-txns-...
jiamijiang's user avatar
1 vote
0 answers
103 views

Java bip32 library

I'm looking for java library that will cover bip32 address derivation (xpub to P2PKH, P2SH, P2WSH, P2WPKH, P2SH-P2WPKH). There seem to be a lot of libraries covering P2PKH, but not much else (like ...
Tony Sanak's user avatar
  • 1,664
4 votes
2 answers
1k views

What are the scriptPubKey, scriptSig, redeem script and witness for the various output types?

scriptPubKey, redeem script, witness script, witness program are defined in this StackExchange post. What are the scriptPubKey, scriptSig, redeem script and witness for the various output types (P2PKH,...
Michael Folkson's user avatar
3 votes
1 answer
699 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
  • 779
2 votes
3 answers
227 views

How hard is it for an exchange to adopt native segwit? Is it not as simple as updating the address regex checker on the front-end?

Just wondering, maybe I'm missing something. Are there changes on the backend needed to be implemented as well? Not as simple as changing the regex validation on the front end?
Dwyte's user avatar
  • 123
2 votes
1 answer
116 views

createPaymentTransactionNew with Bech32 address

How to properly call createPaymentTransactionNew using @ledgerhq/hw-app-bt to spend utxos from a bech32 transaction? This is the code I'm using to call it, having previously defined inputs and purpose,...
Federico Caccia's user avatar
0 votes
2 answers
149 views

Spending transaction output with only xpriv key

Is it possible to spend a P2WPKH transaction output, with only knowing the xpriv key and not knowing the specific private key that corresponds to the public key of the transaction?
Marko's user avatar
  • 111
0 votes
1 answer
576 views

Convert Electrum p2pkh wallet to p2wpkh one?

Is it possible, in Electrum, to convert a p2pkh wallet to a p2wpkh one, so I can use the Lightning network?
Geremia's user avatar
  • 4,556
0 votes
2 answers
569 views

Generating P2WSH addresses | Is there a standard WitnessScript?

For the examples below I am going to be talking of 1-of-1 multisig only derived from a single private key. For P2WPKH, the address is generated using using hash160 of the public key which acts as the ...
GMaster's user avatar
  • 187
0 votes
1 answer
322 views

Three different HEX having same wallet address how possible?

HEX1: 1111111111111111111111111111111111111111111111111111111111111111 public key: ...
Oliverkahn's user avatar
4 votes
1 answer
849 views

What is the size and weight of a P2WPKH input?

I'm investigating diverging P2WPKH input size calculations on two Bitcoin projects and some blog posts. I'm looking for a detailed explanation of the exact weight, vsize and serialized length of a ...
Murch's user avatar
  • 72.6k
0 votes
1 answer
487 views

"scriptSig" for P2SH-P2WPKH

I'm not sure I understand the fields of my input. I have a P2SH address (Testnet). This is the input of my transaction: "vin": [ { "txid": "...
MaXbeMan's user avatar
  • 125
1 vote
1 answer
218 views

How to interpret the Descriptor field?

These are my UTXO in Tesnet environment: { "txid": "93ae7787fe8203e9f13534205ca0310baf8bf5e2b55b2faa1f8b09134f475208", "vout": 1, "address": "2N4VywDy3DnkCmCM8yvfMSFHiEt2ePxzLXu", "...
MaXbeMan's user avatar
  • 125
3 votes
1 answer
129 views

Is the dust output limit the same for p2wpkh and p2wsh?

I've seen mentioned in a few places that the dust limit for an output to be considered standard is minRelayTxFee*3. Based on this, I would expect the dust limit for a p2wsh output to be larger than ...
Darius's user avatar
  • 779
1 vote
1 answer
456 views

ScriptSig in P2SH-P2WPKH BIP16

I have some doubts about P2SH-P2WPKH BIP16. I can read the witness program and I understand that a node is triggered when find 0 and 20 o 32 bytes in scriptSig or ScriptpubKey, more precisely: If is ...
monkeyUser's user avatar
3 votes
1 answer
166 views

Can a coinbase transaction have a segwit output?

And more generally speaking, are there any restrictions on the output of a coinbase transaction?
Darius's user avatar
  • 779
0 votes
1 answer
179 views

What is the signature digest for Segwit outputs

(Assume there's no OP_CODESEPERATOR) For standard P2PKH, the signature digest is generated this way: NewTransaction settle the TxOuts well set all TxIn scripts to empty insert the Previous Locking ...
gudako's user avatar
  • 159
0 votes
1 answer
417 views

P2WPKH - which private key is used to generate signature?

I am looking at the BIP143 P2WPKH example. I am kind of following until the generation of the sigHash: c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670 but then that is used to ...
SCBuergel's user avatar
  • 115
5 votes
1 answer
343 views

Convert WIF to Witness PubKey Hash Address in Go

How can WIF be easily converted to WitnessPubKeyHash in Go? We need to get the public key from WIF and than calculate witness program as ripemd160(sha256(compressed_pub_key)). But is there a ...
Kuba's user avatar
  • 151
0 votes
2 answers
475 views

SHA256 vs RIPEMD160 in SegWit

In Pay-To-Witness-Public-Key-Hash (P2WPKH), the RIPEMD160 hash function is used to hash the public key of the recipient in the locking script. On the contrary, Pay-To-Witness-Script-Hash (P2WSH) uses ...
dcfg's user avatar
  • 394
7 votes
1 answer
2k views

In simple terms, what are the major differences between P2WPKH and P2WSH bech32 addresses?

I've read over the bip173, bip141, and bip143 specifications and they're a bit too technical to get at the simple answers I'm looking for.
kawthuldrok's user avatar
3 votes
1 answer
411 views

scriptcode, scriptsig, pubkeyscript confusion

I've been banging my head on a desk for a few days trying to understand the segwit protocol properly. Another roadblock has thrown me off-guard and I am struggling to grasp the concept of "scriptCode:...
cryptodescriptor's user avatar
1 vote
1 answer
896 views

P2SH-P2WPKH - has always segwit UTXOs?

I've been reading a lot of docs on BTC transaction structure, and find it really confusing when it comes to SegWit story. So, the very first thing is, if I've P2SH-P2WPKH address, does it mean that ...
Jaroslav Gorjatsev's user avatar
5 votes
1 answer
3k views

How do I Derive Bech32 Address from P2WPKH Output Script?

I am building a small script to decode the raw coinbase transaction data into a human-readable viewer without external scripts to better my understanding around the subject. I've noticed that there ...
Mason Ticehurst's user avatar
0 votes
1 answer
373 views

BIP 84, BIP 173 Implementation in BitcoinJ

Can BitcoinJ (Java) supports complete implementations of BIP 173, BIP 84? How can segwit address can be created using BitcoinJ for SPV wallet?
iamrajshah's user avatar
1 vote
2 answers
784 views

Is a P2WPKH address synonymous with a Bech32 address?

BIP142 when encoding a segwit P2WPKH address is using a base58 address format (address p2xtZoXeX5X8BP8JfFhQK2nD3emtjch7UeFm in the example). I understand that BIP142 predates BIP173 but are P2WPKH ...
Mike D's user avatar
  • 3,529
0 votes
0 answers
538 views

Unable to broadcast native P2WPKH (SegWit) TX; malformed, but how?

I'm trying to add SegWit functionality to my app but am running into trouble building my transaction. I've read BIP143 so many times I virtually have it memorized, and I've followed it to the letter. ...
Festus Martingale's user avatar
6 votes
1 answer
915 views

Can I mix P2PKH and P2WPKH inputs in the same transaction?

I'm trying to increase my knowledge of bech32 and SegWit and to that end am working my way through this explanation. Here's a hypothetical situation I'm trying to understand. Let's say Jamal has ...
Festus Martingale's user avatar
3 votes
1 answer
2k views

How to quickly find the private key from Segwit P2SH address?

I have a very large list of Segwit addresses for bitcoin, starting with '3' and do not know the corresponding legacy '1' address for them. How can I quickly find the corresponding legacy address to ...
Joe's user avatar
  • 31
0 votes
1 answer
666 views

P2SH-P2WPKH private key or revert to P2WPKH

Is there a way to get the private key out of an P2SH-P2WPKH address, using Bitcoin Core 0.15.1? If not, is there a way to get the origin P2WPKH address to get the private key out of this address?
DjangoSi's user avatar
1 vote
1 answer
973 views

Segwit Address Supporting Testnet Faucet

Looking for a good Segwit supporting testnet faucet and preferably one that supports P2WPKH addresses, however answers that allow only P2WSH are fine too.
Matt Jensen's user avatar
30 votes
1 answer
28k views

What is P2PK, P2PKH, P2SH, P2WPKH - ELI5

Explain like I'm 5 years old and my other half of the brain is surgically removed :) I don't want to put a lot of stress on my brain Also what is the difference between BTC held in P2SH and Unspent ...
user380208's user avatar
3 votes
1 answer
685 views

Why does SegWit offer P2SH nesting?

I'm reading about SegWit and the BIP 141 in particular and I don't understand what is the motivation behind the P2SH nesting. At first I thought the P2WPKH is not valid on non-upgraded nodes, so ...
tsusanka's user avatar
  • 355
4 votes
0 answers
889 views

To sign raw transaction with Segwit Address in the TestNet

I am using Bitcoin core 0.14.1 testnet. I created a Segwit address. transfer some coins to this address. Now I want to spend it. I created a raw transaction using console command i.e. ...
DOLLY PATWA's user avatar
1 vote
0 answers
202 views

HD P2SH Wallets Compatibility with P2WPKH

Are BIP32 Hierarchal Deterministic compatible with P2SH addresses? Not as multisig but instead for the new P2WPKH?
m1xolyd1an's user avatar
  • 5,596