Reviewed Aug 2026
DE
BA-05 · LESSON 11

Raw transaction inputs and outputs

KEY DEFINITIONS

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.

55 min Difficulty 2/5 Not started

Loading lesson visuals...

01

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.

GUIDED EXPLANATION1/5 ideas inspected
1

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 each idea before the worked example.
The worked example follows the explanation

Inspect every idea above to open it.

Important distinctionAn input contains the amount being spent.

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.

02
FINISH LEARNING FIRST

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.