Code: First byte | bits | from | to =========================================== 0xxxxxxx | 7 | 0x0000000000000000 | 0x000000000000007f 10xxxxxx | 14 | 0x0000000000000080 | 0x000000000000407f 110xxxxx | 21 | 0x0000000000004080 | 0x000000000020407f 1110xxxx | 28 | 0x0000000000204080 | 0x000000001020407f 11110xxx | 35 | 0x0000000010204080 | 0x000000081020407f 111110xx | 42 | 0x0000000810204080 | 0x000004081020407f 1111110x | 49 | 0x0000040810204080 | 0x000204081020407f 11111110 | 56 | 0x0002040810204080 | 0x010204081020407f 11111111 | 64 | 0x0102040810204080 | 0xffffffffffffffff

Code: Field Size | Description | Data type | Comments ================================================= 1+ | version | varuint | Transaction data format version (in this case, 7) 1+ | tx_in count | varuint | Number of Transaction inputs 35+ | tx_in | tx_in[] | A list of 1 or more transaction inputs or sources for coins 1+ | tx_out count | varuint | Number of Transaction outputs 22+ | tx_out | tx_out[] | A list of 1 or more transaction outputs or destinations for coins 1+ | option size | varuint | The size of the metadata field, in bytes ? | option | metadata | Optional metadata relative to this input

Code: Tag | Description | Data type | Comments ======================================== 10 | LockByBlock | varuint | lock_time support (block height) 11 | LockByTime | varuint | lock_time support (timestamp)

Code: Field Size | Description | Data type | Comments =================================================== 33+ | previous_output | outpoint | The previous output transaction reference, as an OutPoint structure 1+ | witness count | varuint | Number of witness data ? | witness | witness | Witness data 1+ | metadata size | varuint | The size of the metadata field, in bytes ? | metadata | metadata | Optional metadata relative to this input

Code: Field Size | Description | Data type | Comments =============================================== 32 | hash | char[32] | The hash of the referenced transaction 1+ | index | varuint | The index of the specific output in the transaction. The first output is 0, etc.

Code: Field Size | Description | Data type | Comments ================================================== 1+ | witness length | varuint | Witness length ? | witness | uchar[] | Witness data

Code: Tag | Description | Data type | Comments ======================================== 10 | LockByBlock | varuint | BIP68/112/113 support 11 | LockByTime | varuint | BIP68/112/113 support

Code: Field Size | Description | Data type | Comments =============================================== 1+ | value | varuint | Transaction Value 1+ | version | varuint | Script versioning capabilities 20+ | hash | uchar[] | Usually contains the public key as a Bitcoin script setting up conditions to claim this output

Code: Size class | Hash size ======================= 0 | 20B - 160bits 1 | 24B - 192bits 2 | 28B - 224bits 3 | 32B - 256bits 4 | 40B - 320bits 5 | 48B - 384bits 6 | 56B - 448bits 7 | 64B - 512bits

Code: Version | Semantic =================== 0 | P2KH - OP_HASH160 3 | P2KH - OP_HASH256 8 | P2SH - OP_HASH160 11 | P2SH - OP_HASH256

Code: Script pattern | Version | Script ========================================================================= OP_DUP OP_HASH160 <pk_hash> OP_EQUALVERIFY OP_CHECKSIG | 0 | pk_hash OP_DUP OP_HASH256 <pk_hash> OP_EQUALVERIFY OP_CHECKSIG | 3 | pk_hash <pubkey> OP_CHECKSIG | 3 | double_sha256(pubkey) OP_HASH160 <script_hash> OP_EQUAL | 8 | script_hash anything | 11 | double_sha256(anything)