Skip to main content
8 votes
Accepted

Why are hashSequence and hashPrevouts computed separately?

The reason is increasing the ability to precompute and/or cache those hash values once for the whole transaction (potentially allowing them to be used for many signatures). In "normal" (...
Pieter Wuille's user avatar
7 votes

What are the risks of running a pre-SegWit node (0.12.1)?

In addition to Michael's excellent answer, Bitcoin Core v12.1 doesn't include many performance improvements added over the years. Block verification is about twice as slow compared to v25.0 (according ...
Vojtěch Strnad's user avatar
6 votes
Accepted

What would happen if we provide witness program different than 32 bytes for SegWit 1?

SegWit version 1 outputs with lengths other than 32 bytes remain unencumbered, which means their validation is unchanged and they remain anyone-can-spend. From BIP341: A Taproot output is a native ...
Vojtěch Strnad's user avatar
6 votes
Accepted

What are the risks of running a pre-SegWit node (0.12.1)?

Is it safe to assume that Bitcoin is not soft-fork backward compatible? The only benefit of a soft fork over say a hard fork is that old nodes aren't forked off the network if they fail to validate ...
Michael Folkson's user avatar
6 votes

What are the risks of running a pre-SegWit node (0.12.1)?

Pre-segwit nodes consider segwit transactions non-standard and will not accept them to their mempool and therefore also not forward them. They would only participate in relay of unconfirmed non-segwit ...
Murch's user avatar
  • 76.9k
5 votes
Accepted

Are all transactions, whether SegWit or non-SegWit, part of the commitment in a coinbase transaction?

The wtxids of all transactions are committed to by the witness commitment tree in the coinbase transaction (except the coinbase wtxid itself, as that would be a cyclic dependency). This includes non-...
Pieter Wuille's user avatar
4 votes
Accepted

Is a BIP required for the removal of SegWit Discount for Inscriptions?

The removal of the witness discount would be a consensus change, specifically a soft fork. Changes to consensus rules have always been standardized as BIPs ever since the BIP process was created and I ...
Vojtěch Strnad's user avatar
4 votes

Why are some bc1 addresses 42 characters and others 62 characters in Base58?

P2WPKH (pay-to-witness-public-key-hash) addresses are 42 characters in length and P2WSH (pay-to-witness-script-hash) addresses are 62 characters in length (see here). bc1 addresses also use bech32 ...
Michael Folkson's user avatar
4 votes

How could a 2 byte witness program make sense?

Gregory Sanders proposed Segwit Ephemeral anchors, in which a 2-bytes witness program in a transaction's output to make it opt in to different relay rules (BIP, Optech).
Antoine Poinsot's user avatar
4 votes
Accepted

Is it possible to "label" Segwit spendable output ScriptPubKeys with arbitrary bytes?

Would it be valid; spendable by a Segwit transaction? It is valid to create such an output, but it would not be considered a segwit output (see BIP141), and thus not spendable using a segwit input. ...
Pieter Wuille's user avatar
3 votes
Accepted

How do pre-Segwit nodes interpret transactions containing Taproot OP_CHECKSIGADD?

Tapscript can only appear in leaf scripts. Leaf scripts can only appear in the witness stack of a P2TR script path spend. Pre-segwit nodes don’t see witness data. Ergo, a pre-segwit node will never ...
Murch's user avatar
  • 76.9k
3 votes
Accepted

What is the default private key type for legacy and segwit addresses?

The term "compressed private key" is a misnomer; it's not the private key that is compressed. Instead, it is an indication about whether the corresponding public key is to be in compressed (...
Pieter Wuille's user avatar
3 votes

SegWit Version - is there a proposal for new versions?

Taproot is implemented as SegWit version 1. Another proposed feature that would most likely be implemented as a new SegWit version is cross-input signature aggregation.
Vojtěch Strnad's user avatar
3 votes
Accepted

How are the block header bytes treated when calculating the block size in weight?

Are these header bytes treated as non-segwit bytes, i.e. cost 4 WU, so we actually have 3,999,668 WU (4,000,000 - 320 WU for header - 12 WU for tx counter) for transactions? Yes. The header weighs ...
Pieter Wuille's user avatar
3 votes
Accepted

What happens when we send MSG_WITNESS_TX/MSG_WITNESS_BLOCK to non-segWit node?

That would be a violation of BIP144. Support for segwit is signalled by having NODE_WITNESS in the services advertized in the version packet. If a peer does not signal NODE_WITNESS, it cannot be sent ...
Pieter Wuille's user avatar
3 votes

Accidently sent BTC to taproot wallet on Phantom. Wondering how i can get it back to Segwit so i can buy ordinals with it

Note that addresses are not accounts. The only way to move your coins to a different address (regardless of type) is to make a transaction. Presumably the wallet you are using allows you to send ...
Ava Chow's user avatar
  • 71.5k
3 votes
Accepted

Did Segwit (BIP141) eliminate all txid malleability issues listed in BIP62?

Most of the malleability issues listed in BIP62 stem from the fact that an input script (scriptSig) can be modified and still remain valid for the input, and because the input script is included when ...
Vojtěch Strnad's user avatar
2 votes

What is arbitrary witness data and unspent transaction output?

What is arbitrary witness data and unspent transaction output? [...] I'm confused what they mean by UTXO Arbitrary Arbitrary means what you think it does - "the data can be anything you choose&...
RedGrittyBrick's user avatar
2 votes
Accepted

Can a non-segwit transaction be serialized in the segwit format?

The extended serialization format introduced in BIP144, which is used for serializing witnesses, specifies: If the witness is empty, the old serialization format must be used. So, no, using the ...
Pieter Wuille's user avatar
2 votes
Accepted

the purpose of the field before signature in P2WPKH

It is the number of witness items in the witness stack of input #0 of the transaction. See BIP144 for the serialization format used by segwit transactions: the only witness objects type supported are ...
Pieter Wuille's user avatar
2 votes
Accepted

Which private key is used in Taproot transactions?

In a key path spend, you always sign with the private key corresponding to the output key. If that key is a tweaked public key (it's recommended to always use a tweaked key), you will also need to ...
Vojtěch Strnad's user avatar
2 votes
Accepted

Are there plans to make a script invalid if there is more than one element left in the stack?

This is a consensus rule inside (P2SH-)P2WSH witness scripts, and P2TR script-path spends already. See BIP141: The script must not fail, and result in exactly a single TRUE on the stack. And BIP342: ...
Pieter Wuille's user avatar
2 votes

How do pre-Segwit nodes interpret transactions containing Taproot OP_CHECKSIGADD?

OP_CHECKSIGADD is only defined for SegWit v1 (Taproot). A pre SegWit v1 node that doesn't recognize Taproot rules will treat all SegWit v1 outputs as "anyone can spend" regardless of whether ...
Michael Folkson's user avatar
2 votes
Accepted

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

From the BIP141 specification: The witness is a serialization of all witness fields of the transaction. Each txin is associated with a witness field. A witness field starts with a var_int to indicate ...
Lee's user avatar
  • 958
2 votes
Accepted

Why can I not find my transaction in the mempool?

This transaction appears to not be eligible for confirmation because it spends inputs that do not exist. You write that you are using testnet, but neither of the two transactions 21f5…a273 and 2275…...
Murch's user avatar
  • 76.9k
2 votes
Accepted

marker byte interpretation by legacy transaction parser

Legacy transaction parsers do not consider segwit transactions to be valid. They will fail to parse the transaction when read the marker byte as indicating 0 inputs. Part of the way that segwit ...
Ava Chow's user avatar
  • 71.5k
2 votes

Is Testnet3 Addresses Support Segwit P2WSH P2WPKH transactions?

It's Pay to Public Key Hash(P2PKH) testnet address, which doesn't support SegWit. P2PKH address(legacy) which starts with “1”, starts with either "m" or "n" on testnet. You can ...
Hyunhum Cho's user avatar
1 vote
Accepted

Transaction Validation

Any input spending a non-segwit script type must not have a witness. If it does, the transaction is invalid. P2SH-P2WSH and P2SH-P2WPKH are the exceptions: if the script type is P2SH and the ...
Ava Chow's user avatar
  • 71.5k
1 vote
Accepted

Example of computing segwit txid from raw tx data

what bytes exactly should be removed Those corresponding to the Segwit data fields: segwit flag and marker after the version number (bytes 4-5 with zero-based indexing). segwit witness data between ...
RedGrittyBrick's user avatar
1 vote

Creating a raw Segwit transaction from scratch and getting Signature must be zero for failed CHECK(MULTI)SIG operation

OK, finally I got some things to work and there are quite some changes I had to make but it seems to have work. I need to retrace my steps all over again later on tomorrow as its late now. Here's the ...
thotheolh's user avatar
  • 207

Only top scored, non community-wiki answers of a minimum length are eligible