Skip to content

worldcoin/world-chain

Repository files navigation

World Chain

World Chain

World Chain is a blockchain designed for humans. Built on the OP Stack and powered by reth, World Chain prioritizes scalability and accessibility for real users, providing the rails for a frictionless onchain UX.

✨ Key Features

Priority Blockspace for Humans (PBH)

Verified World ID holders receive priority access to blockspace, ensuring everyday users can transact even during peak network demand. PBH uses zero-knowledge proofs to verify humanity without revealing identity.

How it works:

  • Top-of-block priority for verified humans
  • Monthly transaction quotas with date-based rate limiting
  • Semaphore ZK proofs for privacy-preserving verification
  • Reserved blockspace capacity ensures network accessibility

πŸ“– PBH Specification | Architecture

P2P Flashblocks

A high-speed execution lane that gives builders low-latency settlement for experiences like gaming, social, and real-time commerce. Flashblocks provides sub-second confirmation times for time-sensitive applications.

We use a home baked p2p flashblocks distribution mechanism by adding an additional rlpx sub protocol to the exisiting devp2p layer. Read more here!

πŸ“¦ Flashblocks Implementation

πŸ—οΈ Architecture

World Chain extends the OP Stack with custom transaction ordering and validation:

πŸš€ Getting Started

Prerequisites

  • Rustup
  • Foundry (for smart contracts)
  • Just (task runner)

Building from Source

# Clone the repository
git clone https://github.com/worldcoin/world-chain.git
cd world-chain

# Build the node
cargo build --release

# Run tests
cargo test

Running a Local Devnet

Use Kurtosis for local development and testing:

just devnet-up

See devnet documentation for configuration options and stress testing.

Downloading Snapshots

reth snapshots are regularly updated and can be downloaded and extracted with the following commands:

BUCKET="world-chain-snapshots" # use world-chain-testnet-snapshots for sepolia
FILE_NAME="reth_archive.tar.lz4" # reth_full.tar.lz4 is available on mainnet only
OUT_DIR="./" # path to where you would like reth dir to end up
VID="$(aws s3api head-object --bucket "$BUCKET" --key "$FILE_NAME" --region eu-central-2 --query 'VersionId' --output text)"
aws s3api get-object --bucket "$BUCKET" --key "$FILE_NAME" --version-id "$VID" --region eu-central-2 --no-cli-pager /dev/stdout | lz4 -d | tar -C "$OUT_DIR" -x

πŸ“š Documentation

🧰 Codebase Structure

world-chain/
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ world/           # Core World Chain node implementation
β”‚   β”œβ”€β”€ flashblocks/     # Components for flashblocks construction, propagation, and execution
β”‚   └── toolkit/         # CLI utilities
β”œβ”€β”€ contracts/           # Solidity smart contracts (Foundry)
β”œβ”€β”€ specs/               # Technical specifications (mdBook)
β”œβ”€β”€ docs/                # Additional documentation
β”œβ”€β”€ devnet/              # Local development environment (Kurtosis)
└── snapshotter/         # Database snapshot script

🀝 Contributing

Contributions are welcome! Please see our contributing guidelines and code of conduct.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Links