1

It's said that Segwit removes signature data from transactions which makes block have more space for more transactions.

Question 1)

If SegWit removes signature data, where does it put it exactly ? what does it mean that it puts at the end of the transaction ? and how does it make a block to contain more transactiosn?

I understand that segwit solves transaction malleability by adding segwitTxid , but I am mostly curious how segwit increased block size..

Question 2) I know that block size is measured in weight units. and we can read the following:

Each byte of a transaction that is not witness data (so everything that a non-segwit node would see) is worth 4 weight units. Every byte of witness data is worth 1 weight unit. Blocks are limited to 4000000 weight units, which, if full of non-segwit transactions, is 1 MB. –

By reading this, it still doesn't make sense how block size limit has been increased. if we count the size in MB, segwit implementation might need more MB than non segwit implementation(older bitcoin).

I'd appreciate a nice explanation..

1
3

If SegWit removes signature data, where does it put it exactly ? what does it mean that it puts at the end of the transaction ? and how does it make a block to contain more transactiosn?

It doesn't remove anything. It moves witness data to a separate area, the segregated witness, which (a) does not contribute to the txid and (b) is counted differently.

But, the witness data is still an integral part of the transaction. It's not covered by the txid, but it is covered by a new separate identifier, the wtxid. These wtxids are committed to by segwit blocks. So you still can't change/remove/... the witness data without it invalidating the block that contains them.

By reading this, it still doesn't make sense how block size limit has been increased. if we count the size in MB, segwit implementation might need more MB than non segwit implementation(older bitcoin).

Yes, absolutely. From the perspective of newer nodes, it is a block size increase. It's not a blunt multiply-by-4, but segwit blocks do permit more transactions, and their total size in bytes can be (and is) larger than 1 MB.

The important part is that this extra space is all in witness data, which old nodes don't see. Thus, their 1 MB limit requirement is still satisfied.

2
  • Thanks a lot. still lots of confussion ! witness data is only wtxid ? – Nika Kurashvili Oct 9 '20 at 19:21
  • 2
    No, the wtxid commits to all transaction data, including the witness. The txid commits to all transaction data except the (segregated) witness. – Pieter Wuille Oct 9 '20 at 19:28
2

To add to Pieter's answer here is a diagram. The witnesses at the bottom of the Merkle tree are not seen by old nodes that haven't enabled SegWit. Hence the block size limit (1MB) for these old nodes is not breached. It is only new nodes that have enabled SegWit that will see these witnesses and handle blocks that are effectively larger than the previous 1MB block size limit.

grokking bitcoin diagram

This diagram is taken from Kalle Rosenbaum's book Grokking Bitcoin which you can read here for free or purchase here from the publisher Manning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.