Lesson 6

๐Ÿ“œ Smart Contracts 101

Code is lawโ€”write yours

โฑ๏ธ 55 min ๐Ÿ“Š Intermediate ๐Ÿš€ Build: Escrow Contract on Citrea

๐ŸŽฏ Smart Contracts 101

55 minutes to write your first trustless code on Bitcoin. Build and deploy an escrow smart contract on Citrea that holds funds until both parties confirm delivery โ€” code is law, no middlemen.

๐Ÿ“œ
Code is Law on Bitcoin

Solidity contracts deployed to Citrea settle to Bitcoin. Once deployed, the code cannot be changed โ€” perfect for Arcade marketplaces, tournaments, and escrows.

๐Ÿš€ What You'll Build

A simple 2-party escrow contract on Citrea. Buyer deposits, seller confirms delivery, buyer releases or disputes โ€” all on-chain and trustless. Deploy it, fund it, and use it for your first peer-to-peer Arcade trade.

๐Ÿ“š Quick Concepts

  • Solidity Basics: contract, function, modifier, require, payable.
  • Escrow: Smart contract that holds funds until conditions are met.
  • Trustless Execution: Code runs exactly as written, no human can alter it after deployment.
  • Deployment: Compile with Remix โ†’ deploy to Citrea testnet.

๐Ÿ”จ Build Steps

  1. Open Remix.ethereum.org, create new Solidity file.
  2. Paste the provided Escrow.sol template (with buyer/seller roles, deposit, release, refund).
  3. Compile, switch network to Citrea testnet, deploy.
  4. Fund the contract as buyer, simulate seller confirmation, release funds.
  5. View the contract on Citrea explorer โ€” your first โ‚ฟapp is live!
๐Ÿš€
Singularity-Aware Reality Check

When AI agents trade with each other in the Arcade, they will use smart contracts like yours โ€” code is the only law they respect.

โšก Lightning Network

The first major Layer 2โ€”a network of payment channels enabling instant, near-free Bitcoin transactions.

๐Ÿ’จ

Instant Payments

Transactions confirm in milliseconds, not 10 minutes.

๐Ÿ’ฐ

Tiny Fees

Fractions of a cent per transactionโ€”even for micropayments.

๐Ÿ‡ธ๐Ÿ‡ป
Real-World Success: El Salvador

The Chivo wallet uses Lightning to enable everyday Bitcoin payments for 6+ million citizens.

๐Ÿ”ถ What is Citrea?

Citrea is a Bitcoin Layer 2 that brings smart contracts to Bitcoin using zero-knowledge rollup technology. It's where Bitcoin Arcade Zone is built!

๐ŸŽฎ
You're Using Citrea Right Now!

Bitcoin Arcade Zone runs on Citrea Testnet (Chain ID 5115). When you claim prizes, they're paid in cBTC on Citrea!

Citrea's Key Features

๐Ÿ“œ

Smart Contracts

Ethereum-compatible (EVM) smart contracts powered by Bitcoin security. Build DeFi, NFTs, gamesโ€”all on Bitcoin.

๐Ÿ”

ZK-Rollup

Validity proofs verified on Bitcoinโ€”mathematically impossible to cheat. Inherit Bitcoin's security.

โ‚ฟ

Bitcoin-Native

Built on Bitcoin's security, not a separate chain. BTC is the native asset.

โšก

Fast & Cheap

Thousands of transactions per second with fees under $0.01. Ready for mass adoption.

๐Ÿ”„ Lightning vs Citrea

โšก

Lightning Network

Best for: Payments
Speed: Instant
Use case: Coffee purchases, tipping, remittances

๐Ÿ”ถ

Citrea

Best for: Smart contracts
Speed: Fast (rollup batches)
Use case: DeFi, NFTs, complex applications

๐Ÿงฉ What are Rollups?

Rollups bundle many transactions together and post a single proof to the main chain. This dramatically increases throughput while inheriting base layer security.

๐Ÿ“ฆ
ZK-Rollups Explained

Zero-Knowledge rollups generate mathematical proofs that thousands of transactions were executed correctly. Bitcoin verifies these proofs without processing each transaction individually.

๐Ÿ’ป The Aha Moment: Connect to Citrea

Let's explore Citrea's network details. This is the actual network Bitcoin Arcade Zone uses!

๐Ÿ”ถ Citrea Network Info
Live Network
๐ŸŽฎ
Real Platform

Bitcoin Arcade Zone's prize vault smart contract is deployed on this network. When you win, you claim from Citrea!

๐Ÿ›๏ธ Austrian Economics Corner

๐Ÿ“š

Permissionless Innovation

Layer 2s embody free market principlesโ€”entrepreneurs building solutions without asking permission from any central authority. Anyone can create a Layer 2 on Bitcoin.

This is the essence of Austrian economics: spontaneous order. No central planner designed the Layer 2 ecosystem. It emerged from individuals pursuing their own goals.

"The market is not a place, a thing, or a collective entity. It is a process." โ€” Ludwig von Mises
๐Ÿš€
Innovation Without Permission

Unlike traditional finance where innovation requires regulatory approval, Bitcoin Layer 2s can be launched by anyone. The market decides which solutions succeed.

๐ŸŒ The Vision: Bitcoin for Everyone

๐Ÿ”ฎThe Future Stack
Layer 3+: Applications, games, social networks
Layer 2: Lightning (payments) + Citrea (smart contracts)
Layer 1: Bitcoin - The immutable, decentralized foundation
๐ŸŽฌ

Watch: The Future of Bitcoin

15:00

๐Ÿง  Teach Satoshi

Before the quiz, prove you understand by explaining the concept. Satoshi AI will challenge your thinking until you achieve mastery.

๐Ÿ“ Final Quiz

Complete this final quiz to graduate from the Free Tier! You need 80% to pass.

๐ŸŽ“

Congratulations!

You've completed the Bitcoin Arcade Academy Pre-Course. You now understand the fundamentals of Bitcoin, Austrian economics, and the future of decentralized finance.

Return to Academy Home