How much does SegWit affect transaction size?

3

1

I know that SegWit transactions are bigger than normal transactions. But how much? 10% or 15% or..?

MCCCS

Posted 2017-09-01T10:50:19.070

Reputation: 5 827

It would also be interesting to know how the transaction size is affected for different types of transactions, not just for standard transactions.sanket1729 2017-09-01T11:07:14.113

Answers

1

On bitcoincore.org:

  • The segwit transaction formats (see BIP 141 - witness program) have the following impact when serialised:

  • Compared to P2PKH, P2WPKH uses 3 fewer bytes (-1%) in the scriptPubKey, and the same number of witness bytes as P2PKH scriptSig.

  • Compared to P2SH, P2WSH uses 11 additional bytes (6%) in the scriptPubKey, and the same number of witness bytes as P2SH scriptSig.

  • Compared to P2PKH, P2WPKH/P2SH uses 21 additional bytes (11%), due to using 24 bytes in scriptPubKey, 3 fewer bytes in scriptSig than in P2PKH scriptPubKey, and the same number of witness bytes as P2PKH scriptSig.

  • Compared to P2SH, P2WSH/P2SH uses 35 additional bytes (19%), due to using 24 bytes in scriptPubKey, 11 additional bytes in scriptSig compared to P2SH scriptPubKey, and the same number of witness bytes as P2SH scriptSig.

And "How much does it affect block size?"

  • A witness commitment is included in the coinbase transaction, adding between 38 and 47 bytes, or about 0.005% of a block. (See BIP 141 - commitment structure)

  • A new transaction serialisation that includes the segregated witness data is defined (see BIP 141, or BIP 144). This adds an overhead of 2 bytes per transaction to allow the serialisation formats to be easily distinguished, and an overhead of 1 byte per input for the count of witness items for each input. These combine to about 1% per transaction.

MCCCS

Posted 2017-09-01T10:50:19.070

Reputation: 5 827