EDUCATIONAL SANDBOX — This is not real cryptocurrency. Anvil Chain is a learning tool. No real money. No tokens.
OPEN-SOURCE LEARNING SANDBOX

Understand Bitcoinby rebuilding it.

Anvil Chain is a sandbox recreation of Bitcoin's core mechanics in plain JavaScript. Same algorithms. Same concepts. Readable enough that a beginner can follow along.

$ anvil-chain

100% local sandbox. Zero real cryptocurrency. Based on Bitcoin's design.

Live SHA-256 Output
0000000000000000000000000000000000000000000000000000000000000000

A visual walkthrough

Scroll through the five pillars of Bitcoin. Each one builds on the last.

Step 1 of 5

The Transaction

Everything starts with a transaction. Alice wants to send coins to Bob. She signs the transaction with her private key, producing a cryptographic signature that proves she authorized the transfer. Anyone can verify it using her public key -- but nobody can forge it.

ALICE
Sender
SIGNED WITH PRIVATE KEY
VERIFIED BY PUBLIC KEY
BOB
Receiver
Private Key: d4f8...2a1b
Signature: 3045...9f8c
Public Key: 04a1...7e3d

In Bitcoin

Uses ECDSA (secp256k1) signatures. Transactions are broadcast to the mempool. Each input references a previous unspent output (UTXO model).

In This Sandbox

Uses Ed25519 signatures. Simplified account-balance model instead of UTXOs. Same core principle: cryptographic proof of authorization.

Step 2 of 5

The Block

Transactions are bundled into blocks. Each block contains a list of transactions, a reference to the previous block's hash, a timestamp, and a nonce. The miner assembles all of this, then computes the block's SHA-256 hash.

Block #4assembling...
TX: Alice -> Bob 25 ANV
TX: Charlie -> Dave 10 ANV
TX: COINBASE -> Miner 50 ANV

In Bitcoin

Blocks hold ~2000-3000 transactions. The header is exactly 80 bytes. Includes a Merkle root that summarizes all transactions in a tree structure.

In This Sandbox

Blocks hold any number of transactions. Uses a simple JSON hash of all fields. Same concept: a tamper-evident container for transactions.

Step 3 of 5

The Chain

Each block stores the hash of the block before it. This creates a chain -- change one block and every block after it becomes invalid. Click "Tamper" below to see the cascade effect in action.

Click "Tamper" on any block to see how the chain breaks

In Bitcoin

The chain is ~600GB and growing. Over 800,000 blocks deep. To tamper with block N, you would need to re-mine every block after it faster than the entire network.

In This Sandbox

Same hash-linking principle. Changing any field in a block breaks the chain from that point forward. Immutability through cryptographic linking.

Step 4 of 5

Mining and Proof of Work

To add a block to the chain, a miner must find a nonce that makes the block's hash start with a certain number of zeros. This is brute force -- there is no shortcut. Click "Start Mining" to watch it happen in real time.

Target: hash must start with 000
0
click start to begin

In Bitcoin

~600 exahashes per second across the network. Difficulty adjusts every 2016 blocks to target ~10 minutes. Requires specialized ASIC hardware costing $5K-$15K each.

In This Sandbox

Difficulty 2-3 (just a few hundred attempts). Takes under a second. Same SHA-256 algorithm, just a much easier target so you can watch the process.

Step 5 of 5

Consensus

In a decentralized network, nodes may disagree about which chain is correct. Nakamoto consensus solves this: everyone follows the longest valid chain. If two miners find a block simultaneously, the tie breaks when the next block is found.

Node A
Node B
Node C

In Bitcoin

~20,000 nodes worldwide enforce consensus. An attacker would need >50% of all hash power to rewrite history -- economically infeasible at current scale.

In This Sandbox

Run multiple local nodes with HTTP peers. They share chains and follow the longest valid chain rule. Same Nakamoto consensus, local scale.

Educational Content Only

The explanations above are simplified for learning. Real Bitcoin involves additional complexity (Merkle trees, script system, fee markets, etc.) that is beyond the scope of this sandbox.

Live Playground

A real blockchain running in your browser. Type commands below.

anvil-chain — live sandbox

ANVIL

A sandbox recreation of Bitcoin's core mechanics.

anvil >
Press Enter to run. /help for commands. /save to save. /file to see save location. Data saved in your browser.

Same algorithms, readable code

Bitcoin's core mechanics, simplified to under 1,000 lines of JavaScript.

PoW

SHA-256 Proof-of-Work

Same mining algorithm as Bitcoin. Increment a nonce until the hash has enough leading zeros. Real proof-of-work, low difficulty so you can watch it happen.

SIG

Digital Signatures

Every transaction is cryptographically signed. Private key signs, public key verifies. Same principle as Bitcoin's ECDSA, using modern Ed25519.

50

Coinbase Rewards

Miners earn 50 coins per block — exactly how Bitcoin started in 2009. New coins only enter circulation through mining.

#

Hash-Linked Chain

Each block stores the hash of the previous block. Tamper with one and every block after it breaks. This is what makes Bitcoin immutable.

P2P

Nakamoto Consensus

Run multiple nodes locally. They share blocks and follow the longest valid chain rule — the same consensus mechanism Bitcoin uses.

?

/explain System

Type /explain mine to learn how Bitcoin mining really works — the hardware, the difficulty, the economics. Built-in lessons for every concept.

A real terminal application

Not just a script -- a full interactive CLI with menus, autocomplete, and built-in lessons.

INTERACTIVE MENUS
? What would you like to do?
Create a new wallet
Mine a block
Send coins
View the blockchain
Check balance
Learn with /explain

Navigate with arrow keys, press Enter to select
/EXPLAIN SYSTEM
$ /explain mine

What is mining?
Mining adds new blocks to the blockchain
by finding a nonce that makes the block
hash start with enough zeros (PoW).

In Bitcoin:
Requires ASICs, ~10 min per block,
~600 exahashes/second network-wide.

10 topics: mine, wallet, transaction,
block, difficulty, reward, hash,
consensus, genesis, signature
MULTI-WALLET MANAGEMENT
$ /wallet create
Wallet created!
Address: anvil_3f8a...c21d

$ /wallet create
Wallet created!
Address: anvil_7b2e...9f4a

$ /wallet list
1. anvil_3f8a...c21d (active)
2. anvil_7b2e...9f4a

Switch between wallets to simulate
multiple participants on the network.
TAB AUTOCOMPLETE + DIRECT COMMANDS
$ /mi[TAB]
$ /mine

Type commands directly:
/mine
/send <address> 25
/chain
/explain <topic>

Or use the interactive menus.
Both work. Your choice.

Install once, run from anywhere:
$ anvil-chain

Start building.

Install once, then just type anvil-chain to launch it anytime.

git clone https://github.com/ssm-official/anvil-chain.git && cd anvil-chain && npm install && npm link

Then just run anvil-chain from anywhere to start it.

Important Disclaimer

Anvil Chain is an educational sandbox. The ANV coin has no monetary value. This project is not a cryptocurrency, not an investment, and not connected to any real blockchain network. It exists solely to teach how blockchain technology works. Do not use this in production.