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
30 votes
1 answer
29k 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
9 votes
1 answer
957 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.4k
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
6 votes
2 answers
2k 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
6 votes
1 answer
944 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
6 votes
1 answer
439 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
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
5 votes
1 answer
385 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
4 votes
1 answer
911 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
984 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
  • 75.4k
4 votes
1 answer
2k views

Redeem script for segwit addresses

How does one derive the Redeem Script for the new Pay-to-Witness Pubkey Hash addresses? With existing P2SH it's revealed after providing N number of Public Keys through a createmultisig function in ...
m1xolyd1an's user avatar
  • 5,646
4 votes
1 answer
710 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
  • 365
4 votes
0 answers
897 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
3 votes
1 answer
182 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
  • 789
3 votes
1 answer
428 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
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
3 votes
1 answer
145 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
  • 789
2 votes
3 answers
237 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
2 answers
124 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
996 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
1 answer
187 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,079
2 votes
1 answer
78 views

Exact witness requirements for a segwit transaction with P2PKH and P2WPKH inputs

Segwit transactions can mix segwit and non-segwit inputs: Segwit transaction from mixed addresses (segwit and non-segwit) Can I build a raw segwit transaction with no segwit inputs? But how exactly ...
Lee's user avatar
  • 588
2 votes
1 answer
103 views

the purpose of the field before signature in P2WPKH

what is the purpose of that 02 in this P2WPKH transaction : 01000000 0001 01 d6f3994ab779ac849996a6235699ced672fa4b8334f825a2f1fcb4081c5b0c62 00000000 00 ffffffff 02 1027000000000000 16 ...
user avatar
2 votes
1 answer
189 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
1k views

Using segwit and creating Pay-To-Witness (P2WPKH) addresses

I'm going through this guide: https://bitcoincore.org/en/segwit_wallet_dev/ I might be understanding this incorrectly, but it sounds like the users and/or wallet custodian (coinbase, blockchain.info, ...
m1xolyd1an's user avatar
  • 5,646
2 votes
1 answer
184 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
2 votes
1 answer
123 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
1 vote
2 answers
803 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,569
1 vote
2 answers
494 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
  • 404
1 vote
1 answer
496 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
1 vote
3 answers
86 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
193 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
1 vote
1 answer
86 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
1 vote
0 answers
119 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,689
1 vote
1 answer
250 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
1 vote
1 answer
917 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
1 vote
1 answer
1k views

Segwit Address Supporting Testnet Faucet [duplicate]

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
1 vote
0 answers
207 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,646
0 votes
2 answers
644 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
0 votes
2 answers
160 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
50 views

Why can I not find my transaction in the mempool?

I built a native segwit raw v2 transaction with the pwpkh addresses, and get the decoded transaction as the follows { "version": "02000000", "marker": "00", ...
Jack Tsia's user avatar
0 votes
1 answer
37 views

Incorrect Transaction ID being calculated for a p2wpkh transaction

RAW Signed transaction (signet) ...
Prabhat Verma's user avatar
0 votes
1 answer
252 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
0 votes
1 answer
118 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
878 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
  • 287
0 votes
1 answer
684 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,626
0 votes
1 answer
197 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
379 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
0 votes
2 answers
729 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
332 views

Three different HEX having same wallet address how possible?

HEX1: 1111111111111111111111111111111111111111111111111111111111111111 public key: ...
Oliverkahn's user avatar