Skip to main content

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:

BenefitDescription
Dedicated throughputNo competition with DeFi for block space
Ultra-low feesOrders of magnitude cheaper than L2
Custom gas tokensPay fees in local currency
Local governanceCommunity controls upgrade decisions
Full EVMDeploy any Ethereum smart contract

Architecture Stack​

City Chain Three-Layer Settlement
L3City Chain
Local transactions, governance, IoT data
~250ms blocks<$0.001 tx
L2Arbitrum Orbit
Batch settlement, fraud proofs
State commitmentsSequencer
L1Ethereum
Final settlement, security guarantees

Security Model​

Inherited Security​

City Chain inherits Ethereum's security through the L3 → L2 → L1 chain:

  1. Fraud Proofs (L3 → L2): Anyone can challenge invalid City Chain state on Locale Network
  2. Fraud Proofs (L2 → L1): Locale Network disputes resolve on Ethereum
  3. Data Availability: All transaction data is posted to Locale Network, ultimately anchored to Ethereum

Trust Assumptions​

ComponentTrust Model
SequencerCentralized (upgradeable to decentralized)
State ValidityTrustless via fraud proofs
Data AvailabilityEthereum DA guarantees
L{CORE} AttestorTEE-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
Sequencer Processing
Transactions
User requests
Sequencer
Order & batch
L2 Bridge
Submit batch
Block Time
~250ms
Finality
~15min
Cost
<$0.001

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:

  1. Submit a fraud proof to Arbitrum
  2. Trigger interactive dispute game
  3. 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?​

RequirementL{CORE} Solution
Verifiable IoT dataDevice signatures + TEE attestation
PrivacyBucketing and encryption
CostL3 fees enable frequent sensor updates
DeterminismCartesi rollup for fraud-proof storage

Data Flow​

L{CORE} Data Flow
IoT Device
Sensor data + did:key
Sign attestation
Reclaim Attestor
TEE verification
Submit to InputBox
Cartesi Rollup
Deterministic storage
City Chain L3
On-chain availability

Example: Air Quality Monitoring​

Air quality sensors submit readings every 5 minutes through L{CORE}:

Data FieldDescription
pm25Particulate matter 2.5 μg/m³
pm10Particulate matter 10 μg/m³
aqi_bucketPrivacy bucket (e.g., "good", "moderate")
location_hashGeohash for privacy-preserving location

See L{CORE} IoT Guide for complete sensor integration.

Gas and Fees​

Fee Structure​

OperationApproximate 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.

ConfigurationDescription
Gas Token AddressERC-20 contract for local currency
Fee CollectorTreasury address for collected fees
Price OracleDetermines gas token / ETH exchange rate

Comparison: L2 vs L3​

MetricLocale Network (L2)City Chain (L3)
Settles toEthereumLocale Network
Block time~0.25s~2s
Gas cost~$0.01-0.10~$0.001-0.01
ThroughputNetwork-wideDedicated per city
GovernanceLocale DAOLocal community
IoT nativeCoordinationYes (L{CORE})

Technical Specifications​

ParameterValue
Block time~2 seconds
Gas limit30M per block
Settlement intervalEvery 100 blocks to Locale Network
Challenge period7 days (inherited from Locale Network)
Data availabilityLocale Network DA layer
VMEVM (geth-based)

Next Steps​