TeachBitcoin .github.io
Spread the Knowledge of Bitcoin
with the Versatility of Libbitcoin
See training chapters on following pages
Elliptic Curve Math
This chapter covers prime fields, elliptic curves operations over real numbers and prime fields. These are the basic mathematical concepts that ECDSA signing is based on.
Chapter Slides
Chapter Code Repository

ECDSA
Bitcoin signatures use the Elliptic Curve Digital Signing Algorithm to secure unspent outputs and are encoded in the DER serialisation format.
Chapter Slides

Addresses and HD Wallets
Bitcoin addresses encode the information required for a wallet to spend to the correct key. Hierarchical Deterministic wallets use a child-key derivation algorithm to safely derive new addresses from the same root.
Chapter Slides
Chapter Code Repository

Introduction to Transactions
An introduction to building and signing your first transaction which spends to Pay-to-Public-Key-Hash outputs.
Chapter Slides
Chapter Code Repository

Signature Hash Modifiers
Signatures can commit to specific input and outputs, allowing other parts of the transaction to be modified by other parties.
Chapter Slides
Chapter Code Repository

Next Chapters >>
Multisignature Scripts
An output script which can be spent by n-of-m signatures.
Chapter Slides
Chapter Code Repository

Pay-to-Script-Hash Scripts
P2SH output scripts commit to a hashed locking script. The locking script preimage must be provided together with the unlocking script for such a P2SH output to be spent.
Chapter Slides
Chapter Code Repository

Transaction Timelocks
Absolute and relative timelocks prevent transactions from being broadcast before a certain time or blockheight. A timelock may be commited to by the transaction signature, or can be enforced by the previous output script.
Chapter Slides
Chapter Code Repository

Witness Transactions
Pay-to-witness output scripts are be spent with transactions with valid witnesses. Wallets which do not support native P2W transactions may send to outputs which wrap P2W scripts in P2SH outputs.
Chapter Slides
Chapter Code Repository

Block Chain
A closer lock at blocks and block headers, and their validation by nodes.
Chapter Slides
Chapter Code Repository

Next Chapters >>
P2P Network
An introduction to the P2P messaging protocol between Bitcoin nodes on the network.
Chapter Slides
Chapter Code Repository

Simplified Payment Verification
SPV clients follow the longest header chain with the most proof-of-work. They rely on specific transaction updates from full Bitcoin nodes, and perform merkle proofs to validate confirmation of these transactions.
Chapter Slides
Chapter Code Repository

Payment Channels and Lightning Network
We demonstrate a basic payment channel between two nodes which is enabled by revocable output scripts (RSMC's). Payment routing across multiple payment channels is made possible by hashed time-locked contracts (HTLC's).
Chapter Slides
Chapter Code Repository