Questions tagged [segregated-witness]
This tag should be used for questions regarding Segregated Witness (segwit), an activated softfork that defined a new transaction format which doesn't include signatures in the transaction identifier (txid).
480
questions
3
votes
1answer
294 views
How can the segwit witness data be “off-chain”? What does it really mean?
I have several questions regarding the segwit witness data. My current understanding is as follows.
Before segwit, the witness data was part of the input that the user had to provide so that they ...
1
vote
2answers
195 views
Can a single wallet generate (and use) both SegWit and non-SegWit addresses?
Is a Segwit wallet able to generate and use non-Segwit addresses?
I'm using Bitpay's Bitcore to create wallets and generate new addresses for the users of my platform. I'm also using Bitcore-wallet-...
3
votes
1answer
184 views
Would a Schnorr PubKey be a different length than a Taproot PubKey like P2WPKH and P2WSH?
A P2WPKH PubKey is shorter than a P2WSH PubKey. Would this also be the case that a Taproot PubKey is larger than a Schnorr PubKey?
If so, wouldn't people be incentivised to use the Schnorr PubKey and ...
1
vote
1answer
417 views
Compatibility questions regarding Native Segwit addresses
I have a question regarding Native Segwit addresses. I understand that those addresses are more efficient and that you save on fees when you send BTC from them. However, does it matter which type of ...
0
votes
1answer
31 views
Error: Non-canonical DER signature when attempting to broadcast signed Segwit Transactions
I'm trying to build a native Segwit transaction programmatically, however, whenever I attempt to broadcast the transaction, it returns this error:
non-mandatory-script-verify-flag (Non-canonical DER ...
3
votes
1answer
36 views
What is the “value” in a Segwit sig hash?
The BIP143 docs state that the value is: "value of the output spent by this input (8-byte little endian)"
If I have a single UTXO of value 10,000 sats and I'm using this as an input for a ...
1
vote
1answer
53 views
Version prefix used for Bech32 addresses
I was compiling a table for Version prefix (hex) and Base-58 result's prefix for different types of Bitcoin addresses.
I came across the content here: https://en.bitcoin.it/wiki/...
-1
votes
1answer
57 views
How to get the raw signature data of a transaction?
With the use of segwit, signature data is no longer part of transaction body and thus canāt be retrieved from block explorers. So is there a Bitcoin rpc method in order to get it directly without ...
7
votes
1answer
219 views
What are the different upgradeability features in the BIP-Taproot (BIP 341) proposal?
What are the different upgradability features in the BIP-Taproot (BIP 341) proposal?
Why are there so many upgradability paths? Is there something an annex can do that a leaf version can't?
This ...
1
vote
1answer
202 views
Export from Bitcoin ā import to Bitcoin Cash
I have address 3GXXiZhq1MZFeWtM6wFUWDA9wSLQh2NU6E, generated by my Bitcoin Core v0.20.0. Accidently I sent Bitcoin Cash there. I use dumpprivkey 3GXXiZhq1MZFeWtM6wFUWDA9wSLQh2NU6E console command and ...
1
vote
2answers
172 views
What's the blocksize limit after segwit and how do legacy nodes deal with segwit transactions?
Normally, I heard that the bitcoin blocksize is 1MB, but with the Segwit update the blocksize can be up to 4MB, so we should say that the blocksize is 4MB, right? Moreover legacy nodes only receive ...
4
votes
1answer
421 views
Why does segwit save space on the blockchain?
I've had a hard time finding a good source online that explains segwit.
I've read the basic idea is to store the scriptSigs separately as the scriptSig is potentially malleable, and then compute the ...
2
votes
1answer
65 views
What makes a transaction a SegWit transaction or a non-SegWit transaction?
Can we say that if there is at least 1 input with a legacy script then the tx is a non-segwit transaction?
1
vote
1answer
165 views
how to generate bech32/segwit address from pubkey in golang
I am trying to generate bech32/segwit address in golang with the following code:
var pubkey *btcec.PubKey
address, err := btcutil.NewAddressPubKey(pubkey.SerializeCompressed(), chainParams)
if err != ...
0
votes
1answer
53 views
Are P2PKH or P2SH transactions malleable?
BIP66 fixed one source of transaction malleability and segwit, to my understanding, fixed the rest of the sources. Yet, there are still many common types of non-segwit transactions in use, like P2PKH ...
2
votes
1answer
45 views
Retrieve address when create a channel lightning network
I have two nodes in regtest.
the first one is:
$ l1-cli getinfo
{
"id": "02c3f99e70c8da59e428dd119d36c0a1317e5cd85218a760355b5f9b4f822f6109",
"alias": "ALICE&...
1
vote
2answers
1k views
segwit compatilibity bc1 and 3 bitcoin wallet?
I would like to know what's the better aproach for upgrading from a legacy address to a segwit one, but there are two type of segwit as P2SH starting with 3 and Native SegWit (bech32) starting with ...
2
votes
1answer
103 views
Get public or private key from address with C-lightning
I'm studying Lightning network and I use c-lightning.
I can Get a new address with newaddr method, but I can't find private key.
My address is bcrt1qmckts70jsq2u5886lgcq2yn7xjmp97t09zlrg, how can I ...
1
vote
1answer
35 views
How were miners supposed to signal support for BIP148?
Under BIP141 (SegWit), you could signal support by setting nVersion bit 1 equal to 1. BIP9 counted:
20000002 100000000000000000000000000010
20000012 100000000000000000000000010010
30000007 ...
0
votes
0answers
28 views
Speed of decoding Bech32 addresses
I am trying to understand if Bech32 can be a bottleneck in some specific cases (only Bech32, not Bitcoin itself).
What is the hypothetical speed decoding the address back to the streamable format in ...
1
vote
1answer
46 views
Hardware Wallet Vulnerability Fix - Verifying Input Value
I'm confused by the proposed solution posted in the blog regarding the recent vulnerability https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-...
6
votes
1answer
154 views
Segwit & Offline Signing
Yesterday Trezor released details of a segwit-related hardware wallet vulnerability.
The writeup claims that providing full previous transactions to the hardware wallet prevents the exploit.
My ...
4
votes
1answer
105 views
Why is a minRelayTxFee of 1000 sat/kb not equivalent to 250 sat/kw?
Naively, we would expect a minRelayTxFee of 1000 sat/kb to correspond to 250 sat/kw. However, apparently this is not so according to this issue (ACINQ), which also references this issue (c-lightning). ...
1
vote
1answer
109 views
Decodescript for a Testnet pubkey hash address
This is the address information:
bitcoin-cli validateaddress n35oDVMPNkHRzBKy7q9RDB7r5e8qbVa9SW
{
"isvalid": true,
"address": "n35oDVMPNkHRzBKy7q9RDB7r5e8qbVa9SW",
"scriptPubKey": "...
2
votes
1answer
62 views
What is the link between address and use of the UTXO?
I state that I'm still a beginner. I need some clarification. I am using the Testnet. This is the information regarding the address I used to receive funds from a Faucet
bitcoin-cli validateaddress ...
3
votes
1answer
74 views
Sign manually P2SH-P2WPKH with openssl
I have a very similar problem of my last post before post again, I tried a lot of time but whitout success. I studied this link but I don't find solution.
I have 50 bitcoins (total Amount) and I want ...
0
votes
1answer
30 views
Limitations in P2WSH custom script
I did a stupid custom validation script in P2SH where after check signature, check if OP_3 is equal of OP_3. Now I want to move the same logic in P2WSH multisignatue 1-3.
it's my script
$ bitcoin-...
3
votes
1answer
109 views
Sign manually P2WSH native with Openssl
I'm studying the segwit part, and I want to sign P2WSH (native) manually (openssl).
I just read the BIP0143 and I see the new transaction digest.
Double SHA256 of the serialization of:
1. ...
1
vote
1answer
64 views
Naming in segwit script
I have some doubts about naming in witness script/transaction.
P2SH-P2WSH (multisig)
WITNESS_SCRIPT = OP_3 <public key1> <public key2> <public key3> <OP_2>
(is it witness ...
2
votes
1answer
361 views
Redeem script. script hash, witness script and witness program
I have a little confusion about naming in Bitcoin.
Redeem script is the conditions that will be satisfy.
For example P2PKH inside P2SH
OP_DUP OP_HASH160 <PubKHash> OP_EQUALVERIFY OP_CHECKSIG ...
1
vote
0answers
77 views
Bad witness error in P2SH-P2WSH
I've managed to build a P2SH 2-of-3 multisig contract that works, ie I can create addresses, send coins to them, and spend the outputs. Now I'd like to transition that solution to a P2SH-P2WSH, but I'...
1
vote
1answer
102 views
P2SH-P2WPKH stack
I'm studying P2SH-P2WPKH and when I create the signed transaction I can see this stack (using btcdeb)
script | ...
1
vote
0answers
59 views
Generate p2sh-segwit and address bech32
When I use bitcoin-cli getnewaddress "" "p2sh-segwit" which kind of script is inside And can I convert if in bech32?
3
votes
1answer
59 views
Checksum P2WSH failed
My goal is replicate the same P2WSH of https://en.bitcoin.it/wiki/BIP_0173
tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7
I'm able to generate the "first" part before checksum.
...
1
vote
1answer
116 views
Generate P2WSH native
I want to create P2WSH native like https://en.bitcoin.it/wiki/BIP_0173.
I have already a script to generate P2WPKH and it works, thank the python part and re-arrange group byte works.
I read that ...
1
vote
1answer
167 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 ...
3
votes
1answer
275 views
Confusion about Addresses
I have a little bit confusion about addresses segwit and not segwit.
I can see P2WPKH and P2WSH from this link https://en.bitcoin.it/wiki/BIP_0173, and they are segwit and start with bc (mainnet) or ...
0
votes
1answer
168 views
getting public key from any raw transaction - what to take care of?
i need to retrieve public key of transaction sender.
now i know there are 03 compressed pubkeys and 04 uncompressed ones.
but how is this working with segwit and multisig addresses?
can you please ...
0
votes
2answers
58 views
Can I build a raw segwit transaction with no segwit inputs?
I am trying to build a segwit transaction between a regular p2pkh address and a p2sh 2-of-2 multi-signature address. I have successfully transacted back and forth between these two addresses before (...
1
vote
1answer
139 views
Why does Bisq claim that my “native segwit” receive addresses are “invalid”?
Every time I'm transferring over the funds from Bisq to Bitcoin Core, I get the error:
Invalid address.
(Or something along those lines.)
Only after generating another receive address in Bitcoin ...
0
votes
1answer
63 views
Signing a Segwit Multisig Transaction
I am creating some test code which can create transactions and sign then, I already could do it with NON-Segwit multisig address, they were signed using my code and broadcasted.
But when I tried with ...
0
votes
0answers
61 views
Generate P2WPKH
I'm able to generate P2PKH from bash but I don't find the steps to generate P2WPKH (not wrap)
I saw this link and I understand that I have to do base58 of Public key hash and prepend 00, but I don't ...
2
votes
1answer
232 views
What's the segwit transaction serialization “flag” field for?
According to bip 141, the segwit transaction serialization format (used to compute the wtxid) is:
[nVersion][marker][flag][txins][txouts][witness][nLockTime]
The bip mentions that the flag field ...
0
votes
0answers
34 views
How to strip witness data from block in json/hex format?
I have a JSON format block (Height:500000) here. As you can see here, it is a segwit block and its actual size is 1048581 and stripped size (without witness data) is 981404. I want to strip full node'...
3
votes
1answer
94 views
Can a coinbase transaction have a segwit output?
And more generally speaking, are there any restrictions on the output of a coinbase transaction?
0
votes
1answer
311 views
Segwit with Multisig
I was analyzing a Bitcoin transaction that works both with Segwit and non-Segwit for multisig Scripts.
Here is the transaction: https://www.blockchain.com/en/btc/tx/...
0
votes
1answer
85 views
Signmessagewithprivkey result is different than txinwitness
I'm studying segwit and I'm doing some experiment in regtest.
I create a raw transaction with P2SH address.
My Transaction data without signature is:
...
0
votes
1answer
596 views
How to generate legacy receiving address in Bitcoin core 0.19.x.x
I must have missed the memo. I see Bitcoin Core 19.1.0.1 defaults to generating Bech32 receive addresses (prefixed with "bc1"), and offers a checkmark to generate P2SH addresses instead (prefixed ...
1
vote
1answer
115 views
What Does “Activation” Actually Mean In Bitcoin?
During the multiple issues with Bitcoin this year with soft and hard forks, and Segwit, I have read as much as I can about how all these changes are "deployed", eg BIP9, BIP91, BIP148, BIP's 141-146.
...
0
votes
1answer
68 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 ...