Architecture Overview
RP1 is built on a modular architecture optimized for high throughput, low latency, and optional privacy.
System Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Application Layer │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Privacy │ │ UTA │ │ InstaWrap│ │ Lending │ │
│ │ Module │ │ Module │ │ Module │ │ Module │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Oracle │ │ DEX │ │ Fee Burn │ │ EVM │ │
│ │ Module │ │ Module │ │ Module │ │ Module │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ Core Layer │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Encrypted Mempool │ │ ZK Proof Engine │ │
│ │ (MEV Protection) │ │ (gnark/Groth16) │ │
│ └──────────────────┘ └──────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ Consensus Layer │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ CometBFT (Tendermint Core) │ │
│ │ 200ms blocks • Instant finality │ │
│ └──────────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ Network Layer │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ P2P / libp2p │ │
│ └──────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Core Components
Consensus Engine
RP1 uses CometBFT (formerly Tendermint) for Byzantine Fault Tolerant consensus:
| Parameter | Value | Description |
|---|---|---|
| Block Time | 200-500ms | Time between blocks |
| Finality | Instant | No confirmation wait |
| BFT Threshold | 2/3+ | Required for consensus |
| Validators | 100 | Initial validator set |
Module Architecture
RP1 follows Cosmos SDK's module pattern:
// Each module implements these interfaces
type AppModule interface {
Name() string
RegisterServices(cfg module.Configurator)
InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage)
ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage
}
State Management
- ORM-based storage using
cosmossdk.io/orm - Collections for type-safe state access
- Merkle tree proofs for light clients
Transaction Flow
1. User signs transaction
↓
2. Transaction enters encrypted mempool
↓
3. Threshold decryption at block proposal
↓
4. Transaction ordering (fair, no MEV)
↓
5. Execution in parallel where possible
↓
6. State commitment to Merkle tree
↓
7. Block finalized via CometBFT
Privacy Architecture
┌─────────────────────────────────────────┐
│ Privacy Module │
│ ┌─────────────────────────────────┐ │
│ │ Shielded Pool (Commitments) │ │
│ └─────────────────────────────────┘ │
│ ┌─────────────┐ ┌─────────────────┐ │
│ │ Ring Sigs │ │ Viewing Keys │ │
│ │ (Decoys) │ │ (Auditability) │ │
│ └─────────────┘ └─────────────────┘ │
│ ┌─────────────────────────────────┐ │
│ │ gnark ZK Circuit Engine │ │
│ │ (Groth16 on BN254 curve) │ │
│ └─────────────────────────────────┘ │
└─────────────────────────────────────────┘
Performance Optimizations
Parallel Execution
- Independent transactions execute in parallel
- State dependencies tracked for ordering
Lane-Based Mempool
High Priority ─────────────────────→ Processed first
Medium Priority ─────────────────────→ Standard processing
Low Priority ─────────────────────→ Background processing
Aggressive Consensus Timeouts
TimeoutPropose: 100ms // Block proposal timeout
TimeoutPrevote: 50ms // Prevote round timeout
TimeoutPrecommit: 50ms // Precommit round timeout
TimeoutCommit: 100ms // Inter-block delay
Module Interactions
┌──────────┐
│ Oracle │──── Price Feeds
└────┬─────┘
│
┌───────────────┼───────────────┐
↓ ↓ ↓
┌─────────┐ ┌─────────┐ ┌─────────┐
│ UTA │ │ Lending │ │ DEX │
│(Margin) │ │ (Borrow)│ │ (Swap) │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└──────────────┼──────────────┘
↓
┌──────────┐
│ Fee Burn │──── 50% burned
└──────────┘
Security Model
| Layer | Security Mechanism |
|---|---|
| Consensus | BFT with 2/3+ threshold |
| Transactions | Ed25519/Secp256k1 signatures |
| Privacy | Groth16 zkSNARK proofs |
| MEV | Threshold encryption (t-of-n) |
| Bridge | Multi-sig + fraud proofs |