Building a Bitcoin Transaction: Overview

A hands-on developer course that teaches how Bitcoin transactions work by building one from scratch. Start here.

0steps ·

Progress 0/0

What You’ll Learn

This 10-part course walks you through constructing a Bitcoin transaction from raw bytes. By the end, you will understand exactly what happens between clicking “Send” in a wallet and seeing a confirmation on the blockchain — not as an abstraction, but as a sequence of concrete data operations you can reproduce yourself.

What We’re Building

We are going to build a raw Bitcoin transaction by hand. Not with a library that hides the details, but field by field: selecting inputs, constructing outputs, serializing bytes, signing with a private key, and broadcasting the result to the network.

The final product will be a valid, broadcastable transaction in hex format — something like this:

0200000001aabbccdd...ff00000000

Every byte in that string will make sense to you by the end.

Prerequisites

You should be comfortable with:

  • Basic cryptography concepts — hashing, public/private key pairs
  • Hexadecimal notation — reading and converting hex values
  • Command-line tools — we’ll use Bitcoin CLI examples throughout
  • Any programming language — pseudocode and Python-style snippets appear in examples, but the concepts are language-agnostic

No prior Bitcoin development experience is required. If you understand what a hash function does, you have enough background.

The UTXO Model: A Quick Primer

Bitcoin does not use account balances. There is no database row that says “Alice has 0.5 BTC.” Instead, Bitcoin tracks Unspent Transaction Outputs (UTXOs) — individual coins of specific denominations that belong to specific addresses.

Spending bitcoin means:

  1. Consuming one or more existing UTXOs (inputs)
  2. Creating new UTXOs (outputs) — one for the recipient, one for your change
  3. Destroying the difference as a miner fee

This input/output model is the foundation of everything we’ll build. If the account model is a spreadsheet, the UTXO model is a pile of physical coins — you can’t split a coin without melting it down and minting new ones.

Course Roadmap

StepTopic
1Overview (you are here)
2Understanding UTXOs
3Constructing Transaction Inputs
4Constructing Transaction Outputs
5Calculating Transaction Fees
6Raw Transaction Serialization
7Signing the Transaction
8SegWit and Witness Data
9Broadcasting Your Transaction
10Verifying and Exploring

Each step builds on the previous one. By Step 6, you will have an unsigned raw transaction. By Step 7, it becomes valid. By Step 9, it hits the network.

Next Step

Continue to Understanding UTXOs to learn how Bitcoin tracks ownership without account balances.