Skip to content

Latest commit

 

History

History
176 lines (128 loc) · 5.58 KB

File metadata and controls

176 lines (128 loc) · 5.58 KB

SynapticChain Architecture

High-level overview. Implementation details are intentionally abstracted to protect network security and proprietary optimizations.


Design Principles

  1. Compile-Time Safety Over Runtime Checking
    SynapticLang's static scheduler proves state access patterns at compile time. The VM never needs dynamic conflict detection.

  2. Zero-Lock Consensus (S=0)
    The Rust type system enforces lock-free data structures on all consensus hot paths. std::sync::Mutex cannot regress — the build fails if it does.

  3. Financial-Native Messaging
    ISO 20022 message types are first-class citizens, not adapter layers.

  4. Deterministic Parallelism
    Execution lanes are scheduled statically. Parallelism is guaranteed by the compiler, not guessed at runtime.


Stack Overview

Layer 1: Consensus (SCBFT)

Synaptic Consensus Byzantine Fault Tolerant (SCBFT) is a DAG-based protocol with:

  • Optimistic finality: Transactions finalize in sub-500ms under normal conditions
  • BLS aggregate signatures: Reduces signature verification overhead from O(n) to O(1)
  • Deterministic checkpointing: Bounded rollback window
  • VRF-based rotation: Validator ordering is unpredictable and fair
  • Cross-shard coordination: Linear TPS scaling with shard count

Current testnet: 18 validators across 3 continents, tolerating 5 Byzantine faults.

Layer 2: Execution (SynapticVM)

A stack-based virtual machine that executes compiled ExecutionPlans.

  • Static scheduling: The compiler pre-computes state access patterns; the VM enforces them
  • Parallel lanes: Non-conflicting transactions execute in parallel
  • Checked arithmetic: All integer operations detect overflow at runtime (U8–U256)
  • Gas metering: Deterministic gas accounting per operation

Layer 3: State (synaptic-state)

Abstracted storage backend:

  • RocksDB: Default production backend
  • QMDB (opt-in): Quick Merkle Database for high-throughput paths
  • Merkle trie: All state is merkleized for light client verification

Layer 4: Networking (synaptic-p2p)

Built on libp2p:

  • GossipSub: Transaction and block propagation
  • Kademlia: Peer discovery
  • QUIC + TCP: Transport layer
  • mDNS: Local discovery for devnets

Layer 5: Smart Contracts (SynapticLang)

Custom DSL with:

  • Static type system: No dynamic dispatch, no reentrancy
  • Access pattern annotations: #[reads(...)], #[writes(...)] for scheduler analysis
  • Built-ins: msg.sender, msg.value, transfer(), require!(), VRF host functions

See SYNAPTICLANG_PRIMER.md.


Data Flow

User Transaction
       │
       ▼
┌──────────────┐
│  JSON-RPC    │  ← synaptic-node
│   Gateway    │
└──────┬───────┘
       │
       ▼
┌──────────────┐
│   Mempool    │  ← FCFS ordering, no fee auction
└──────┬───────┘
       │
       ▼
┌──────────────┐
│   Compiler   │  ← SynapticLang → ExecutionPlan
│   (synlang)  │
└──────┬───────┘
       │
       ▼
┌──────────────┐
│  Scheduler   │  ← Static access pattern analysis
└──────┬───────┘
       │
       ▼
┌──────────────┐
│  Consensus   │  ← SCBFT DAG building
│   (SCBFT)    │
└──────┬───────┘
       │
       ▼
┌──────────────┐
│   SynapticVM │  ← Parallel execution lanes
└──────┬───────┘
       │
       ▼
┌──────────────┐
│  State Store │  ← RocksDB / QMDB
└──────────────┘

Shard Architecture

SynapticChain uses deterministic sharding:

  • Accounts are assigned to shards by address prefix
  • Cross-shard transactions are coordinated via the consensus layer
  • Each shard maintains its own state root
  • A global checkpoint commits all shard roots atomically

Current testnet: 3 shards, all handled by the 18-validator mesh.


Security Model

Threat Mitigation
Reentrancy Compile-time: no dynamic call dispatch
Integer overflow Runtime checked arithmetic + VM abort
MEV / front-running FCFS mempool, no fee prioritization
Consensus stall VRF rotation + optimistic checkpointing
State bloat Rent-based eviction (planned)
Lock contention S=0 compile-time enforcement

Performance Targets

Metric Target Testnet Verified
Finality < 500ms ✅ Yes
Transaction cost < $0.0001 ✅ Yes ($0.000021)
TPS (single shard) 10,000+ Benchmarked
TPS (mainnet config) 100,000+ Theoretical
Cross-shard latency < 1s ✅ Yes

ISO 20022 Integration

SynapticChain natively understands ISO 20022 financial messages:

  • pacs.008 (Customer Credit Transfer)
  • pacs.009 (Financial Institution Credit Transfer)
  • camt.053 (Bank Statement)
  • pain.001 (Customer Payment Initiation)

These are not wrapped or translated — they are native transaction types in synaptic-types and synaptic-swift.


Related Documents