Intermediate: Bridges, Fraud Proof and Zero Knowledge Proof
What are bridges?
Since the release of Satoshi Nakamoto's Bitcoin whitepaper, the number and scale of different blockchain ecosystems has increased dramatically. As each blockchain/network has its own characteristics (different rules and consensus mechanisms) and is independent of each other, users' demand for transferring assets across chains/networks are also increasing. Therefore, bridges were born. Their main functions are as follows:
To realize cross-chain transfer of assets and information
Facilitate users to take advantage of various blockchains to enter new blockchain ecosystems
Enable developers of different blockchain ecosystems to collaborate and build new platforms for users
According to different connected objects, bridges can be divided into two types:
Layer 1 <> Layer 1 bridge: A bridge that connects two different Layer 1 blockchains;
Layer 1 / Layer 2 <> Layer 2 bridge: A bridge that connects a Layer 1 blockchain to a Layer 2 network or connects two different Layer 2 networks.
The second type of bridge will be focused on below.
There are many Layer 2 projects such as Arbitrum, Optimism and zkSync in the Ethereum ecosystem. Bridges allow users to transfer assets between Layer 1 (Ethereum mainnet) and Layer 2 networks, such as sending ETH from the Ethereum mainnet to Arbitrum; or transfer assets between two different Layer 2 networks, such as sending ETH from Arbitrum to Optimism.
Asset transfer through this type of bridge is typically achieved in three ways：
Lock and mint: Asset transfer is realized by locking assets on the source chain and minting assets on the target chain. Projects using this scheme are Optimism Gateway and Arbitrum Bridge.
Burn and mint: Asset transfer is realized by burning assets on the source chain and minting assets on the target chain. Projects using this scheme are Hop Protocol and Across Protocol.
Atomic swap: With smart contracts and algorithms, intermediaries are eliminated and assets on the source chain are converted directly to assets on the target chain. Projects using this scheme include cBridge and Connext's NXTP.
Bridges based on different implementations have their advantages and disadvantages, and in the actual operation process, trade-offs need to be made for specific use cases. Overall, these three types of bridges make it easier to move money between Layer 1 / Layer 2 <> Layer 2 and facilitate the development of the Layer 2 ecosystem.
Introduction to blockchain bridges: How to break the trust boundary in the crypto world?
What is Fraud Proof?
Fraud proof is a way of validating data published by Optimistic Rollups. During the synchronization of data from Layer 2 networks to the Ethereum mainnet, one can initiate a challenge in the challenge period if he thinks the data is not correct, or there is fraud. After that, calculation will be done by Layer1 smart contracts to decide who is fraudulent to be penalized.
Currently, fraud proof can be categorized into single-round interactive proving and multi-round interactive proving.
Single-Round Interactive Proving
Single-round interactive proving is to replay the disputed transactions on Layer 1 to detect whether there is an invalid state or not before those transactions are submitted to the mainnet.
For example, as a validator, Alice synchronizes the data compressed by Rollup to Layer 1 while staking her bond. Bob needs to initiate a challenge during the challenge period by staking his bond if he thinks the data is disputable. In this case, the rollup protocol will recompute the disputed transaction on Layer1 to determine who wins the challenge. In the end, the winner will be rewarded while the loser’s bond will be slashed.
However, due to relatively high on-chain computing costs, this proving method may be limited to the Layer1 block size if there is an excessive amount of transaction data to be recomputed.
Multi-Round Interactive Proving
Under such a proving method, Alice needs to divide her synchronized data regarded as disputable by Bob into two equal halves. Bob, as a challenger, will then choose the half he wants to challenge. The half will be divided into another two equal halves by Alice. This process will repeat until both parties are disputing a single step of execution. At this point, the Layer1 smart contract will catch the fraudulent party through computation.
Therefore, compared with single-round interactive proving, multi-round interactive proving is a more cost-effective way to resolve disputes. Also, it is more applicable for complex smart contracts and disputes with higher requirements.
Nevertheless, for multi-round interactive proving, its challenge period may be longer as the number of interactions grows.
What is Zero Knowledge Proof?
In 1985, Zero Knowledge Proof was invented by MIT researchers Shafi Goldwasser, Silvio Micali, and Charles Rackoff in their paper The Knowledge Complexity of Interactive Proof Systems.
Zero Knowledge Proof refers to a method by which one party (the prover) can prove to another party (the verifier) that something is true, without revealing any information apart from the fact that this specific statement is true.
To make that possible, zero-knowledge protocols rely on algorithms that take some data as input and return ‘true’ or ‘false’ as output.
A Zero Knowledge protocol must satisfy the following three criteria:
Completeness: If the input is valid, the zero-knowledge protocol always returns ‘true’. Hence, an honest prover can convince an honest verifier.
Soundness: If the input is invalid, the zero-knowledge protocol cannot return ‘true’. Hence, it’s impossible for a malicious prover to trick an honest verifier into believing an invalid statement is valid.
Zero Knowledge: The verifier learns nothing about a statement beyond its validity or falsity
Two common types of Zero-Knowledge Proof:
ZK-SNARKs, an acronym for Zero-Knowledge Succinct Non-Interactive Argument of Knowledge.
ZK-STARK, an acronym for Zero-Knowledge Scalable Transparent Argument of Knowledge.
Please check out the link below if you want to know more about Zero Knowledge Proof and the difference between ZK-SNARKs and ZK-STARKs.)