Skip to main content

Overview

NEXUS is a cross-chain metaprotocol that provides smart contract programmability across Bitcoin, Zcash, and Dogecoin. V1 supports independent chain operations, with unified liquidity via intent exchange coming in V2.

Core Components

┌─────────────────────────────────────────────────────────────────┐
│                      NEXUS Metaprotocol                         │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                    Execution Layer                        │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐       │   │
│  │  │  WASM VM    │  │  State      │  │  Mempool    │       │   │
│  │  │  Executor   │  │  Processor  │  │  Manager    │       │   │
│  │  └─────────────┘  └─────────────┘  └─────────────┘       │   │
│  └──────────────────────────────────────────────────────────┘   │
│                                                                  │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                    Bridge Layer                           │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐       │   │
│  │  │   Bitcoin   │  │    Zcash    │  │   Dogecoin  │       │   │
│  │  │   Bridge    │  │   Bridge    │  │   Bridge    │       │   │
│  │  └─────────────┘  └─────────────┘  └─────────────┘       │   │
│  └──────────────────────────────────────────────────────────┘   │
│                                                                  │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                   Security Layer                          │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐       │   │
│  │  │  ZK Proofs  │  │   Fraud     │  │  Economic   │       │   │
│  │  │ STARK/Groth │  │   Proofs    │  │   Bonds     │       │   │
│  │  └─────────────┘  └─────────────┘  └─────────────┘       │   │
│  └──────────────────────────────────────────────────────────┘   │
│                                                                  │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │              V2: Intent Exchange Layer                    │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐       │   │
│  │  │   Intent    │  │   Solver    │  │  Unified    │       │   │
│  │  │   Matching  │  │   Network   │  │  Liquidity  │       │   │
│  │  └─────────────┘  └─────────────┘  └─────────────┘       │   │
│  └──────────────────────────────────────────────────────────┘   │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

V1 vs V2

FeatureV1 (Current)V2 (Planned)
Smart Contracts
Cross-Contract Calls
Bitcoin Deposits
Zcash Deposits✅ (t-addr)✅ + z-addr
Dogecoin Deposits
Cross-Chain Swaps✅ Intent Exchange
Unified Liquidity

Execution Layer

WASM Virtual Machine

  • Executes WebAssembly smart contracts
  • Deterministic execution for verifiability
  • Gas metering for resource limits
  • Host functions for storage, crypto, events

State Processor

  • Processes transactions in order
  • Maintains global state tree
  • Generates state commitments
  • Handles cross-contract calls

Mempool Manager

  • Transaction ordering and prioritization
  • EIP-1559 style fee market
  • Backpressure handling
  • Parallel transaction validation

Bridge Layer

Each supported chain has a dedicated bridge component:

Bitcoin Bridge

  • Vault Type: Taproot (P2TR) with escape hatch
  • Verification: ZK-STARK proofs + BitVM2 fraud proofs
  • State Commits: OP_RETURN outputs every N blocks
  • Confirmations: 6 blocks (~60 min)

Zcash Bridge

  • Vault Type: Transparent (t-addr) with escape hatch
  • Verification: Groth16 proofs (native Zcash verification)
  • State Commits: OP_RETURN outputs
  • Confirmations: 10 blocks (~25 min)
  • V2: Shielded (z-addr) support

Dogecoin Bridge

  • Vault Type: P2PKH with CLTV escape hatch
  • Verification: ZK-STARK proofs + fraud proofs
  • State Commits: OP_RETURN outputs
  • Confirmations: 6 blocks (~6 min)

Security Layer

ZK Proofs

NEXUS uses different ZK proof systems optimized for each chain:
ChainProof SystemTrusted SetupVerification
BitcoinZK-STARK❌ NoBitVM2 bisection
ZcashGroth16✅ Zcash’sNative on-chain
DogecoinZK-STARK❌ NoFraud proofs

Fraud Proofs

When a prover posts an invalid state:
1. Challenger detects invalid state commitment
2. Challenger posts bond and initiates challenge
3. Bisection game narrows to single disputed step
4. Disputed step verified (on-chain or via ZK)
5. Loser's bond transferred to winner

Economic Bonds

  • Provers must post bonds on L1 before committing state
  • Bond amount covers potential fraud proof costs
  • Slashed bonds go to successful challengers
  • Creates economic incentive for honest behavior

Vault Architecture

All vaults follow a two-path spending structure:
Vault Address

├── Protocol Path
│   └── L1 balance always matches L2 balance (1:1 backing)

└── Escape Path
    └── User can spend after timelock (emergency recovery)

Escape Hatch Timelocks

ChainTimelockApproximate Time
Bitcoin2016 blocks~2 weeks
Zcash576 blocks~1 day
Dogecoin1440 blocks~1 day
The escape hatch ensures users can always recover their funds, even if the protocol becomes unresponsive.

Transaction Flow

Deposit Flow

┌─────────────────────────────────────────────────────────────────┐
│                       Deposit Flow                               │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  1. User requests vault address                                 │
│                    │                                             │
│                    ▼                                             │
│  2. Protocol derives deterministic vault address                │
│                    │                                             │
│                    ▼                                             │
│  3. User sends L1 funds to vault address                        │
│                    │                                             │
│                    ▼                                             │
│  4. Scanner detects deposit after N confirmations               │
│                    │                                             │
│                    ▼                                             │
│  5. L2 balance credited to user                                 │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Withdrawal Flow

┌─────────────────────────────────────────────────────────────────┐
│                      Withdrawal Flow                             │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  1. User requests withdrawal on L2                              │
│                    │                                             │
│                    ▼                                             │
│  2. L2 balance debited                                          │
│                    │                                             │
│                    ▼                                             │
│  3. Withdrawal added to batch queue                             │
│                    │                                             │
│                    ▼                                             │
│  4. Batch processed and L1 transaction broadcast                │
│                    │                                             │
│                    ▼                                             │
│  5. User receives L1 funds                                      │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

State Commitments

NEXUS posts state commitments to each L1 chain periodically:
Block N:     State Root 0xabc123...
Block N+100: State Root 0xdef456...
Block N+200: State Root 0x789abc...
Anyone can verify the state by:
  1. Downloading full state from NEXUS nodes
  2. Computing Merkle root of state
  3. Comparing with on-chain commitment

Node Architecture

┌─────────────────────────────────────────────────────────────────┐
│                       NEXUS Node                                 │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐              │
│  │    RPC      │  │   Gateway   │  │   Sync      │              │
│  │   Server    │  │   (REST)    │  │   Service   │              │
│  └─────────────┘  └─────────────┘  └─────────────┘              │
│                                                                  │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐              │
│  │   WASM      │  │   Vault     │  │  Watchtower │              │
│  │   VM        │  │   Manager   │  │             │              │
│  └─────────────┘  └─────────────┘  └─────────────┘              │
│                                                                  │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐              │
│  │   Bitcoin   │  │   Zcash     │  │  Dogecoin   │              │
│  │   Scanner   │  │   Scanner   │  │  Scanner    │              │
│  └─────────────┘  └─────────────┘  └─────────────┘              │
│                                                                  │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                      Storage (RocksDB)                    │   │
│  └──────────────────────────────────────────────────────────┘   │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Node Modes

ModeDescriptionUse Case
PrimaryProduces blocks, commits stateMain sequencer
ReplicaSyncs from primary, read-onlyScaling reads
ArchiveFull history, no pruningHistorical queries

V2: Intent Exchange (Planned)

V2 will introduce cross-chain unified liquidity via intent exchange:
┌─────────────────────────────────────────────────────────────────┐
│                    Intent Exchange Flow                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  User                    Solver Network              Chains      │
│  ┌─────┐                 ┌─────────────┐         ┌─────────┐    │
│  │     │── Create ──────►│             │         │ Bitcoin │    │
│  │     │   Intent        │   Solvers   │────────►│         │    │
│  │     │                 │   compete   │         └─────────┘    │
│  │     │◄── Best ────────│   to fill   │         ┌─────────┐    │
│  │     │   Execution     │             │────────►│  Zcash  │    │
│  └─────┘                 └─────────────┘         └─────────┘    │
│                                                   ┌─────────┐    │
│                                          ────────►│Dogecoin │    │
│                                                   └─────────┘    │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Intent Exchange Benefits

  • Best execution: Solvers compete for best price
  • No slippage: Price locked at intent creation
  • MEV protection: Intents prevent front-running
  • Cross-chain atomic: All-or-nothing execution