← Course home Module 0 / 19 Blockchain — Part 1

The Hook

A real Bitcoin transaction, before you know anything. By the end of this course you'll understand every field.

30 min Module 0 ₿ Part 1

Welcome

You don't need to understand it yet.

This module is not an explanation — it's a provocation. We're going to look at a real Bitcoin transaction right now. Most fields will look strange. That's the point.

What this course is

  • A technical course about how blockchains actually work — not a hype course.
  • Built for developers who know Node.js and TypeScript.
  • Three parts: Bitcoin foundations, public DApps (Ethereum / Solidity), enterprise blockchains.
  • Every module ends with a hands-on exercise you can run on your machine.

What this course is NOT

  • An investment course. We do not discuss "going to the moon".
  • An NFT speculation guide.
  • A beginner programming course — you must know JavaScript.
🎯

By module 3 you will have implemented a functioning cryptocurrency in Node.js, using the same cryptographic primitives Bitcoin uses.

Your First Bitcoin Transaction

This is a real transaction that moved Bitcoin on the main network. Every field shown here was verified by the entire Bitcoin network:

TRANSACTION Confirmed
Transaction ID 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
Block #0 (Genesis)
Confirmations 800,000+
Fee 0 sat
Size 204 bytes
INPUTS (coins being spent)
From COINBASE
50 BTC
OUTPUTS (coins being created)
To 1A1zP1eP5QGe...Uk1osKAHB
50 BTC
Total transferred 50.00000000 BTC
🔍

Try it yourself

Go to mempool.space and paste any transaction hash. Everything you see there is public, immutable, and cryptographically verified.

Your questions (write them down)

  1. Who controls those Bitcoin addresses? Could anyone own them?
  2. What stops someone from spending Bitcoin they don't have?
  3. If there's no bank, who verified this transaction?
  4. Why is it irreversible?

Transaction Anatomy

Every field in a Bitcoin transaction has a specific job. Here's the bird's-eye view — we'll go deep on each one later.

Version
Transaction format version. Signals to nodes which rules apply.
Inputs
References to previously unspent outputs (UTXOs). This is the source of the coins.
Outputs
New UTXOs created by this transaction. Each has a value and a locking script.
Locktime
Optional time or block height before which this transaction cannot be included in a block.
Witness (SegWit)
Signature data separated from the core transaction since the 2017 SegWit soft fork.
💡

The UTXO Model

Bitcoin doesn't have "accounts" with balances. Instead it has Unspent Transaction Outputs — discrete coin objects. To spend 0.3 BTC you consume one or more UTXOs that total at least 0.3 BTC, then create new UTXOs: one for your target, one back to yourself as change.

🔐

Locking & Unlocking Scripts

Each output has a locking script (scriptPubKey) that sets conditions for spending. The corresponding input must provide an unlocking script (scriptSig / witness) that satisfies those conditions.

Block Anatomy

Transactions are grouped into blocks. Each block is sealed with a header. The header is the piece that makes the chain.

BLOCK #0 — THE GENESIS BLOCK
BLOCK HEADER (80 bytes)
Previous Block Hash 0000000000000000...

Hash of the preceding block's header. For the genesis block this is all zeros — there is no previous block. Every subsequent block links back through this field.

Merkle Root 4a5e1e4baab89f3a...

A single hash that summarises all transactions in the block. Tamper with one transaction, the root changes.

Timestamp 1231006505

Unix time when the miner started hashing this block.

nBits (Target) 0x1d00ffff

Compact encoding of the difficulty target. The block hash must be below this value.

Nonce 2083236893

A 32-bit number miners increment billions of times per second searching for a valid hash.

TRANSACTIONS (1)
4a5e1e4b... — coinbase (50 BTC)

The chain

Each block contains the hash of the previous block. Altering a block changes its hash, breaking the link to the next block, which would then need to be re-mined — and the one after, and the one after. The longest chain always wins.

The Central Question

?

How does the network know Mehdi actually owns those coins?

There is no bank. No trusted server. No account database. Just thousands of anonymous computers, each holding a copy of the same ledger.

The answers involve three ideas you'll master in Part 1:

1

Asymmetric Cryptography

A private key that only Mehdi knows, and a public address anyone can verify against.

2

Digital Signatures

A mathematical proof that cannot be forged without the private key — attached to every transaction.

3

Distributed Consensus

A protocol that lets thousands of strangers agree on one truth without trusting each other.

💥

If someone offered you 1 BTC if you could counterfeit a transaction, you would need to solve a problem that would take the computing power of all CPUs on Earth thousands of years to crack. That's Proof of Work. That's Module 4.

Your Roadmap

Part 1 — Bitcoin Foundations

Modules 0 – 5

Why Bitcoin was invented, how the cryptography works, build a cryptocurrency step by step in Node.js.

Ξ

Part 2 — Smart Contracts & DApps

Modules 6 – 14

Ethereum EVM, Solidity, Hardhat v3, viem, full DApp with MetaMask, security, Layer 2.

🏢

Part 3 — Enterprise Blockchains

Modules 15 – 19

Why permissioned networks, Hyperledger Besu hands-on (same Solidity!), Fabric conceptually.

🚀

After Part 2, your ERC-20 token will be a real cryptocurrency running on a global network. The same ScroogeCoin you built in Node.js in Module 3 — but unstoppable.

Prerequisites & Setup

You need to know

  • JavaScript / TypeScript — async/await, classes, modules
  • Node.js — npm, running scripts, require/import
  • Basic command line — cd, mkdir, running commands
  • Git — clone, commit, push

Helpful but not required

  • HTTP protocol basics
  • Any backend framework experience
  • Some cryptography curiosity

Install now (Part 1 & 2)

Node.js 20+ Node.js 20+ (LTS) — nodejs.org
VS Code Visual Studio Code — code.visualstudio.com
MetaMask MetaMask browser extension — metamask.io
Git Git — git-scm.com
ℹ️

Hardhat, Foundry, and Docker are installed during the relevant modules — you don't need them now.

Next module

We go back to the 1980s. Why did digital money fail for 30 years before Bitcoin? The answer is not 'nobody thought of it'.

Module 1: Why Bitcoin? →