In a ZK-rollup, the sequencer and prover are distinct, specialized components that operate asynchronously to scale the blockchain. The sequencer's primary role is transaction ordering and batching. It receives user transactions off-chain, orders them into a sequence, and compresses them into a single batch. This batch, often represented as a new state root, is then posted to the base layer (like Ethereum) as calldata. This initial posting provides users with a strong guarantee of transaction inclusion and data availability, but not yet finality.
How to Coordinate Sequencers and Provers
Introduction to Sequencer-Prover Coordination
A technical overview of the critical, asynchronous relationship between the sequencer and prover in a ZK-rollup, explaining how they work together to achieve scalability and finality.
The prover operates in parallel, performing the computationally intensive work of zero-knowledge proof generation. It takes the sequencer's batch of transactions and the previous state root as inputs. Using a zk-SNARK or zk-STARK proof system, it generates a cryptographic proof (a ZK-proof) that attests to the correctness of the state transition. This proof demonstrates that every transaction in the batch is valid (signatures are correct, balances are sufficient, etc.) and that the new state root was computed correctly, without revealing any private transaction details.
The generated ZK-proof is then submitted to a verifier contract deployed on the base chain. This smart contract is a lightweight, gas-efficient program that can quickly verify the proof's validity. If the verification passes, the state transition is considered finalized on the base layer. This finality is what allows users to withdraw assets from the rollup with the full security of Ethereum. The separation of duties is key: the sequencer enables high throughput and low latency for users, while the prover provides the cryptographic security that underpins the system's trustlessness.
Coordination between these components is managed through a shared state and often a proof queue. Systems like zkSync Era and Starknet implement sophisticated coordination logic. The sequencer must provide the prover with all necessary data: the transaction batch, the pre-state, and the witness data. The prover, which may be a decentralized network of nodes, picks up these proof generation tasks. Latency in proof generation creates a finality delay, which is a key trade-off for the scalability benefits. Optimizing this pipeline—through parallel proving, hardware acceleration (GPUs/ASICs), and efficient proof recursion—is a major focus of rollup development.
For developers building on a rollup, understanding this split is crucial. Your application's user experiences fast, cheap transactions confirmed by the sequencer, but must account for the delay before those transactions achieve full L1 finality. Smart contract logic that depends on finalized state, like bridge withdrawals, must query the L1 verifier contract. Monitoring tools need to track both sequencer health and prover performance to diagnose issues.
Prerequisites and System Requirements
A technical overview of the hardware, software, and network components needed to coordinate sequencers and provers in a ZK-rollup or validity-proof system.
Coordinating sequencers and provers requires a robust infrastructure stack. The core components include a sequencer node for transaction ordering and block production, a prover node for generating validity proofs, and a coordinator service to manage the workflow between them. This setup is fundamental for L2s like Starknet, zkSync Era, and Polygon zkEVM. Each component has distinct system requirements, from CPU and RAM for computation to storage for state data and proof artifacts. Network latency between these services is also a critical factor for system throughput.
For the sequencer, the primary requirement is high single-thread CPU performance and fast, reliable storage. Sequencers execute transactions and construct new L2 blocks, so they need sufficient RAM to hold the current state (often 32-64 GB for production) and fast SSDs (NVMe) for reading/writing state snapshots. The software typically involves a modified Ethereum client like Geth or Erigon, augmented with L2 logic (e.g., using the OP Stack or a ZK-rollup framework). A stable, low-latency connection to the base layer (Ethereum) and L2 peer-to-peer network is essential.
Prover nodes have the most demanding computational requirements. Generating ZK proofs (STARKs or SNARKs) is highly parallelizable and GPU-accelerated. A production prover should have a high-end multi-core CPU (e.g., AMD Threadripper/EPYC or Intel Xeon), 128+ GB of RAM, and one or more powerful GPUs (NVIDIA A100, H100, or RTX 4090). The software stack includes the specific prover binary (like starknet_prover, bellman, or plonky2) and often requires specific drivers and CUDA toolkits. Storage needs are lower than the sequencer but must be fast for intermediate proof computation files.
The coordinator is a service, often written in Go or Rust, that receives batches from the sequencer, assigns them to available prover nodes, and submits the final proofs to L1. It can run on a machine with moderate specs (8-16 core CPU, 32 GB RAM) but requires high availability. This service manages the queue, handles prover failures, and ensures finality. Tools like Apache Kafka or Redis are commonly used for job queuing, while the coordinator's logic is defined by the rollup's protocol (e.g., the proof auction mechanism in Polygon zkEVM).
A local testnet is the best environment for development. You can use frameworks like foundry or hardhat to deploy a local L1 (Anvil or Hardhat Network) and run modified versions of the rollup node software (e.g., zksync-era's local-setup or starknet-devnet). Docker Compose is frequently used to orchestrate the sequencer, prover, and coordinator containers. This allows you to test the full submission pipeline—from L2 transaction to L1 proof verification—without deploying to a public testnet.
Before moving to production, ensure your setup meets the network and security prerequisites. All nodes need static public IPs or reliable NAT traversal. You must configure the L1 RPC endpoint (from a provider like Alchemy, Infura, or a private node) and fund the system's L1 smart contracts with ETH for gas. Security involves managing validator keys for the sequencer, securing the prover's GPU resources, and implementing monitoring (Prometheus/Grafana) for node health, proof generation times, and L1 gas costs.
How to Coordinate Sequencers and Provers
A guide to designing the communication and workflow between the sequencer and prover components in a modular blockchain stack.
In a modular blockchain architecture, the sequencer and prover are distinct services with specialized roles. The sequencer is responsible for ordering transactions and batching them into blocks. The prover's job is to generate a cryptographic proof (like a ZK-SNARK or validity proof) that attests to the correctness of the state transitions within that block. Effective coordination between these two components is critical for system liveness, efficiency, and data availability. Poor coordination can lead to proof generation bottlenecks, delayed finality, or wasted computational resources.
The coordination model is typically orchestrated by the sequencer. After a sequencer batch is finalized, the sequencer must package the necessary execution trace data—often referred to as a witness—and submit it to one or more provers. This data includes the pre-state, the list of transactions, and the post-state root. The design of this data pipeline impacts performance; using efficient serialization formats (like Protobuf) and direct gRPC streams can reduce latency compared to posting data to a shared blob storage service first.
Provers can be configured in different topologies relative to the sequencer. A common setup is a dedicated prover network, where the sequencer dispatches proof jobs to a pool of proving nodes. This requires a job queue and a result aggregator. Alternatively, in a co-located model, the sequencer and prover run as tightly coupled processes, sharing memory for faster witness passing. The choice depends on the trade-off between decentralization of proving and the need for low-latency coordination. Systems like Polygon zkEVM and zkSync Era implement variations of these patterns.
Implementing a fault-tolerant coordination layer is essential. The sequencer should track the status of each proof job and have logic for retries and failover. If a prover fails or times out, the job should be reassigned. Furthermore, the system must handle proof verification once a proof is generated. The sequencer, or a dedicated verifier contract, must verify the proof on-chain. The coordination logic should only consider a batch final once a valid proof is verified and posted to the destination chain, completing the settlement process.
Here is a simplified code example illustrating a sequencer service dispatching a proof job using a message queue pattern. This pseudocode assumes a Redis queue for job distribution and an HTTP endpoint for prover nodes to fetch witness data.
python# Sequencer side: After creating a batch batch_id, witness_data = create_sequencer_batch(txs) store_witness(batch_id, witness_data) # Store to DB/blob storage # Create a proof job for the prover network proof_job = { "batch_id": batch_id, "witness_url": f"https://witness-store.io/{batch_id}", "prover_type": "groth16", "priority": "high" } redis_client.lpush('proof_jobs', json.dumps(proof_job)) # Prover side: Worker polling for jobs while True: job_json = redis_client.brpop('proof_jobs') job = json.loads(job_json) witness = download_witness(job['witness_url']) proof = generate_proof(witness, job['prover_type']) post_proof_to_verifier(job['batch_id'], proof)
Key metrics to monitor in this coordination layer include sequencer-to-prover latency, proof generation success rate, and job queue depth. Tools like Prometheus for metrics and Grafana for dashboards are commonly used. The ultimate goal is to achieve a steady state where proof generation keeps pace with block production without creating a backlog. As the system scales, you may need to implement more advanced features like proof aggregation, priority scheduling for high-value batches, or economic mechanisms (like a proof marketplace) to incentivize a robust, decentralized prover network.
Coordination Patterns and Architectures
Efficiently managing the flow of transactions and proofs is critical for rollup performance. This guide covers the core patterns for orchestrating sequencers and provers.
Time-Based vs. Capacity-Based Batching
The trigger for closing a batch and sending it to provers is a key coordination decision.
Time-Based (Interval):
- A new batch is created every fixed period (e.g., 2 seconds).
- Predictable but can lead to empty or small batches during low activity.
Capacity-Based (Size):
- A batch is closed when it reaches a target size (e.g., 10 MB or 10,000 transactions).
- Efficient gas usage but variable confirmation times for users.
Most production systems use a hybrid approach, closing a batch when either the time interval elapses or the capacity is reached.
Fallback Mechanisms and L1 Escrow
Robust coordination requires a safe fallback if the primary sequencer or prover network fails. The L1 contract acts as the final arbiter.
Force-Inclusion Channels: Users can submit transactions directly to the L1 rollup contract if the sequencer censors them, after a delay.
Prover Failure Handlers:
- Timeout: If no proof is submitted within a deadline (e.g., 24 hours), the batch can be contested or re-proven.
- Backup Prover Networks: A staked, permissioned set of provers is on standby.
This ensures the system defaults to security, even if performance degrades.
Implementation Steps: Building the Coordinator
A coordinator orchestrates the workflow between sequencers and provers in a ZK-rollup, ensuring efficient transaction processing and proof generation.
The coordinator is a critical off-chain service that manages the lifecycle of batches. Its primary responsibilities are to collect finalized transaction batches from the sequencer, dispatch them to available provers for zero-knowledge proof generation, and submit the final proofs to the L1 settlement contract. This role is essential for maintaining the system's liveness and ensuring that state transitions are verifiable on the base layer. A well-designed coordinator must be fault-tolerant, handle prover failures gracefully, and manage a queue of pending work to optimize throughput and reduce latency.
The core implementation involves setting up a job queue and a prover registry. When a new batch is ready, the coordinator creates a proof generation job, encapsulating the batch data and the required circuit identifier. It then selects a prover from its registry based on criteria like current load, supported circuit versions, or a staking-based reputation system. The job is dispatched via a simple HTTP or gRPC API to the prover's endpoint. The coordinator must track the job status, implement timeouts for stalled proofs, and have a retry mechanism with potential job reassignment to a different prover in case of failure.
For reliability, the coordinator's state should be persisted. You can use a database to store job metadata—such as batch_number, prover_assigned, status (pending, processing, completed, failed), and proof_data. This allows the service to recover its state after a restart. A simple implementation in Node.js might use Bull or Kue for the job queue and PostgreSQL for persistence. The coordinator also needs to listen for events from the L1 rollup contract to know when a new batch is ready and emit events or update its database when a proof is successfully generated and submitted.
Integrating with the sequencer requires a secure communication channel. Typically, the sequencer posts batch data to a decentralized storage solution like IPFS or Arweave, emitting an event with the content identifier (CID). The coordinator listens for this event, retrieves the batch data, and begins the proving process. Alternatively, a direct API call from the sequencer to the coordinator's /submit-batch endpoint can be used in permissioned setups. The chosen method impacts the system's decentralization and fault tolerance.
Finally, the coordinator must submit the completed proof to the L1 verifier contract. This involves calling a function like verifyAndUpdateState(bytes calldata proof, uint256 batchNumber). The coordinator needs an funded L1 wallet to pay for gas. It should also monitor the transaction receipt for success and update the job status accordingly. Error handling here is critical; failed submissions may require re-submission or alerting an operator. The complete loop—from batch finalization to proof verification—defines the rollup's operational cadence.
Sequencer-Prover Models in Major Rollups
Comparison of coordination models for sequencers and provers across leading Layer 2 rollup implementations.
| Architectural Feature | Arbitrum Nitro | Optimism Bedrock | zkSync Era | Starknet |
|---|---|---|---|---|
Sequencer Role | Centralized, Offchain Labs | Centralized, OP Labs | Centralized, Matter Labs | Centralized, StarkWare |
Prover Type | Fraud Proof (Interactive) | Fault Proof (Non-interactive) | ZK Proof (zk-SNARK) | ZK Proof (zk-STARK) |
Prover Coordination | Permissioned, Team-Operated | Permissioned, Team-Operated | Permissioned, Team-Operated | Permissioned, Team-Operated |
Decentralization Roadmap | Stage 1: Permissioned Provers | Stage 1: Permissioned Provers | zkPorter w/ Guardians | Prover Marketplace Planned |
Time to Finality (L1) | ~1 week (Dispute Window) | ~1 week (Dispute Window) | ~1 hour | ~3-5 hours |
Proving Cost Model | Bonded Challenge (Gas) | Bonded Challenge (Gas) | Compute-Intensive (Prover Fee) | Compute-Intensive (Prover Fee) |
Trust Assumption | 1-of-N Honest Actor | 1-of-N Honest Actor | Cryptographic (Setup Trusted) | Cryptographic (Trustless) |
Prover Incentive | Slash Bond (Malicious) | Slash Bond (Malicious) | Fee from Batch Revenue | Fee from Batch Revenue |
Tools and Documentation
References, frameworks, and coordination patterns for building systems where sequencers order transactions and provers generate validity proofs. Each card points to a concrete tool or documentation set that explains how this coordination is implemented in production rollups.
How to Coordinate Sequencers and Provers
This guide explains the critical coordination between sequencers and provers in a rollup, detailing how state is managed and data is made available for verification.
In a modular blockchain stack, the sequencer and prover are distinct but interdependent components. The sequencer is responsible for ordering transactions, executing them, and generating new state roots. The prover's role is to cryptographically attest to the correctness of this state transition by generating a validity proof, such as a ZK-SNARK or ZK-STARK. Effective coordination between them is essential for maintaining system liveness, security, and finality. A failure in this handoff can lead to delayed proofs, stalled withdrawals, or even security vulnerabilities.
The coordination workflow typically follows a state batch lifecycle. First, the sequencer processes a block or batch of transactions, producing a new state root and the corresponding state diff. This data, along with the transaction batch, is published to a Data Availability (DA) layer like Celestia, EigenDA, or Ethereum calldata. Publishing to a DA layer is non-negotiable; it ensures that any honest actor can reconstruct the rollup's state and challenge invalid assertions, forming the bedrock of trust minimization.
Once the batch data is available, the sequencer signals the prover by submitting a proving job. This job contains the pre-state root, post-state root, and a commitment to the published data. Provers, which can be a centralized service or a decentralized network like Espresso or RiscZero, then fetch the transaction data from the DA layer, re-execute the transactions, and generate a validity proof. In ZK-rollups like zkSync Era or Starknet, this proof is submitted to the L1 settlement layer to finalize the state transition.
Optimistic rollups like Arbitrum and Optimism use a similar coordination pattern but replace the prover with a fault proof system. Here, sequencers post state roots and data to Ethereum. A challenge period (typically 7 days) begins, during which verifiers can dispute incorrect state roots by submitting a fraud proof. The coordination challenge shifts from generating proofs to ensuring the fraud proof mechanism is correctly incentivized and that necessary data for challenges is readily available.
To implement this, rollup nodes use a state manager and a proof coordinator. The state manager handles local execution and state storage, while the proof coordinator interfaces with the prover network. A common pattern is to use a job queue (e.g., with Redis or RabbitMQ) where the sequencer enqueues proving tasks. The prover service polls this queue, processes jobs, and posts results back to a smart contract. Open-source stacks like Polygon zkEVM's prover coordination or the RiscZero zkVM provide reference architectures for this setup.
Key operational considerations include proof generation time versus block time, cost optimization for DA posting, and prover decentralization. Strategies like parallel proof generation, data compression techniques (e.g., using zk-SNARKs for data availability proofs), and employing multiple prover networks for redundancy are actively being developed to improve this critical coordination layer and scale rollup throughput.
Fault Tolerance and Recovery
Ensuring high availability and data integrity in a decentralized sequencer-prover network requires robust fault tolerance mechanisms.
In a zero-knowledge rollup, the sequencer batches user transactions and the prover generates validity proofs. A single point of failure in either component halts the entire chain. Fault tolerance is achieved by running multiple redundant instances of these services. A common architecture uses a leader-follower model for sequencers, where a leader is elected (e.g., via a consensus algorithm like Tendermint or Raft) to order transactions. Followers replicate the leader's state and can take over within seconds if the leader fails, ensuring liveness. For provers, a job queue system allows multiple proving nodes to compete to generate proofs for the latest batch, guaranteeing safety even if individual provers crash.
Coordinating these components requires a state machine replication protocol. The sequencer cluster maintains a shared, append-only log of transaction batches. Each sequencer node agrees on the log's contents using consensus. This log is the single source of truth for both state updates and proof generation jobs. Provers subscribe to this log, pulling the latest batch data and the required pre-state to compute a proof. A coordinator service or smart contract can manage this workflow, assigning batch IDs to available provers and tracking completion. This decouples the sequencing and proving processes, allowing each to scale and recover independently.
Implementing recovery involves checkpointing and watchdogs. Sequencers must periodically persist their Merkle tree state to durable storage. Upon restarting after a crash, a follower can sync to the latest agreed-upon batch and rebuild its state from the last checkpoint. Provers, which are stateless regarding chain history, simply reconnect to the job queue. A watchdog service monitors the health of all nodes, often via heartbeats. If the leader sequencer or a critical number of provers become unresponsive, the watchdog triggers a failover procedure, which may involve electing a new leader or re-assigning proof jobs.
Here's a simplified code concept for a prover health check and job re-assignment using a coordinator contract:
solidity// Pseudocode for a coordinator smart contract struct ProofJob { uint64 batchId; address assignedProver; uint64 deadline; bool completed; } mapping(uint64 => ProofJob) public jobs; function reassignStalledJob(uint64 batchId) external { ProofJob storage job = jobs[batchId]; require(block.timestamp > job.deadline, "Deadline not passed"); require(!job.completed, "Job already complete"); // Reset assignment to allow the next available prover to pick it up delete job.assignedProver; delete job.deadline; }
This contract allows any network participant to flag a stalled job after its deadline, making the batch available for other provers, thus ensuring proof generation eventually completes.
For sequencer failover, a system like Apache ZooKeeper or etcd is often used to maintain a distributed key-value store for leader election and configuration. When the current leader's session expires, remaining nodes hold an election. The new leader loads the latest checkpoint, begins serving transaction requests, and continues appending to the shared log. It's critical that the proving system can handle reorgs—temporary forks in the sequencer log during leader transitions. Provers should only finalize proofs for batches that have been finalized in the log (e.g., through a two-phase commit), avoiding work on orphaned chains.
Ultimately, effective coordination balances decentralization, performance, and cost. While a multi-party sequencer set improves censorship resistance, it adds consensus latency. Similarly, a decentralized prover network maximizes uptime but requires efficient job distribution logic. The goal is to design a system where the failure of any single node, or even a small subset, is automatically detected and mitigated without manual intervention, ensuring the rollup continues to process transactions and submit proofs to L1 reliably. Monitoring metrics like leader election time, proof job queue depth, and state sync duration is essential for maintaining this resilience.
Frequently Asked Questions
Common technical questions and troubleshooting for developers working with decentralized sequencer networks and ZK provers.
A sequencer is responsible for ordering transactions into a block and producing an execution trace. A prover (specifically a ZK prover) takes that execution trace and generates a cryptographic proof (e.g., a STARK or SNARK) that attests to the correctness of the state transition.
In a rollup architecture, the sequencer provides liveness by processing transactions quickly, while the prover provides finality and data availability guarantees by creating a validity proof that is posted to the base layer (L1). They are distinct roles that can be performed by the same or different network participants.
Conclusion and Next Steps
Coordinating sequencers and provers is a core challenge in building performant and secure Layer 2 rollups. This guide has outlined the key architectural patterns and trade-offs.
Successfully implementing a sequencer-prover coordination system requires balancing liveness, decentralization, and cost. The choice between a centralized sequencer and a decentralized sequencer set directly impacts censorship resistance and fault tolerance. Similarly, the prover market model—whether using a single trusted prover, a permissioned set, or a permissionless network—determines your system's security guarantees and proving latency. Tools like shared sequencer networks (e.g., Espresso, Astria) and proof marketplaces (e.g., Gevulot) are emerging to abstract these complexities.
For developers, the next step is to implement and test these coordination mechanisms. Using a framework like the OP Stack or Arbitrum Nitro provides a battle-tested starting point. You can then integrate a custom prover network by modifying the rollup node to submit proof jobs via an API or a smart contract on a data availability layer like Celestia or EigenDA. Monitoring key metrics is critical: sequencer inclusion time, proving latency, proof verification gas cost on L1, and the economic security of your prover bond.
The landscape is rapidly evolving. ZK rollups are moving towards proof aggregation and recursive proofs to reduce costs, while optimistic rollups are exploring faster dispute resolution protocols. To stay current, follow the research from teams like Polygon zkEVM, zkSync, and Arbitrum. Experimenting on testnets like Sepolia or Holesky is essential for understanding real-world performance before a mainnet deployment.