What is Citrea? Understanding Bitcoin's First ZK-Rollup Solution
November 20, 2024
Scaling Bitcoin has traditionally relied on Layer 2 solutions that move demand for blockspace off-chain. Citrea is here to change that by pioneering an alternative approach that expands the capabilities of blockspace without going off-chain, thanks to the emergence of zero-knowledge proof technology.
The introduction of zero-knowledge (ZK) rollups on Bitcoin provides an opportunity to scale the largest blockchain in a way that inherits the core values of decentralization without compromising on security and scalability.
Read on to learn about Citrea and how this new scaling solution can enhance Bitcoin.
What is Citrea?
Citrea describes itself as the world’s first rollup for Bitcoin that implements zero-knowledge technology to achieve greater expressivity and utility of the network, thereby laying down the network’s foundation for decentralized financial (DeFi) services.
By introducing zk-Ethereum Virtual Machine (EVM) to the scaling network, the Layer 2 solution ensures demand, data availability, and settlement remain within Bitcoin’s base layer by batching numerous transactions and processing them using zkEVM to generate validity and prove accuracy.
zkEVM is Citrea’s equivalent of the Ethereum Virtual Machine, which helps in enhancing programmability of the Bitcoin network by introducing complex smart contracts that allow developers to execute decentralized applications.
At the same time, Citrea also integrates its Bitcoin Virtual Machine (BitVM) technology and the BitVM environment to help extend the network’s capabilities to support the execution of complex smart contracts.
Before we dive into the technology behind Citrea and how it operates, let’s understand ZK-rollups and how they function.
What Are ZK-Rollups?
ZK-rollups are Layer 2 scaling solutions that operate on top of an existing blockchain (often a Layer 1) to facilitate high-speed transactions and enable low transaction fees on the main chain.
Their biggest role is increasing the transaction throughput and scalability of blockchain networks without compromising on security and decentralization.
How Do ZK-Rollups Function?
Zk-rollups work by aggregating multiple transactions into a single batch. This aggregation reduces the individual transaction data that needs to be processed and verified by the main blockchain, thus reducing the on-chain congestion and increasing the throughput.
The term “zero-knowledge” refers to the ability of one party to provide proof to another party that a given statement is true without revealing any information apart from the fact that the statement is indeed true.
Integration of ZK-Rollups in Citrea
Citrea uses ZK-rollups to enhance the performance of the blockchain. Let’s look at how it achieves this.
Off-Chain Transaction Processing
These rollups allow Citrea to process transactions off-chain more efficiently while upholding Bitcoin’s principles for tamper-resistance, security, and scalability.
By integrating ZK-rollups, Citrea extends Bitcoin to support complex smart contracts, an attribute that has traditionally been impossible on the base layer.
Integration of zkEVMs for Ethereum-Compatible Smart Contracts
Citrea deploys multiple transactions in batches using the zkEVM and then submits them to the main chain for verification and settlement.
ZK-rollups manage increasing transaction loads by off-chain computation and state storage while ensuring that the state changes (e.g., change in account balance of a user) are valid and secure.
Integrating ZK-rollups with Citrea, its Layer 2 solution, broadens the scope of Bitcoin beyond its intrinsic traits of just being a store of value. These rollups help Bitcoin to transform into a modern-day blockchain, one that is capable of supporting NFTs, GameFi, DeFi and more.
How Does Citrea Work?
As a Layer 2 solution Citrea is the first of its kind in introducing ZK-rollups to Bitcoin blockchain. The developers claim that this solution allows for the construction of virtually anything on this blockchain.
Citrea intends to finalize transactions on Bitcoin using Bitcoin Virtual Machine (BitVM). BitVM is a computational engine currently under development that aims to assist in running more complex smart contracts on the Bitcoin network.
Citrea draws all necessary transaction data from the Bitcoin blockchain to operate the rollup. To understand the process better, we have broken it down into 3 phases:
- The peg-in process
- Transaction lifecycle
- The peg-out process
Peg-In Process
The peg-in phase begins upon initiation of a transaction
Step 1: Initiation
Users start by locking their Bitcoin (BTC) into a smart contract on Bitcoin’s blockchain. This action marks the transition of BTC from the main chain (Layer 1) to Citrea’s Layer 2 environment.
Step 2: Verification
This locked transaction is verified by Bitcoin’s full nodes, ensuring it adheres to network protocols and is securely included in the blockchain.
Step 3: Token Minting
Once verified, an equivalent amount of Citrea’s native tokens (cBTC) is minted on the Citrea platform. These tokens represent the locked BTC and can be used within the Citrea ecosystem to engage in various transactions and smart contracts.
Here, Citrea uses SPVs (Simple Payment Verification) nodes, which allow users to verify transactions without downloading the entire blockchain. SPVs speed up the peg-in process with quick verification that the Bitcoin locked in the smart contract has been successfully transitioned to Citrea’s Layer 2. These verifications are anchored using Merkle roots.
Transaction Lifecycle
This phase explains the technical side of transactions taking place on Citrea.
Step 1: Transaction Processing
Users utilize their cBTC for transactions, which could range from simple transfers to more complex interactions involving smart contracts.
Citrea uses a zero-knowledge Ethereum zkEVM to process these transactions. The ZkEVM is compatible with Ethereum’s EVM, allowing developers to deploy and execute Ethereum-based smart contracts on Citrea.
Step 2: Batch Processing and Proof Generation with ZK-Rollups
Transactions are batched together for efficiency. A ZK-rollup process bundles numerous transactions into a single package. This reduces the overall data to be processed and verified back to the Bitcoin blockchain.
- Provers: In Citrea, provers generate zero-knowledge proofs (ZKPs) for transaction batches, ensuring transaction accuracy without revealing details.
- Sequencers: Sequencers determine the order of transactions in each batch, organizing and managing them for efficient processing and minimizing conflicts.
- Operators: Operators run the infrastructure that handles transaction processing on Citrea’s Layer 2. They manage the interaction between the Layer 2 solution and the base layer, Bitcoin, ensuring smooth operation.
Step 3: Submission to Settlement Layer or Layer 1
The ZKPs, along with a summary of the batched transactions, are submitted back to Bitcoin’s Layer 1 for final verification and recording. This step leverages the security of Bitcoin’s blockchain to finalize and secure Citrea transactions.
During this process, data availability is important for verifying transactions and making sure that they are accessible to the network participants. In Citrea, state roots or Merkle roots are used to summarize and secure the transaction data. This helps provide an immutable record that guarantees validation despite the failure of some nodes.
Peg-Out Process
This phase begins when the user requests a withdrawal.
Step 1: Initiation of Withdrawal
When users decide to convert their cBTC back to BTC and exit Citrea, they initiate a peg-out process. This involves burning their cBTC on Citrea’s Layer 2.
Step 2: Proof of Burn
A zero-knowledge proof confirming the burn of cBTC is generated. This proof is crucial as it verifies that the tokens have been irrevocably destroyed, preventing double-spending or any fraudulent reclaim of the locked BTC.
Step 3: Verification and BTC Release
This proof is submitted to Bitcoin’s blockchain. Once verified, typically by mechanisms like BitVM (if operational) or through traditional Bitcoin network consensus, the locked BTC is released from the smart contract and returned to the user’s Bitcoin wallet.
What Impact Does Citrea Have on the Bitcoin Ecosystem?
The potential impact of Citrea on the Bitcoin ecosystem could be multifaceted. If successful, it would touch on aspects of scalability, functionality, security, and the overall future potential of Bitcoin as a versatile blockchain platform.
Scalability and Transaction Throughput
Citrea batches multiple transactions off-chain, which reduces congestion on Bitcoin and speeds up the processing time, thereby allowing more users to transact efficiently without burdening the main chain.
Smart Contracts on Bitcoin
By bringing EVM-equivalent smart contracts to Bitcoin, developers can now build dApps on the network, which lets them add more functionality to the largest decentralized network beyond being a store of value.
Security and Privacy
Citrea uses ZKPs to validate transactions. It keeps transaction details private. Bitcoin, as the base layer, handles the final settlement. Users benefit from enhanced privacy without sacrificing security.
Preservation of Bitcoin’s Core Principles
Citrea’s BitVM, currently under development and testing, acts as a watchdog for ensuring all transactions on the Layer 2 chain and smart contracts follow the rules of the Bitcoin blockchain. BitVM – in theory – would do this by continuously validating transactions against Bitcoin’s consensus rules before they are finalized on the main chain.
The Takeaway
Citrea represents a major technological leap for the Bitcoin ecosystem by bridging the gap between scalability and security through Bitcoin’s first-ever integration with ZK-rollups.
While Citrea is one of the newest entrants to the competitive Bitcoin Layer 2 space, it’s arguably a very interesting one to follow due to its use of ZK-rollups to help scale Bitcoin and provide new use cases to the ecosystem.