Life Cycle of a Citrea Transaction

Life Cycle of a Citrea Transaction

Citrea is the first rollup that enhances the capabilities of Bitcoin blockspace with zero-knowledge technology. Citrea keeps the demand for Bitcoin within its network by utilizing Bitcoin Network as a data availability and settlement layer for Citrea transactions.

Citrea brings programmability to Bitcoin through Ethereum Virtual Machine (EVM). Citrea’s EVM is zero-knowledge provable and customized for Bitcoin and BitVM. This execution environment allows users to deploy complex smart contracts beyond the capabilities of Bitcoin Script. Citrea scales Bitcoin by rolling-up thousands of transactions and producing a succinct validity proof. Citrea proofs are inscribed in Bitcoin and can be optimistically verified on Bitcoin via BitVM. This model ensures on-chain data availability and verifiability. 

For those who are interested in transacting with Bitcoin security, let’s dive into how this works out.

User deposits - Welcome to Citrea

User deposits BTC to Citrea

The peg-in process begins when a user sends BTC to the bridge operator. Verifiers, the actors empowered to challenge bridge operators, then sign the user’s transaction. This signature is submitted to the bridge operator, indicating the verifiers' approval of the BTC deposit. With this verification step complete, users can mint cBTC (citreaBTC) in exchange for the BTC sent to the BitVM controlled deposit address by sending the SPV (Simplified Payment Verification) of the transaction to a smart contract on Citrea.

Alternatively, users can enter Citrea via atomic swaps from Bitcoin or Lightning Network, making it way easier and cheaper than depositing through two-way peg.

You are in! Enjoy your time in Citrea

User sends a transaction in Citrea

Citrea’s EVM environment can provide applications such as DeFi with BTC, private transfers or swaps with BTC. Whichever app the users are engaging with, the technical process begins with users sending transactions to a full node. Upon receiving these transactions, the full node sends them to a sequencer for soft confirmations. Anyone who wants to access Citrea's transaction history or wants to query data can set up a Citrea full node.

A sequencer is a type of full node that soft-confirms the transactions and builds blocks. It then propagates these soft confirmations, soft blocks, to every full node available. The purpose of soft-confirmations is to provide users with fast transaction experience. The next step involves a special type of full node that is used for zero-knowledge rollups. This full node is called Prover and has an important role in inheriting Bitcoin security for user's transactions.

A prover, as all full-nodes do, receives the soft confirmations from the sequencer and keeps the data. What makes a prover special is that it creates a batch by roll-ing up the transactions that the sequencer has soft confirmed.  

Then, it generates a zero knowledge proof of this batch for anyone to verify its validity. The prover does not only generate the proof but also creates a data called state difference - which is the storage slots difference between the initial and latest state. Creating state differences is what makes Citrea’s Bitcoin blockspace usage efficient. Since Bitcoin blockspace is limited and expensive, Citrea inscribes state differences instead of full transactional data to minimize blockspace usage and the data cost. 

There is one caveat; proof producing is not instant. There is a cost to proving. The more transactions the batch contains, the cheaper each transaction data becomes. Therefore, the prover collects the transactions until the cost of creating the zero-knowledge proof of the batch reaches an optimal cost. To ensure that no one can alter the ordering while validity proof is being generated, the sequencer inscribes the Merkle root of the batch to Bitcoin every 10 minutes. The prover makes sure that the zero knowledge proof is generated based on the ordering submitted to Bitcoin.

User leaves - Hope to see you again!

User withdraws BTC from Citrea

To peg out, users can either submit a withdrawal transaction to Citrea full nodes or inscribe it to Bitcoin as a forced transaction. In both cases, the bridge operator covers the user's peg out and later claims the withdrawals it front covered from BitVM. 

Citrea bridge utilizes BitVM to settle on Bitcoin. BitVM is a computing paradigm that enables turing-complete contracts on Bitcoin. A computation on BitVM is considered correct as long as no one challenges it, making BitVM optimistic. Citrea uses BitVM to verify zero-knowledge proofs inscribed on Bitcoin. Out of N verifiers, 1 honest verifier is enough to protect two-way peg mechanism, making Citrea trust-minimized. 

Alternatively, users can exit via atomic swaps to Bitcoin or Lightning Network, making it way easier and cheaper than leaving using two-way peg.

Conclusion

Bitcoin, the most decentralized, censorship resistant and crypto-economically secure blockchain, is the future of finance. To establish Bitcoin as the foundation for the world’s finance, Bitcoin blockspace must be enhanced to include more transactions and offer more expressivity and features without changing its consensus rules. By generating succinct validity proofs and utilizing BitVM, Citrea is the only layer 2 that uses Bitcoin blockchain as the verification layer. With EVM as the execution environment, Citrea can provide applications such as DeFi with BTC, private transfers or swaps with BTC. 

Join the community and follow us on X to be an early adopter. You don’t want to miss any updates from Citrea!