The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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).

Filter by
Sorted by
Tagged with
1
vote
1answer
38 views

Error Signing P2SH-P2WSH MultiSig - “Unable to sign input, invalid stack size (possibly missing key)”

I am trying to create and spend a P2SH-P2WSH transaction using bitcoin-cli but am getting "Unable to sign input, invalid stack size (possibly missing key)" when I try to sign the Multi-Sig transaction ...
6
votes
2answers
477 views

Most efficient way to store Segwit Address in a database

This is not a duplicate of What is the most efficient way to store bitcoin addresses in a database? but it's the same question except I need a segwit answer. Let's say I wanted to store every ...
0
votes
1answer
36 views

How to spend from a segwit address generated by a legacy wallet?

I used atomic pay payment gateway and a segwit address was generated by XPUB key i'm unable to spend the coins i sent to the generated address and coins are not visible in my legacy wallet what to do ?...
0
votes
1answer
18 views

Witness data storage localisation in the blockchain

Since segregated witness is in place inside Bitcoin blockchain, my understanding is that witness data are no longer stored inside the blocks, so if blocks are linked to each other where theirs ...
1
vote
2answers
47 views

How does storing the witness outside of the block prevent malleability?

I have some question on how segregated witness work. I'm reading this post and in the answer exist this phrase Since signature data (witness data) is stored outside the transaction (and outside ...
0
votes
1answer
35 views

How Segwit makes transactions smaller? What about the witness?

I have seen similar questions without a clear answer. So, how does Segregated Witness make transactions smaller? I understand it removes data from the transaction hash and solves malleability ... But ...
2
votes
1answer
74 views

How to calculate p2wsh signature?

I read the bip143, but didn't understand how to calculate the scriptCode of p2wsh. bip143 told us: A new transaction digest algorithm is defined, but only applicable to sigops in version 0 witness ...
0
votes
1answer
64 views

Javascript library or code that can convert an “uncompressed” bitcoin private key to a compressed one

I forked a pretty old brain wallet generator: https://dvdbng.github.io/memwallet/ -- Currently it generates uncompressed bitcoin private keys. Is there a javascript library that can convert an ...
5
votes
2answers
257 views

Is there a difference between bytes and virtual bytes (vbytes)?

In an Optech newsletter, size is referred to using vbytes. Is there a difference between vbytes and bytes? If so, what is the difference?
0
votes
0answers
43 views

Mycelium not reading segwit bech32 (bc1) addresses from a private key

I'm trying to import my bitcoin private key into the Mycelium android wallet, but it keeps showing up as the legacy address that starts with 1xxx. I sent some coins to the bc1 address and I verified ...
1
vote
1answer
49 views

How to calculate txid for segwit transactions?

I'm having difficulty calculating txid for recent transactions. I followed bip-141 at https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki For the first transaction in the first block found ...
4
votes
1answer
75 views

How has the Bitcoin average block size recently risen above 3 MB?

I was aware that the block size could rise above the 1 MB cap due to SegWit. However, my understanding was that the block size would still be limited under SegWit. My understanding of SegWit is that ...
0
votes
2answers
67 views

Raw SegWit TX look solid and verifies, but is rejected. Need help figuring out why

Consider the following transaction expressed as hex: ...
1
vote
1answer
27 views

For the 3 bitcoin address types, which can send to each other? Can a valid tx be created that spends to an unspendable address?

I'm just getting started with using bech32 addresses instead of legacy addresses, and I'm not familiar with how the legacy vs segwit compatible vs bech32 addresses play with each other. Can I get an ...
0
votes
1answer
52 views

In practice, are redeemScripts commonly reused?

In regards to P2SH-P2WSH transactions, are Txout-script values identical between transactions? Is it reasonable to expect a business or vendor that accepts bitcoin to be using the same redeemScript ...
0
votes
2answers
53 views

Are non-SegWit transactions still malleable?

SegWit was (amongst other improvements) introduced to fix malleability issues. Does that mean that non-SegWit transactions are still malleable? If so, what types of malleability could still happen in ...
0
votes
1answer
31 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 ...
0
votes
1answer
21 views

Alternative to Python pip bitcoin

This Python pip package https://pypi.org/project/bitcoin/ was originally developed by Vitalik Buterin (that Ethereum guy) but is no longer maintained. Is there any alternative equivalent pip package ...
2
votes
1answer
37 views

Why is a library's signature of a segwit tx different from Bitcoin Core signature?

I have been writing a (yet another) Bitcoin python library primarily for educational purposes; for me and my students. Signing a non-segwit transaction results in a signed tx that is identical to ...
0
votes
0answers
37 views

Will non-segwit addresses still be able to send bitcoin in 5+ years?

My public address starts with 1,and I can currently spend the Bitcoin from it. However, as more and more transactions become only segwit based, will miners eventually just abandon verifying ...
1
vote
2answers
86 views

Bitcoin API with bech32 support

Since a while, I have been using the insight-api to view bitcoin transactions. However, recently I have found out that bech32 addresses are not supported. Now I try to fix this issue and I am open ...
0
votes
1answer
57 views

Find sender's public key in SegWit Transaction

How can I retrieve the sender's public key in a Segwit transaction? For example: https://www.blockchain.com/btc/tx/3179d18d6f36fa77b88909496535485d8188d96b79d295843789a9e0ff6c3e6a I can happily ...
2
votes
1answer
140 views

What does it mean if TXID and WTXID are the same?

I'm having a tough time understanding what exactly WTXID is and what it means when WTXID and TXID are the same (and vica versa). What I understand is that WTXID includes the witness data. Since non-...
3
votes
1answer
60 views

What is the rationale for inclusion of previous amount in SegWit signing process?

When spending a P2PKH output, the "data" we hash only includes the output script from previous transaction but when spending a P2WPKH (the new serialization) we also include the amount field from ...
0
votes
0answers
103 views

Send to bech32 segwit address from Bitcoin Core 17.1

I have a non-HD wallet in Bitcoin Core v17.1. I have never used SegWit before. I need to send some coins to a bech32 address from bitcoin-qt GUI. The problem is after selecting the specific coin ...
1
vote
1answer
66 views

Concept of Block weight and segwit are still unclear

It seems like duplicated question, but i read many articles and posts to undestand about segwit. Below links are something i read What is block weight and how is it different from block size? After ...
4
votes
2answers
134 views

On chain cost of Segwit version 1 versus version 0

How do total blockchain cost for Segwit version 0 compare to version 1 which is being proposed? I'm specifically interested in a single user transactions – both paying to public key (or pk hash) and ...
1
vote
1answer
43 views

What is the O(n^2) signature hashing problem and how does SegWit solves it?

One of the many benefits of SegWit is that it solves the O(n^2) signature hashing problem. What exactly is the O(n^2) hashing problem and how segregating signatures to separate witness field solve it?
4
votes
1answer
82 views

Does v1 Segwit includes v0?

My question is whether the version 1 of Segwit script will allow you to use version 0 scripts types inside of it. In other words, is version 1 superset of version 0? Please include reasoning behind ...
1
vote
1answer
133 views

Multisig scripts hashing (p2sh): difference between legacy and segwit

Some time ago I noticed that, given the same inputs, addmultisigaddress and createmultisig Bitcoin core's methods were generating different p2sh (addresses). I asked around and a user from the ...
1
vote
1answer
69 views

Why do most exchanges still have not implemented segwit bc1 addresses to save block space?

Segwit bech32 bc1 addresses has been out for a good 2 years. Why do most exchanges still refuse to implement such a feature for its users? Exchanges create a bulk of the bitcoin transactions and also ...
0
votes
1answer
55 views

Following SegWit implementation, is BIP-146 signalling and implementation still on the docket?

Is BIP 146, which defines using the low S value, still on the docket to be signalled and implemented given that SegWit fixed the txid malleability issue by moving the witness outside the transaction? ...
1
vote
1answer
288 views

How to calculate segwit transaction fee in bytes?

I'm trying to calculate SegWit transaction fees in bytes, I have two Segwit inputs and 2 segwit outputs. can anyone calculate this transaction fees if I'm paying 100 Sat per byte?
1
vote
0answers
47 views

Stripped segwit data

I have two client Bitcoin, 0.17.0 and 0.12.0 and I want to see the difference between the same transaction. 0.17 has segwit, 0.12 doesn't have. If I do that RPC call in 0.17.0 /bin/bitcoin-cli -...
1
vote
1answer
279 views

Are there still miners or mining pool which refuse to implement SegWit?

It was well known that initially while SegWit got more than 50% of hashrate after activation that a part of the mining pools refused to implement it. But are there still blocks being mined by miners ...
1
vote
1answer
42 views

Failed CHECK(MULTI)SIG operation - BIP143 hash pre-image

Using Blockstream's api to broadcast a raw transaction to the Bitcoin testnet, I encountered the following error: sendrawtransaction RPC error: {"code":-26,"message":"non-mandatory-script-verify-flag ...
0
votes
0answers
24 views

Bitcoin was sent out and still hasn't been received

I sent bitcoin out to a segwit address (P2SH) and it split the transactions in 2 but I still haven't seen them delivered in into the wallet
1
vote
1answer
109 views

How to sweep a bc1… bitcoin segwit address using a mobile app?

I have a bitcoin private key with some money on the segwit bc1 address, but when I try to sweep this private key using mycellium android wallet, it shows up as a 3... address. What other mobile app ...
2
votes
1answer
40 views

Why does witness use count instead of length?

In legacy transaction (without SegWit) the scriptSig is easily parsed by knowing the length of it (a CompactInt value) and without needing to read the script in place. However in SegWit transaction ...
0
votes
1answer
99 views

How to generate the digest from a raw bitcoin transaction for verifying signature of specific input?

I'm writing a stand alone process that needs to verify that a known UTXO is part of a new transaction with a valid signature. Inputs [ UTXO, raw transaction, input_number ] How do to I verify the ...
4
votes
1answer
177 views

Activation of SegWit v1

The segregated witness soft fork of August 2017 included a versioning field which would allow for future incrementation. Anthony Towns has recently posted an early draft of the proposal for the SegWit ...
0
votes
0answers
19 views

Swift implementation of bitcoin transaction creation

Is there a well known and widely used Swift implementation for creating raw Bitcoin transactions and getting their hash (SegWit and Non-SegWit) of signing? If not, is there a reference document that ...
1
vote
2answers
104 views

If I was developing a Bitcoin wallet, should I support both legacy and compatibility addresses?

To receive funds, I was thinking of giving a user the option of displaying two QR codes: Legacy - p2phk e.g. 1AKDDsfTh8uY4X3ppy1m7jw1fVMBSMkzjP Compatibility - p2sh(p2wpkh) e.g. ...
5
votes
2answers
62 views

Why SHOULD the funding tx consume BIP 141 inputs?

In BOLT 02 we read that the funding TX should only consume segwit inputs. The sender: when creating the funding transaction: SHOULD use only BIP141 (Segregated Witness) inputs. What is the reason ...
1
vote
1answer
148 views

Why hash witness script instead of pubkey script in signature?

When a segwit input is signed, the signature will commit to the witness script (or a p2pkh-like script in case of p2wpkh). This is specified in BIP143: For P2WPKH witness program, the scriptCode ...
1
vote
1answer
50 views

Transaction version 2 - bytes between tx version and number of inputs

In the bitcoin transaction version 2, there are additional two bytes (hex: "0001") between transaction version (hex: "02000000"), and number of inputs (hex: "01"). What it is? Here's an example https:...
1
vote
1answer
28 views

which was the purpose of changing the signature of a TX? or it was just a bug before segwit?

Was there any purpose in changing the signature of a transaction? Or it was a bug before segregated witness? Does segregated witness disable some wanted feature?
1
vote
1answer
100 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
1answer
164 views

regtest: ERROR: ProcessNewBlock: AcceptBlock FAILED: unexpected witness data found (code 16) on v0.14.3

I have two bitcoind regtest processes; v0.16.3 and v0.14.3. I got "unexpected witness data found (code 16)" when v0.14.3 node try to received a block from the peer (v0.16.3) How can I fix it? (I'm ...
2
votes
2answers
370 views

How do virtual size, stripped size and raw size compare between legacy address formats and native segwit?

This answer states that SegWit doesn't reduce transaction size. If this is true, why is it cheaper to send a SegWit transaction?