Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

Setting Up a ZK-Rollup for Confidential Fundraising Rounds

A technical guide for developers to implement a dedicated ZK-rollup that batches private sale transactions, reducing gas costs while keeping investor details confidential on-chain.
Chainscore © 2026
introduction
GUIDE

Introduction to ZK-Rollups for Private Fundraising

This guide explains how to leverage ZK-Rollup technology to create confidential fundraising rounds, ensuring investor privacy and transaction efficiency on Ethereum.

ZK-Rollups are a Layer 2 scaling solution that bundles hundreds of transactions into a single proof, which is then verified on the Ethereum mainnet. For private fundraising, this architecture is transformative. It allows a project to conduct an entire investment round off-chain, shielding participant addresses and contribution amounts from public view. Only the final, aggregated state change—proven valid by a zero-knowledge proof (ZKP)—is posted to Ethereum. This provides confidentiality without sacrificing the security guarantees of the base layer.

Setting up a ZK-Rollup for fundraising requires selecting a specific ZK-rollup stack. For developers, options include zkSync Era, Starknet, or Polygon zkEVM. Each has its own prover system (SNARKs vs. STARKs) and virtual machine compatibility. A common approach is to write a custom smart contract, or application-specific rollup (app-rollup), that defines the fundraising logic: contribution limits, whitelist management, and token distribution. This contract is deployed to the rollup's sequencer, which will process all private transactions.

The core technical challenge is generating zero-knowledge proofs for the fundraising activity. Using a library like Circom or Cairo, you define circuits that validate contributions against the rules in your smart contract without revealing the underlying data. For example, a circuit can prove an investor is on a whitelist and their contribution is within bounds, using only a cryptographic commitment. The sequencer runs these circuits to generate a validity proof for each batch of transactions before submitting it to L1.

From an investor's perspective, the experience is seamless but private. They connect their wallet to the rollup's RPC endpoint, submit a signed transaction, and receive a proof of inclusion. Their activity is visible only within the rollup's state, which is encrypted or hashed. Key management is critical; investors must safeguard the private keys for their rollup accounts, as these are separate from their mainnet Ethereum wallets. Tools like zkSync's Wallet SDK or Starknet.js facilitate this interaction.

For project operators, the final step is the trustless withdrawal of funds. Once the round closes, the accumulated capital (in ETH or stablecoins) is proven to be held in the rollup's smart contract. Investors can then initiate a withdrawal request, providing a ZKP that they are entitled to a share. After a challenge period, funds are released from the mainnet bridge contract. This entire flow ensures capital is secured by Ethereum's consensus while keeping the fundraising details between the project and its investors.

prerequisites
SETUP GUIDE

Prerequisites and System Requirements

Before building a confidential fundraising round on a ZK-Rollup, you need the right development environment, tools, and foundational knowledge. This guide details the hardware, software, and conceptual prerequisites.

A ZK-Rollup is a Layer 2 scaling solution that executes transactions off-chain and submits validity proofs to the mainnet. For confidential fundraising, you'll leverage zero-knowledge proofs (ZKPs) to hide sensitive data like investor allocation amounts while proving the transaction's validity. The core technical stack involves a sequencer to batch transactions, a prover to generate ZKPs (using libraries like Circom or Halo2), and a verifier contract deployed on the base layer (e.g., Ethereum). You should be familiar with Ethereum's architecture, smart contract development in Solidity, and the basic cryptographic primitives behind ZKPs.

Your development environment requires specific tools. Install Node.js (v18 or later) and a package manager like npm or yarn. You will need a ZK circuit development framework; Circom 2.x with snarkjs is a common choice for writing and compiling circuits. For local testing, set up a Hardhat or Foundry project to deploy and interact with your verifier contract. An Ethereum testnet RPC URL (from providers like Alchemy or Infura) is essential for deploying to Goerli or Sepolia. Version control with Git is mandatory for managing your circuit and contract code.

For optimal prover performance, adequate hardware is critical. Generating ZK proofs is computationally intensive. We recommend a machine with a multi-core CPU (8+ cores), 16GB+ of RAM, and 50GB of free SSD storage. Proving times can vary from seconds to minutes depending on circuit complexity; a powerful CPU significantly reduces this latency. For production, you may need to provision cloud-based proving services or dedicated servers. Always benchmark proof generation on your target hardware to estimate user experience and gas costs for on-chain verification.

You must understand the data flow for a confidential transaction. The investor's contribution amount is a private input to the ZK circuit. The circuit's public outputs might include a cryptographic commitment to the amount and the investor's public key. The prover generates a proof showing the private input satisfies the circuit's rules without revealing it. This proof and the public outputs are sent to the rollup sequencer, which batches them and posts the proof to the mainnet verifier contract. The contract checks the proof, and if valid, finalizes the state update, keeping the amount hidden on-chain.

Key security prerequisites involve managing trusted setups. Most ZK-SNARK systems require a one-time, multi-party ceremony to generate proving and verification keys. For Circom, you would use the powersOfTau ceremony. You must download these trusted setup files (.ptau) from a reputable source or participate in a ceremony. Never generate these for production alone. Furthermore, you are responsible for the circuit's logic security; a bug can leak information or lock funds. Consider an audit for both your ZK circuits and the integrating smart contracts before any mainnet deployment.

Finally, prepare your wallet and testnet funds. You'll need an EVM-compatible wallet (like MetaMask) with its private key or mnemonic accessible to your development scripts. Fund it with testnet ETH from a faucet to pay for contract deployments and transaction fees on the rollup. For interacting with a specific rollup stack (e.g., zkSync Era, Polygon zkEVM), install their required SDKs and bridge testnet ETH to the L2. Confirm you can compile a simple circuit, generate a proof, and verify it on-chain in a test environment before designing your full application logic.

architecture-overview
SYSTEM ARCHITECTURE AND COMPONENTS

Setting Up a ZK-Rollup for Confidential Fundraising Rounds

This guide details the technical architecture for building a privacy-preserving fundraising platform using zero-knowledge rollups.

A ZK-rollup for confidential fundraising is a Layer 2 scaling solution that batches private transactions off-chain and submits validity proofs to a mainnet like Ethereum. The core system components include a Sequencer for ordering transactions, a Prover for generating zero-knowledge proofs (ZKPs), a Smart Contract on L1 for verification and state finalization, and a Data Availability (DA) layer to store transaction data. This architecture ensures that fundraising amounts and participant identities remain confidential while leveraging Ethereum's security for settlement.

The Sequencer is the system's operational hub. It receives encrypted transaction bundles from users, orders them into blocks, and posts the compressed data to the DA layer. For fundraising, this includes commitments to new rounds, encrypted bids, and proof submissions. The sequencer also interacts with the Prover (often a separate service like RISC Zero or a custom circuit), which generates a Succinct Non-interactive Argument of Knowledge (SNARK) or STARK. This proof cryptographically attests that all off-chain state transitions—like validating bid amounts against round caps—are correct without revealing the underlying data.

On the mainnet, a verifier smart contract is the anchor of trust. It receives the proof and the new state root from the rollup. By verifying the ZKP, the contract can be confident the off-chain computations are valid before updating the canonical state on-chain. For fundraising, this contract also manages the escrow of funds and the final disbursement to project treasuries once a round concludes. Using a Data Availability solution like Ethereum calldata, EigenDA, or Celestia is critical; it ensures that despite privacy, the data needed to reconstruct the chain state is publicly available, preventing fraud.

Implementing confidentiality requires specialized ZK circuits. You design a circuit logic that enforces fundraising rules—such as individual contribution limits, round hard caps, and KYC/whitelist checks—using private inputs. A user's transaction would provide a ZKP that their bid is valid, revealing only a public output (a commitment). Libraries like Circom or Halo2 are used to write these circuits. The proving system must be efficient, as generating proofs for complex fundraising logic can be computationally intensive and impact user experience.

A practical setup involves deploying the L1 verifier contract, running a sequencer node (using a framework like ZK Stack or Polygon CDK), and integrating a proving service. Developers must configure the system to handle specific fundraising parameters and ensure the DA layer's cost and security model align with the application's needs. The end result is a scalable platform where fundraising activity is transparently settled on Ethereum, but sensitive financial details remain encrypted and provably correct, addressing a key need for institutional and high-net-worth participants in crypto.

step1-sequencer
INFRASTRUCTURE

Step 1: Setting Up the Sequencer Node

The sequencer is the operational backbone of your ZK-rollup, responsible for ordering transactions, batching them, and generating validity proofs. This guide walks through the initial setup using a popular framework.

For this guide, we'll use Starknet as our example ZK-rollup framework, given its mature tooling and Cairo language. The first step is to install the core dependencies. You'll need Rust (version 1.70 or later) for compiling the sequencer, Python (3.9+) for scripting, and Docker for containerized execution. Clone the official starknet repository from GitHub to get the sequencer source code: git clone https://github.com/starkware-libs/starknet.git.

Before building, you must configure your node's environment. Create a .env file in the project root to define critical variables. You'll need to set the STARKNET_NETWORK (e.g., testnet or mainnet), specify an RPC_ENDPOINT for the L1 Ethereum provider (like Infura or Alchemy), and generate a SEQUENCER_PRIVATE_KEY for signing blocks. Securing this key is paramount, as it authorizes state updates.

Next, compile the sequencer binary. Navigate to the crates/sequencer directory and run cargo build --release. This process can take 10-20 minutes. The resulting binary, starknet_sequencer, will be in the target/release folder. For a production deployment, consider building within a Docker container for consistency using the provided Dockerfile in the repository.

Initializing the node requires a genesis configuration. You must define the initial state of your rollup, including the confidential fundraising contract address and its verified initial state root. Create a genesis.json file that references your compiled contract's class hash and initial storage values. The sequencer uses this file to bootstrap its local database and establish the canonical chain from block zero.

Finally, start the sequencer with the command ./starknet_sequencer --config-path ./config.toml. The config.toml file should point to your .env variables, genesis file, and set parameters like block time and data availability mode (e.g., posting data to Ethereum calldata). Monitor the logs for Block #0 created to confirm successful initialization. Your node is now sequencing transactions for your private rollup.

step2-prover
SETUP

Integrating the ZK Prover Service

This step configures the core privacy engine for your confidential fundraising rollup, enabling zero-knowledge proof generation and verification.

The ZK prover service is the computational engine that generates the cryptographic proofs for your rollup's private transactions. For a fundraising application, this service must be configured to handle the specific circuit logic governing confidential bids, commitment schemes, and final allocation proofs. You'll typically deploy this as a separate microservice, often using frameworks like Circom for circuit design and SnarkJS or a Rust-based prover like arkworks for proof generation. The service exposes a REST or gRPC API that your sequencer node will call to request proofs for batched state transitions.

A critical configuration step is defining and compiling your ZK circuit. This circuit is the program that defines the rules of your private auction. It will take private inputs (like a bid amount and a secret), public inputs (like the encrypted bid commitment published on-chain), and constants, then output a proof that the private inputs satisfy the public constraints without revealing them. For a fundraising round, your circuit logic must verify: bid validity (e.g., within limits), correct computation of the Pedersen commitment, and proper nullifier generation to prevent double-spending of bid deposits.

After compiling the circuit, you must generate the required trusted setup parameters (also known as the Proving Key and Verification Key) using a Phase 2 Powers of Tau ceremony. For production, participating in a public multi-party ceremony (like those run by the Ethereum Foundation) is essential for maximizing trust minimization. Once you have the .zkey (proving key) and verification_key.json files, you configure your prover service to load them. The service will use these keys to generate proofs for your sequencer and to create the verification smart contract code.

Integrate the prover with your sequencer node. When the sequencer processes a batch of private bids, it must send the necessary public inputs and witness data to the prover service's API endpoint. A typical request payload includes the public inputs for the batch and the serialized witness. The prover service executes the circuit with this data, generates the zk-SNARK proof (a small, constant-sized proof), and returns it to the sequencer. The sequencer then submits this proof, along with the new state root and public data, to the Layer 1 settlement contract.

For scalability and reliability, consider running multiple prover instances behind a load balancer. Proof generation is computationally intensive, and parallelizing this workload is crucial for maintaining low latency as transaction volume grows. You should also implement comprehensive logging and monitoring for the prover service, tracking metrics like proof generation time, CPU/memory usage, and error rates. This setup ensures your confidential fundraising platform can handle peak demand during active investment rounds.

step3-verifier-contract
ZK-ROLLUP IMPLEMENTATION

Step 3: Deploying the Verifier Smart Contract

The verifier smart contract is the on-chain anchor of your ZK-rollup. It validates zero-knowledge proofs to authorize state transitions, such as processing private contributions, without revealing sensitive data.

The verifier contract's primary function is to verify a zero-knowledge proof submitted by your rollup's operator. This proof cryptographically attests that a batch of off-chain transactions—like encrypted bids in a confidential fundraising round—has been processed correctly according to the system's rules. The contract uses a pre-compiled verification key, generated during the trusted setup, to check the proof's validity in a single, gas-efficient Ethereum transaction. A successful verification triggers the contract to update the on-chain state root, a Merkle root hash representing the latest state of all user balances and commitments.

Deployment requires the verification key data, which is protocol-specific. For a circom and snarkjs stack, you would export the final verification_key.json and generate a Solidity verifier contract using snarkjs zkey export solidityverifier. For StarkNet or zkSync Era, the verifier is part of the SDK. A typical deployment script using Hardhat or Foundry involves loading the verifier artifact, linking any necessary libraries (like pairing or curve operations), and deploying with the verification key as a constructor argument. Always verify your contract on a block explorer like Etherscan after deployment.

Critical post-deployment steps include: transferring upgradeability control to a multi-signature wallet or DAO for security, setting the initial operator address authorized to submit proofs, and funding the contract with enough ETH to pay for proof submission gas costs. You must also ensure your off-chain prover service (the sequencer) is configured with the correct contract address and ABI. Test the full flow on a testnet like Sepolia by having your sequencer generate a valid proof from dummy transaction data and submit it to the verifier, confirming the state root updates as expected.

PRIVACY TECH COMPARISON

ZK-Rollup vs. Alternative Privacy Solutions for Fundraising

Evaluating privacy solutions for confidential fundraising rounds based on security, cost, and developer experience.

Feature / MetricZK-Rollup (e.g., Aztec, zkSync)FHE Networks (e.g., Fhenix, Inco)Private Sidechains (e.g., Monero, Oasis)

Privacy Model

Transaction-level privacy via ZK proofs

Data-level privacy via Fully Homomorphic Encryption

Network-level privacy via protocol design

Smart Contract Support

EVM Compatibility

Full (zkEVM) or partial

Emerging (FHE-enabled EVM)

None (custom VMs)

On-Chain Cost per TX

$0.10 - $0.50

$2.00 - $10.00+

$0.01 - $0.05

Finality Time

< 10 minutes

1 - 5 minutes

~30 minutes

Developer Tooling Maturity

High (SDKs, block explorers)

Low (early-stage, limited docs)

Medium (mature for native apps)

Primary Audit Risk

ZK circuit bugs, prover trust

FHE library implementation bugs

Protocol-level cryptographic flaws

Ideal Use Case

Private DeFi, confidential fundraising rounds

Encrypted data computation, secret voting

Private payments, anonymous transactions

step4-data-availability
ZK-ROLLUP CONFIGURATION

Step 4: Implementing Data Availability

This step configures how transaction data is published to Ethereum L1, ensuring the rollup's state can be reconstructed and verified by anyone.

Data availability (DA) is the guarantee that the data needed to reconstruct the state of your ZK-rollup is published and accessible. For a confidential fundraising application, this typically means publishing the encrypted transaction data or a commitment to that data on-chain. Without available data, users cannot independently verify the rollup's state transitions or prove ownership of their funds, breaking the system's trust model. The most common approach for Ethereum L2s is to post calldata to the L1, which is how Optimistic Rollups and zkEVMs like zkSync and Scroll operate.

You must decide on a data publishing strategy. The primary options are: Full data on-chain (posting encrypted transaction details directly), Data availability committees (DACs) where a trusted set of nodes hold the data, or Volitions (a hybrid model letting users choose). For maximum security and decentralization akin to Ethereum, publishing to L1 calldata is standard. Implement this by having your rollup's Sequencer or Prover node batch transactions, generate a cryptographic commitment (like a Merkle root), and submit it along with the compressed data to a smart contract on Ethereum L1, such as a Rollup or Bridge contract.

The on-chain contract must store the data commitments. Here is a simplified Solidity snippet for a contract that accepts state roots and associated data:

solidity
contract SimpleRollup {
    bytes32 public latestStateRoot;
    event DataSubmitted(bytes32 stateRoot, bytes data);

    function submitBatch(bytes32 _stateRoot, bytes calldata _compressedData) external {
        // Verify sender is authorized sequencer/prover
        require(msg.sender == authorizedSubmitter, "Unauthorized");
        
        latestStateRoot = _stateRoot;
        emit DataSubmitted(_stateRoot, _compressedData);
        
        // In practice, also verify a ZK proof validity here
    }
}

This contract records each batch's state root and the raw data, emitting an event for easy indexing by off-chain watchers.

For confidential transactions, the published data should not leak sensitive information. Instead of plaintext amounts and participant addresses, publish encrypted notes or zero-knowledge proof outputs. Projects like Aztec Network use this model. The DA layer stores the encrypted data or a commitment, while the ZK-SNARK proof attests to the validity of the state transition without revealing the underlying data. This ensures fundraising round details remain private on-chain, while still allowing for public verification of the rollup's integrity.

Finally, integrate a data retrieval service for your users and applications. Clients need to fetch the published data from Ethereum to compute the latest state. Use an indexer or node service (like an RPC endpoint for your rollup) that monitors the DataSubmitted events, downloads the calldata, decompresses it, and makes it available via API. Tools like The Graph can be used to index this data. Ensure your application's wallet or SDK can connect to this service to synchronize balances and transaction history, completing the loop from data publication on L1 to usability on L2.

testing-and-auditing
STEP 5

Testing, Security, and Auditing

This final step ensures your ZK-rollup for confidential fundraising is robust and secure before mainnet deployment. It focuses on comprehensive testing, security best practices, and professional auditing.

Begin with a comprehensive testing strategy. This includes unit tests for your core smart contracts (like the rollup verifier and confidential token logic), integration tests for the sequencer and prover components, and end-to-end tests that simulate a full fundraising round. Use a local development network like Anvil from Foundry or Hardhat Network to deploy your contracts and test the complete flow—from investor deposit and proof generation to final withdrawal. For ZK-specific testing, you must verify that the zero-knowledge proofs are generated correctly and validated by the on-chain verifier contract. Libraries like circom_tester for Circom circuits or tools from the Noir framework are essential for this phase.

Security is paramount for a system handling private financial data. Implement defense-in-depth measures. On-chain, use OpenZeppelin's security libraries for access control and reentrancy guards. For the off-chain prover and sequencer, enforce strict input validation and sanitization to prevent injection attacks. Since your system's security relies on the integrity of the zero-knowledge proof system, you must protect the trusted setup ceremony (if required by your proving system, like Groth16) and the prover's private keys. All communication between the user's wallet, the prover service, and the sequencer should be encrypted using TLS. Consider using a secure enclave or a hardware security module (HSM) for the prover's operational keys in production.

A professional smart contract audit is non-negotiable before launching a financial application. Engage specialized firms like Trail of Bits, OpenZeppelin, or ConsenSys Diligence who have experience with ZK-rollups and complex state management. Provide auditors with your complete codebase, technical documentation, and a detailed specification of the confidential fundraising logic. Be prepared to address findings related to circuit correctness (e.g., under-constrained signals), verifier contract vulnerabilities, and economic assumptions. Many projects also run a public bug bounty program on platforms like Immunefi after the audit to crowdsource security reviews. Finally, plan for contingencies: have a pause mechanism or upgrade path for your contracts, and clearly document incident response procedures for your team.

ZK-ROLLUP DEVELOPMENT

Frequently Asked Questions

Common technical questions and solutions for developers building confidential fundraising applications using ZK-Rollups.

A ZK-Rollup is a Layer 2 scaling solution that bundles (rolls up) transactions off-chain and submits a single validity proof to the main Ethereum chain. For confidential fundraising, it enables privacy by using zero-knowledge proofs (ZKPs), specifically zk-SNARKs or zk-STARKs, to verify that a transaction is valid without revealing its details (e.g., investor identity, exact contribution amount).

Key Mechanism:

  • User transactions are executed and state updates are computed off-chain.
  • A cryptographic proof (ZK-proof) is generated, attesting to the correctness of these updates.
  • Only this compact proof and minimal data are posted on-chain.
  • The on-chain verifier contract checks the proof, ensuring integrity without exposing private data, making investor participation and deal terms confidential.
conclusion
IMPLEMENTATION SUMMARY

Conclusion and Next Steps

This guide has walked through the core components for building a ZK-rollup tailored for confidential fundraising rounds, from the foundational circuits to the on-chain verifier.

You have now implemented the key technical stack for a confidential fundraising rollup. The system uses a zk-SNARK circuit (e.g., using Circom or Halo2) to prove that a transaction is valid—meaning the investor's balance is sufficient, the new state root is correctly computed, and the investor's identity is part of a verified allowlist—without revealing the investor's address or transaction amount on the base layer. The off-chain prover generates a succinct proof, which is then verified by an on-chain Solidity verifier contract on Ethereum or another L1.

To move from a proof-of-concept to a production-ready system, several critical next steps are required. First, integrate a robust sequencer and data availability layer. You can use a framework like StarkEx, zkSync's ZK Stack, or Polygon CDK to handle batch proof generation, state management, and data publication. Second, implement a secure bridging mechanism for depositing and withdrawing funds between L1 and your rollup, ensuring the bridge contract correctly interacts with your verifier. Third, conduct extensive security audits on both the cryptographic circuits and the smart contract verifier, as vulnerabilities here are catastrophic.

For ongoing development, consider these advanced features to enhance the platform. Implement privacy-preserving analytics using zero-knowledge proofs to allow projects to verify aggregate metrics (e.g., total funds raised, number of unique investors) without leaking individual data. Explore integrating identity attestations from services like Worldcoin or Verite to automate allowlist verification within the circuit. Finally, monitor the evolving landscape of ZK-EVMs (like zkSync Era, Scroll, or Polygon zkEVM) which offer generalized programmability and could simplify the development of complex confidential application logic.

How to Set Up a ZK-Rollup for Private Fundraising | ChainScore Guides