Is Bech32 transaction on blockchain.info size accurate?

1

I have made a transaction and paid like 120 sat/B, on blockchain it says that I've paid 78.995 sat/B and noticed that transaction size is 191 (bytes)

Transaction size supposed to be: 102 (input) + 32 (output) + 10 (headers) = 144 Byte

Is this a problem of blockchain.info and transaction fee is right or the wallet didn't send the correct fees and Do miners take my transaction as I paid 120 sat/b or 78 sat/b?

87e4a93012116020d7c385d92a0d307363e8040bfb89800c709f66c47ca58316

Adam

Posted 2019-04-23T20:04:42.200

Reputation: 3 215

What wallet software are you using?Andrew Chow 2019-04-23T21:10:47.347

Answers

2

Your transaction size calculation is incorrect. The inputs are 1 byte input count + 36 byte output + 1 byte scriptSig + 4 byte sequence + 1 byte witness stack count + 1 byte signature length + 71 byte signature + 1 byte pubkey length + 33 byte pubkey = 149 bytes for all of the input data. That along with 32 bytes for output, and 10 bytes for the rest of the transaction gives you a transaction 191 bytes in size.

So, blockchain.info correctly calculated the serialized size of your transaction. However that size is not the one that miners use for computing the feerate of a transaction since segwit data is discounted. Rather what they use is the fee per weight unit, which is the 34.526 sat/WU value that blockchain.info displays beneath the fee per byte feerate.

It's likely that whatever wallet you were using was using virtual bytes (vbytes) instead of weight units or actual bytes. Virtual bytes is just the size of the transaction but applying the segwit discount to the segwit data in the transaction. Your transaction is 110 vbytes, which gives you a feerate of 137.16 satoshis/vbyte. It's possible that when you told your wallet to use a 120 sat/byte feerate, it actually used a 120 sat/vbyte. However, when the transaction was actually made, the change that would have been left over from targeting that feerate would create a dust output, so it was rolled into the fee itself thus increasing the feerate that was actually paid.

Do miners take my transaction as I paid 120 sat/b or 78 sat/b?

Your transaction has already been confirmed.

Andrew Chow

Posted 2019-04-23T20:04:42.200

Reputation: 40 910

Hi, I don't understand how did you calculate the transaction? I don't see that you've calculated the input size.

can you please simply calculate the transaction again? – Adam 2019-04-23T21:45:06.757

I calculate usually the fee like this: $total = ($inputbytes + $outputbytes + 10) / 1000 * $btcPerKB. what am I missing? thanksAdam 2019-04-23T21:46:12.837

With segwit, some input bytes are treated differently. Those bytes are discounted and are worth 1/4th of the actual byte size. Doing the calculationg with that in mind gives you the vbytes. How are you calculating inputbytes?Andrew Chow 2019-04-23T21:50:07.737

for segwit bech32 each input worth 102 and each output 32 byte. that's how I'm doing :(Adam 2019-04-23T21:56:48.140

That's wrong. How did you get an input being 102 bytes? An P2WPKH input is ~65 vbytesAndrew Chow 2019-04-23T22:00:39.250

I'm a little bit confused how did I get that size, what's the different between vbyte and byte and what is segwit input size? what can I do to calculate that correctly?Adam 2019-04-23T22:06:40.593

A vbyte is a byte but with the segwit discount applied. A byte that is not part of the segwit data of a transaction is 1 vbyte. A byte that is part of the segwit data of a transaction is 0.25 vbytes. To calculate the vbytes correctly, look at the raw data for a segwit transaction (such as the one you asked about) and count the bytes for the segwit data and the non-segwit data separately. Divide the byte count for the segwit data by 4 to get its vbytes, and add to the non-segwit byte count for the total vbytes. I counted 65 vbytes for the input for your transaction.Andrew Chow 2019-04-23T22:39:17.140