Reviewed Aug 2026
DE
BA-14 · LESSON 01

Raw transaction construction

KEY DEFINITIONS

Terms used in this lesson

Witness
Signatures, scripts, or other data supplied to satisfy a Bitcoin output’s spending condition.
Sighash
The exact transaction digest and signature mode that determine which fields a Bitcoin signature authorizes.
Transaction ID
The identifier produced by hashing a Bitcoin transaction’s non-witness serialization.
BIP143
The Bitcoin Improvement Proposal that defines the version-zero SegWit transaction signature digest used by native P2WPKH and P2WSH spends.
Outpoint
A transaction ID plus output number that identifies one exact prior output.
SegWit
Segregated Witness: a Bitcoin upgrade that separates authorization data from the transaction identifier and introduces versioned witness programs.
Taproot
A Bitcoin output and spending design that can combine a public-key path with privately committed alternative scripts.
Witness transaction ID
An identifier that commits to a transaction including its witness data.
P2WPKH
Pay to Witness Public Key Hash: a native SegWit output for one public-key hash.
Preimage
The original secret data whose hash equals a previously committed value.
DER
Distinguished Encoding Rules: the structured byte encoding historically used for ECDSA signatures in Bitcoin Script.
ECDSA
Elliptic Curve Digital Signature Algorithm, the signature scheme used by pre-Taproot Bitcoin outputs.

Engineers serialize fields, compute sighashes, sign inputs, and inspect witnesses without relying solely on wallet abstractions.

35 min Difficulty 3/5 Not started

Loading lesson visuals...

01

Learn the idea

Raw transaction construction means choosing and serializing every Bitcoin transaction field without delegating the complete job to a wallet. The engineer identifies prior outputs, builds version, inputs, outputs, sequence, witness, and locktime, computes each signature hash, signs, finalizes, and asks a node to validate before broadcast.

GUIDED EXPLANATION1/5 ideas inspected
1

Freeze input facts

Record each outpoint, amount, scriptPubKey, confirmation state, key path, and spending type. Signature and fee calculation require correct prior-output data.

Inspect each idea before the worked example.
The worked example follows the explanation

Inspect every idea above to open it.

Important distinctionIf raw transaction hex decodes successfully, it is safe and valid to broadcast.

Decoding proves structural parse only. Inputs, values, signatures, locks, fee, policy, and intent can still be wrong.

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.