Making Blockchains Work Like Modern Databases
Traditional databases solved the scaling problem decades ago through sharding - splitting data across multiple servers. Quai brings this proven approach to blockchain, but with a crucial innovation: maintaining full security across all shards.What is Sharding?
Database Sharding (Traditional): Imagine a library that gets too big for one building:- Solution: Split books across multiple buildings (shards)
- Benefit: More librarians can help visitors simultaneously
- Challenge: Need a system to know which building has which book
- Traditional approach: Split both data AND security (dangerous)
- Quai’s approach: Split only data, keep security unified (safe)
How Quai Implements Sharding
Key Benefits:-
Parallel Processing
- Each shard processes transactions independently
- Like having multiple checkout lines instead of one
- Result: 50,000+ TPS capacity
-
Lower Node Requirements
- Nodes can choose to track only specific shards
- Reduces hardware requirements for participation
- More accessible = more decentralized
-
Geographic Optimization
- Shards naturally organize by region
- Minimizes latency within each shard
- Better performance worldwide
Smart Address System
The Problem: How do you know which shard handles which transaction? Quai’s Solution: Addresses contain built-in routing information - like ZIP codes for blockchain. How It Works: Every Quai address has a 9-bit prefix that acts like a postal code:- First 4 bits: Region identifier (like country)
- Next 4 bits: Zone within region (like city)
- Last bit: Currency type (Quai or Qi)
Formatting
The table below specifies the format for each bit in the shard identifier.bits 0-3 | bits 4-7 | bit 8 |
---|---|---|
region number | zone number | ledger identifier |
Simple Examples
Example Address (shortened) | Location | Currency |
---|---|---|
0x000… | Region 0, Zone 0 | Quai |
0x2A4… | Region 2, Zone 10 | Quai |
0x008… | Region 0, Zone 0 | Qi |
- Instant routing: Nodes immediately know where to send transactions
- No lookups needed: Address itself contains all routing info
- Efficient processing: Eliminates cross-shard confusion
The Security Breakthrough
Traditional Sharding’s Fatal Flaw:- 10 shards = each gets 1/10th of security
- Attackers can focus on the weakest shard
- Like having 10 weak locks instead of one strong lock
- Every shard maintains 100% network security
- Attacking one shard requires attacking the entire network
- Like having the same unbreakable lock protecting every door
- Hierarchical structure organizes all shards
- Hash linked references connect every chain
- Atomic operations ensure all shards advance together
- Result: Unlimited shards, uncompromised security