Raw transaction inputs and outputs
Terms used in this lesson
- Outpoint
- A transaction ID plus output number that identifies one exact prior output.
- Transaction ID
- The identifier produced by hashing a Bitcoin transaction’s non-witness serialization.
- HASH256
- Bitcoin's name for applying SHA-256 twice to the same byte sequence.
- Witness
- Signatures, scripts, or other data supplied to satisfy a Bitcoin output’s spending condition.
Decode outpoints, ScriptSig, sequence, amounts, ScriptPubKeys, CompactSize lengths, and locktime directly from serialized transaction bytes.
Loading lesson visuals...
Learn the idea
A raw legacy transaction serializes version, a CompactSize input count, each input, a CompactSize output count, each output, and locktime. An input contains a 32-byte previous transaction identifier in serialized order, four-byte output index called vout, CompactSize ScriptSig length, ScriptSig bytes, and four-byte sequence. An output contains an eight-byte satoshi amount and a CompactSize-prefixed ScriptPubKey.
Read version and input count
Version is a four-byte little-endian signed integer in serialization. The next CompactSize value states exactly how many input records must follow.
Inspect every idea above to open it.
An input contains an outpoint and spending data. Its amount and locking condition come from the referenced previous output and must be supplied or looked up for validation and fee calculation.
The questions unlock after every required learning activity
Inspect every guided idea, open the worked example, rebuild its mechanism, and complete the deterministic lesson tool. Your progress is saved automatically.