Skip to main content
31 votes
Accepted

Bitcoin Segwit was released in the summer of 2017 to reduce the blocksize congestion. Why is it still congested?

SegWit cannot, and was never designed to "resolve network congestion". It: fixes the third-party malleability issue that Bitcoin has had since its creation, vastly simplifying many multi-transaction ...
Pieter Wuille's user avatar
29 votes
Accepted

Is SegWit a blocksize increase or more efficient use of blockspace?

Yes and no. It depends on how you frame the question. It is a block size increase, because you can fit a larger number of useful transactions into a block. If you want to make a useful Bitcoin ...
Nick ODell's user avatar
  • 29.4k
29 votes
Accepted

How is segwit2x different from segwit?

SegWit2x is a combination of both SegWit and a 2MB hardfork (to activate three months after SegWit). SegWit2x uses a different 'bit' for signaling (bit 4 instead of bit 1) than SegWit. SegWit (...
Wouter's user avatar
  • 406
26 votes

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

Yes, bytes and vbytes are referring to two different metrics: size and virtual size (vsize). The size in [bytes] of a transaction refers to the raw byte length of its serialized format. It is used to ...
Murch's user avatar
  • 75.4k
22 votes
Accepted

Why include the Segregated Witness Merkle Root in the input field of the coinbase transaction?

Why a witness commitment is necessary at all: Enabling DoS prevention for validating nodes Block validation is expensive. It requires hashing all data in a block, building Merkle trees, looking up ...
Pieter Wuille's user avatar
22 votes
Accepted

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

Segwit introduced a new limit for blocks, the blockweight limit, superseding the previous blocksize limit. Under the segwit rules, witness data is counted at a lower weighting than non-witness data ...
Murch's user avatar
  • 75.4k
18 votes
Accepted

How does SegWit reduce transaction size, when the signature is simply moved to another part of the transaction?

TL;DR: SegWit does not reduce the transaction size, if you're referring to the raw byte length of transactions. Instead it introduces block weight as a new metric that does not directly correspond to ...
Murch's user avatar
  • 75.4k
15 votes
Accepted

With 100% segwit transactions, what would be the max number of transaction confirmation possible on a block?

Very interesting question, let's see what the smallest transaction we can build is. For it to be minimal it has to be a single input and a single output. The non-segwit part would look something like ...
cdecker's user avatar
  • 9,508
15 votes
Accepted

Why does Taproot require a new address format?

Background P2TR addresses will be encoded using Bech32, although likely an amended version. In anticipation of Taproot getting merged, some proponents tested the behavior of various wallets and ...
Murch's user avatar
  • 75.4k
14 votes
Accepted

How is SegWit a soft fork?

You're confusing transactions (the abstract object) and their serialization (the bytes on the wire in the P2P protocol or on disk). Sure, SegWit introduces an extension to the P2P protocol (BIP144), ...
Pieter Wuille's user avatar
14 votes
Accepted

How to generate SegWit address

How do I generate a SegWit address using Bitcoin Core CLI? You can use addwitnessaddress addr, where addr is an existing P2PKH or P2SH address of yours. It will construct a P2SH-P2WPKH or P2SH-P2WSH ...
Pieter Wuille's user avatar
14 votes
Accepted

Follow-up to Segwit: Arbitrary data storage in witness?

Am I understanding this correctly? Yes. will this transaction have failed the normal rules in Bitcoin Core for relaying transactions It's a P2TR (taproot) spend. Those spends have different policy ...
Pieter Wuille's user avatar
14 votes
Accepted

Why is witness data downloaded during IBD in prune mode?

Why do pruned nodes download (segregated) witness data during IBD if much of that data is marked as Assumevalid? Good question, probably because nobody implemented it. Honestly, I had never ...
Pieter Wuille's user avatar
13 votes
Accepted

Will SegWit allow for m of n multisig with very large n and m?

By reading this answer, I understand that in m-of-n multisig addresses, m and n are limited by the maximum size allowed by the P2SH redeemScript (i.e. 520 bytes). That's correct. Even though the ...
Pieter Wuille's user avatar
13 votes

Birthday attack on P2SH

Why does this document seem to imply that the birthday attack only works for multisig P2SH and then only for one of the signers? The birthday attack (to the best of my knowledge) requires that the ...
Pieter Wuille's user avatar
13 votes
Accepted

Bech32 conversion to legacy P2PKH?

Is it safe to receive funds at this 1FJJd... address? Kind of. Your wallet knows the private key that corresponds to that address as it is the same private key for the bech32 address. However it does ...
Ava Chow's user avatar
  • 70.5k
13 votes
Accepted

How to calculate segwit transaction fee in bytes?

That depends on what those inputs and outputs look like. The formula, as specified in BIP141, is: Call base_size the number of bytes needed to serialize the transaction in legacy format (which does ...
Pieter Wuille's user avatar
13 votes
Accepted

Are all three Bitcoin address types interoperable (legacy, segwit, native segwit)?

Absolutely! Each address type handles transaction generation slightly differently but they all are interoperable with each other on the protocol level. If you run into an issue where one address type ...
jon.bray.eth's user avatar
12 votes
Accepted

What does a segregated witness transaction look like?

From Bitcoin Core's primitive/transaction.h: /** * Basic transaction serialization format: * - int32_t nVersion * - std::vector<CTxIn> vin * - std::vector<CTxOut> vout * - uint32_t ...
Pieter Wuille's user avatar
12 votes
Accepted

How would I explain SegWit to a non-technical friend?

The name itself is a good hint as to what it actually does. What we have today is a "witness" (i.e signature scripts) included in every Bitcoin transaction in non-segwit compliant transactions. This ...
rny's user avatar
  • 2,418
12 votes
Accepted

What is the User Activated Softfork (UASF) proposal? How do its risks compare to hardforks?

What does the UASF proposal entail? The UASF proposal is an extension of BIP9 that allows soft-forks to specify a mandatory activation time. If miners have not started signaling support by this ...
morsecoder's user avatar
  • 14.2k
12 votes
Accepted

SegWit transaction fee/byte

Say, my raw transaction is 500 bytes,100 bytes of which are witness data. Thus, 400 bytes are now competing for the place in 1 Mb block. That's not correct. SegWit replaces the concept of size and ...
Pieter Wuille's user avatar
12 votes
Accepted

How to verify if it's Segwit Transaction or not?

A transaction is a segwit tx if at least one of the inputs contain a witness. Or if you are inspecting the raw tx then you check the 5th byte (the input count) and if it is 0x00 then it is a segwit tx....
Mike D's user avatar
  • 3,569
12 votes
Accepted

What is the difference between "native segwit" and "bech32"?

TL;DR: Native segwit refers to segwit outputs without P2SH-wrapper. Bech32 is the address format used to represent native segwit-v0 locking scripts. Wrapped segwit vs native segwit When segwit ...
Murch's user avatar
  • 75.4k
11 votes
Accepted

How many more transactions per second will be possible with SegWit?

Best estimates on effective blocksize with SegWit are 1.6-2.0 MB. Current transactions/second possible are around 3 tx/s. Given that the effective increase is 1.6 - 2.0x, the transactions/second are ...
Jimmy Song's user avatar
  • 7,759
11 votes

Where is the Signature stored in a SegWit transaction?

That's not accurate. The witness is stored in the blockchain. In the segwit format, the signature is part of the witness, the witness is part of the transaction and the transaction is written to the ...
Murch's user avatar
  • 75.4k
11 votes
Accepted

Can I mix P2PKH and P2WPKH inputs in the same transaction?

Is it acceptable to mix P2PKH and P2WPKH inputs in the same transaction as described above? Yes, absolutely. In the same way that you can mix multisig and P2SH and P2PK inputs in the same transaction....
Pieter Wuille's user avatar
11 votes
Accepted

Why would a miner put an OP_RETURN in a coinbase transaction?

Every segwit block has one such OP_RETURN in the coinbase transaction: It's the Merkle root of the witness tree. When the segwit softfork was activated, this included a fix to the third-party ...
Murch's user avatar
  • 75.4k
11 votes
Accepted

What is the Witness and what data does it contain?

This structure contains data required to check transaction validity but not required to determine transaction effects. In particular, scripts and signatures are moved into this new structure. The ...
JBaczuk's user avatar
  • 7,408
11 votes
Accepted

Redeem script. script hash, witness script and witness program

The scriptPubKey is the script as it is placed in the transaction output. The redeemScript (P2SH only) is the script pushed as the last scriptSig item. In P2SH scripts, the scriptPubKey is equal to ...
Pieter Wuille's user avatar

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