Layer 3 Design
City Chain implements a Layer 3 (L3) architecture—a rollup that settles to Arbitrum (L2), which in turn settles to Ethereum (L1). This design provides the cost efficiency and performance needed for local applications while maintaining Ethereum's security guarantees.
Why Layer 3?
The Problem with L2s for Local Use Cases
Layer 2 rollups are designed for general-purpose use. While they're significantly cheaper than Ethereum L1, they're still:
- Too expensive for micropayments and frequent IoT data
- Too crowded for dedicated community throughput
- Too generic for local governance and custom gas tokens
The L3 Solution
City Chain as an L3 provides:
| Benefit | Description |
|---|---|
| Dedicated throughput | No competition with DeFi for block space |
| Ultra-low fees | Orders of magnitude cheaper than L2 |
| Custom gas tokens | Pay fees in local currency |
| Local governance | Community controls upgrade decisions |
| Full EVM | Deploy any Ethereum smart contract |
Architecture Stack
Security Model
Inherited Security
City Chain inherits Ethereum's security through the L3 → L2 → L1 chain:
- Fraud Proofs (L3 → L2): Anyone can challenge invalid City Chain state on Locale Network
- Fraud Proofs (L2 → L1): Locale Network disputes resolve on Ethereum
- Data Availability: All transaction data is posted to Locale Network, ultimately anchored to Ethereum
Trust Assumptions
| Component | Trust Model |
|---|---|
| Sequencer | Centralized (upgradeable to decentralized) |
| State Validity | Trustless via fraud proofs |
| Data Availability | Ethereum DA guarantees |
| L{CORE} Attestor | TEE-secured (Reclaim Protocol) |
Components
Sequencer
The sequencer is responsible for:
- Ordering transactions
- Producing blocks (~2 second intervals)
- Posting state commitments to Locale Network
- Handling L{CORE} IoT attestation batches
State Management
City Chain maintains EVM state including:
- Account balances (ETH and local tokens)
- Smart contract code and storage
- L{CORE} attestation records (via Cartesi integration)
Fraud Proof System
If the sequencer posts an invalid state root, anyone can:
- Submit a fraud proof to Arbitrum
- Trigger interactive dispute game
- Invalid state is reverted, sequencer slashed
L{CORE} Integration
City Chain includes native integration with L{CORE} for IoT data attestation.
Why L{CORE} at L3?
| Requirement | L{CORE} Solution |
|---|---|
| Verifiable IoT data | Device signatures + TEE attestation |
| Privacy | Bucketing and encryption |
| Cost | L3 fees enable frequent sensor updates |
| Determinism | Cartesi rollup for fraud-proof storage |
Data Flow
Example: Air Quality Monitoring
Air quality sensors submit readings every 5 minutes through L{CORE}:
| Data Field | Description |
|---|---|
| pm25 | Particulate matter 2.5 μg/m³ |
| pm10 | Particulate matter 10 μg/m³ |
| aqi_bucket | Privacy bucket (e.g., "good", "moderate") |
| location_hash | Geohash for privacy-preserving location |
See L{CORE} IoT Guide for complete sensor integration.
Gas and Fees
Fee Structure
| Operation | Approximate Cost |
|---|---|
| Simple transfer | < $0.001 |
| Contract call | < $0.01 |
| L{CORE} attestation | < $0.001 |
| Contract deployment | < $0.10 |
Custom Gas Tokens
City Chains can configure custom gas tokens, allowing users to pay transaction fees in the local community currency instead of ETH.
| Configuration | Description |
|---|---|
| Gas Token Address | ERC-20 contract for local currency |
| Fee Collector | Treasury address for collected fees |
| Price Oracle | Determines gas token / ETH exchange rate |
Comparison: L2 vs L3
| Metric | Locale Network (L2) | City Chain (L3) |
|---|---|---|
| Settles to | Ethereum | Locale Network |
| Block time | ~0.25s | ~2s |
| Gas cost | ~$0.01-0.10 | ~$0.001-0.01 |
| Throughput | Network-wide | Dedicated per city |
| Governance | Locale DAO | Local community |
| IoT native | Coordination | Yes (L{CORE}) |
Technical Specifications
| Parameter | Value |
|---|---|
| Block time | ~2 seconds |
| Gas limit | 30M per block |
| Settlement interval | Every 100 blocks to Locale Network |
| Challenge period | 7 days (inherited from Locale Network) |
| Data availability | Locale Network DA layer |
| VM | EVM (geth-based) |
Next Steps
- Rollup Infrastructure — Sequencer details
- Data Availability — How data is stored
- L{CORE} Architecture — IoT attestation details
- Governance — Community control