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
29 votes
1 answer
26k 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 ...
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.
6 votes
1 answer
876 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 ...
5 votes
1 answer
318 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 ...
5 votes
1 answer
2k 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 ...
  • 983
4 votes
1 answer
1k 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 ...
  • 5,388
4 votes
0 answers
870 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. ...
3 votes
1 answer
502 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?
  • 779
3 votes
1 answer
147 views

Can a coinbase transaction have a segwit output?

And more generally speaking, are there any restrictions on the output of a coinbase transaction?
  • 779
3 votes
1 answer
651 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 ...
  • 68.6k
3 votes
1 answer
382 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:...
3 votes
1 answer
1k 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 ...
  • 31
3 votes
1 answer
92 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 ...
  • 779
3 votes
1 answer
643 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 ...
  • 347
3 votes
1 answer
278 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 ...
  • 131
2 votes
3 answers
215 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?
  • 123
2 votes
2 answers
112 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 ...
  • 637
2 votes
1 answer
686 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,...
2 votes
1 answer
577 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 ...
  • 123
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, ...
  • 5,388
2 votes
1 answer
94 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,...
1 vote
2 answers
742 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 ...
  • 3,404
1 vote
1 answer
403 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 ...
1 vote
0 answers
86 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 ...
  • 1,646
1 vote
1 answer
189 views

How to interpret the Descriptor field?

These are my UTXO in Tesnet environment: { "txid": "93ae7787fe8203e9f13534205ca0310baf8bf5e2b55b2faa1f8b09134f475208", "vout": 1, "address": "2N4VywDy3DnkCmCM8yvfMSFHiEt2ePxzLXu", "...
  • 127
1 vote
1 answer
845 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 ...
1 vote
1 answer
919 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.
1 vote
0 answers
190 views

HD P2SH Wallets Compatibility with P2WPKH

Are BIP32 Hierarchal Deterministic compatible with P2SH addresses? Not as multisig but instead for the new P2WPKH?
  • 5,388
0 votes
2 answers
454 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 ...
  • 374
0 votes
2 answers
163 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 ...
0 votes
2 answers
124 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?
  • 111
0 votes
1 answer
66 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 : ...
0 votes
1 answer
99 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": "...
0 votes
1 answer
484 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?
  • 4,449
0 votes
1 answer
152 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 ...
  • 159
0 votes
1 answer
349 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?
0 votes
1 answer
410 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 ...
  • 247
0 votes
1 answer
266 views

Three different HEX having same wallet address how possible?

HEX1: 1111111111111111111111111111111111111111111111111111111111111111 public key: ...
0 votes
1 answer
397 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": "...
  • 127
0 votes
1 answer
366 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 ...
  • 115
0 votes
1 answer
633 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?
0 votes
1 answer
74 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: ...
  • 1
0 votes
1 answer
222 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-...
0 votes
1 answer
376 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 ...
  • 177
0 votes
0 answers
509 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. ...