Skip to main content

Consensus Mechanism

Nexis Appchain uses the Optimism (OP Stack) rollup consensus mechanism, which differs fundamentally from traditional proof-of-work or proof-of-stake consensus. Instead of nodes voting on blocks, consensus is achieved through deterministic derivation from L2 (Base Sepolia) data.

Overview

Derivation Pipeline

Blocks are derived deterministically from L2 batch data

Sequencer Authority

Single sequencer orders transactions (temporarily centralized)

Fault Proof Security

Invalid state transitions are challenged and proven wrong

Three Finality Levels

Unsafe, safe, and finalized heads provide different guarantees

Consensus Architecture

Derivation Pipeline

The derivation pipeline is the core of OP Stack consensus. Any node can independently derive the canonical L3 chain by following this deterministic process:

Pipeline Stages

1

Fetch L2 Data

Read batch transactions from Base Sepolia that contain L3 data
2

Decompress Batches

Decompress and decode the batched transaction calldata
3

Parse Transactions

Extract individual L3 transactions from batch format
4

Build Blocks

Group transactions into 2-second blocks with proper ordering
5

Execute State Transitions

Apply each transaction and update the state database
6

Generate Output Roots

Compute state roots and compare with proposed outputs

Implementation

Derivation Example

Let’s trace how a user transaction flows through the system:

Sequencer Operations

The sequencer is currently a centralized component responsible for transaction ordering and block production. Understanding its role is critical to understanding Nexis consensus.

Sequencer Responsibilities

  1. Transaction Acceptance: Receive and validate transactions via JSON-RPC
  2. Mempool Management: Maintain pending transaction pool with priority ordering
  3. Block Production: Create blocks every 2 seconds with optimal transaction packing
  4. State Execution: Apply transactions and update state through op-geth
  5. Network Propagation: Broadcast blocks to all nodes via P2P gossip
  6. Batch Coordination: Send blocks to batcher for L2 submission

Block Production Algorithm

Sequencer Configuration

Finality Levels

Nexis provides three levels of finality, each with different trust assumptions and latency:

1. Unsafe Head

The unsafe head is the latest block produced by the sequencer, before it’s submitted to L2. Characteristics:
  • Latency: ~2 seconds
  • Trust: Must trust the sequencer
  • Reversibility: Sequencer could reorg
  • Use Case: Fast UI updates, optimistic UX
Unsafe head can be reorged! Only use for optimistic UI updates. Never finalize critical operations (payments, withdrawals) based on unsafe head.

2. Safe Head

The safe head is the latest block that has been submitted to Base L2 and confirmed. Characteristics:
  • Latency: ~4 minutes (30 blocks batched + L2 confirmation)
  • Trust: Trust Base L2 validators
  • Reversibility: Only if Base L2 reorgs (very rare)
  • Use Case: Standard transaction confirmations

3. Finalized Head

The finalized head is the latest block for which the challenge period has expired without successful disputes. Characteristics:
  • Latency: ~15 minutes (after Base L2 finalization)
  • Trust: Trust Ethereum L1
  • Reversibility: Only if Ethereum reorgs (practically impossible)
  • Use Case: High-value transactions, bridges, custody

Finality Comparison

Reorg Protection

Nexis inherits reorg protection from the OP Stack architecture:

Sequencer-Level Protection

L2 Batch Protection

Once a batch is submitted to Base L2:
  1. The batch data is permanently stored on L2
  2. Validators can derive blocks from this data
  3. Any deviation from derived blocks can be challenged
  4. Sequencer cannot unilaterally reorg batched blocks

Fault Proof Protection

The ultimate reorg protection comes from fault proofs:

Censorship Resistance

While the sequencer can temporarily censor transactions, users have escape hatches:

Force Inclusion via L2

Users can force transaction inclusion by submitting directly to Base L2:

Sequencer Rotation (Future)

Nexis will implement sequencer rotation to further reduce censorship risk:

Comparison to Other Consensus Mechanisms

Learn More

Block Validation

How blocks are validated and secured

Fault Proofs

Deep dive into the security mechanism

Run a Validator

Participate in block derivation

Infrastructure Overview

Complete architecture documentation

Questions about consensus? Join the discussion in our Discord #consensus channel.