When I look at the following raw transaction from: https://blockstream.info/tx/a175425ee2f3c01acc97ef32ab1082db14eaa94e5af4c54f02f3b01dec72558e?expand


When I parse it manually, specifically at this section: a100000000**00cf050000**01...

a1 is the last byte of the input tx (in little endian),

00000000 is the output index (4-bytes),

and at the end the 01 is the tx_out_count.

But that would make the sequence number 00cf050000, which is longer than 4 bytes? What am I missing here?

1 Answer 1


The sequence number is always 4 bytes, it is a fixed size, little endian, 32 bit integer which makes it always 4 bytes.

What you are missing is the scriptSig. The scriptSig always begins with the size of the script (as a compact size unsigned integer). If the scriptSig is empty, then the size must still be there to say that it is a 0 length byte. So the first byte of your "sequence" is actually the length byte for the scriptSig that says it is of length 0.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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