0
1
If I understand correctly block consists of:
- block header,
- transactions counter,
- list of signed transactions.
Each signed transaction consists of transaction itself and appended signature.
Each transaction consists of:
- transaction version no,
- number of inputs,
- inputs themselves,
- number of outputs,
- outputs themselves and
- locktime.
Each input consists of:
- Reference to its outputing transaction
- index of output in that transaction
- scriptSig
Each output consists of:
- output value
- scriptPubKey
Is this structure correct?
Where did you get 81 bytes from? – Anonymous – 2017-11-10T21:22:58.073
Found that figure on several places for example here: http://bitexperts.com/Question/Detail/3333/what-is-bitcoin-block-header-size-in-bytes, although 80 is more commonly shown. But here https://en.bitcoin.it/wiki/Block I find now there is more to the structure.
– croraf – 2017-11-11T10:17:47.077It’s 80 bytes, not 81. They’re calling the number of transactions part of the header (and assuming its one byte), which it’s not. – Anonymous – 2017-11-11T10:19:05.070
So in general it is 1-9 bytes, is not part of the header and shows the actual number of transactions in this block (and not always 0)? – croraf – 2017-11-11T10:20:35.873
1Right. It’s just part of the way it’s encoded though, that varint for the number of transactions isn’t included in any hash. It means you don’t know the size of the block until you’ve parsed every single transaction too. – Anonymous – 2017-11-11T10:22:14.120
Don't you know the size from the block size field https://chat.stackexchange.com/rooms/68577/room-for-croraf-and-eponymous
– croraf – 2017-11-11T10:33:33.527