Lightning Network Interactive Demo
Learn how Bitcoin's instant payment layer works
What is the Lightning Network?
The Lightning Network is Bitcoin's instant payment layer. Instead of waiting 10 minutes for each Bitcoin transaction, Lightning payments settle in milliseconds with fees less than a penny.
- Instant payments (milliseconds, not minutes)
- Tiny fees (fraction of a cent)
- Still Bitcoin (backed by real BTC on-chain)
- Microtransactions (send $0.01 if you want)
Payment Channels: The Foundation
A payment channel is like a Bitcoin bank account shared between two people. They lock up Bitcoin on-chain, then send it back and forth instantly off-chain.
Alice Bob Payment Channel
How It Works:
1. Open channel with 1M sats total
2. Each starts with 500K sats
3. Send payments instantly
4. Close channel to settle on-chain
Controls
Multi-Hop Routing: The Power of Lightning
You don't need a direct channel with everyone! Lightning can route payments through intermediate nodes, just like the internet routes data through routers.
Example: Alice → Carol
Alice wants to pay Carol, but doesn't have a direct channel. No problem!
Route: Alice → Bob → Carol
Payment goes through Bob's channel, and he forwards it to Carol (earning a small fee).
Payment
📋 Transaction Log
🔬 HTLCs: How Lightning Ensures Atomicity
Hash Time-Locked Contracts (HTLCs) are the cryptographic mechanism that makes multi-hop payments trustless.
- Carol generates a secret (preimage) and sends Alice its hash
- Alice creates HTLC: "Bob gets paid IF he reveals the preimage within 24 hours"
- Bob creates HTLC with Carol: "Carol gets paid IF she reveals the preimage within 12 hours"
- Carol reveals preimage to claim from Bob
- Bob uses same preimage to claim from Alice
- Result: Either everyone gets paid, or no one does (atomic)
📋 HTLC Execution Log
Technical Details:
- Hash Function: SHA256 (same as Bitcoin)
- Preimage Size: 32 bytes (256 bits of entropy)
- Time Locks: CLTV (CheckLockTimeVerify) for expiration
- Routing Protocol: Onion routing with Sphinx packet format
- Penalty Mechanism: Revocation keys for old channel states
What's Next?
Ready to try Lightning yourself?
- Download a Lightning wallet (Phoenix, Muun, or Wallet of Satoshi)
- Practice on testnet first (free fake Bitcoin)
- Start with small amounts ($5-10)
- Try buying coffee or tipping content creators
Dive deeper into Lightning:
- Run your own Lightning node (Umbrel, RaspiBlitz, Start9)
- Open channels with well-connected nodes
- Learn about liquidity management and channel balancing
- Explore routing node economics (earning fees)
Advanced Lightning topics:
- Implement Lightning with LND, CLN, or Eclair
- Build Lightning apps using LNURL or WebLN
- Study channel factories and multi-party channels (Eltoo)
- Explore Taproot channels and PTLCs (Point Time-Locked Contracts)
- Contribute to Lightning protocol development (BOLTs)