Bitget App
Trade smarter
Buy cryptoMarketsTradeFuturesCopyBotsEarn
In-depth analysis of Merlin Chain's security architecture: Building a secure fortress in the Bitcoin Layer 2 field

In-depth analysis of Merlin Chain's security architecture: Building a secure fortress in the Bitcoin Layer 2 field

BlockBeats-Article2024/04/04 07:26
By:BlockBeats-Article
Original source: Merlin Chain


With the rapid development of the Bitcoin ecosystem and the upcoming halving event, the scalability, efficiency and availability of Bitcoin's second-layer solutions have become a hot topic in the market. Merlin Chain has attracted widespread attention in the Bitcoin Layer2 field with its innovative technical solutions.


Within 30 days of the launch of the Merlin Chain autonomous network, its total locked value reached an astonishing $3.5 billion, attracting more than 200 projects. Ecological projects have led to a large influx of funds and an increase in Bitcoin network transaction volume. How to ensure the security of funds has become the focus of all users; this article explores in depth how Merlin Chain provides on-chain security.

 

Merlin Chain plans to make the Bitcoin network its ultimate settlement layer. In this design, all raw data is stored in the oracle network, while the corresponding state root is stored on the Bitcoin network. Users can retrieve all aggregated transactions on Merlin Chain at any time and verify their authenticity using zero-knowledge proofs (zk proofs) recorded on Bitcoin.


Merlin Chain uses a fraud proof mechanism designed for zero-knowledge proofs to provide final confirmation for Bitcoin. This process is supported by Bitcoin's powerful Proof of Work (POW) algorithm, ensuring the security of Merlin ChainRollup.


In this system, the Bitcoin network not only serves as a strong backing for value storage, but also plays a key role in verifying and ensuring the integrity of Merlin Chain data. Due to the high security and decentralized nature of the Bitcoin network, it provides an additional layer of security for transactions on Merlin Chain. This arrangement ensures that Merlin Chain does not sacrifice security while achieving high efficiency.


By embedding zero-knowledge proofs and state roots into the Bitcoin network, Merlin Chain is able to leverage the security and immutability of Bitcoin, thereby ensuring fast and low-cost transactions while also providing a high degree of security. This combined approach of using Bitcoin as the final audit and verification layer not only enhances on-chain security, but also broadens the application scenarios of Merlin Chain, providing users with a more trusted and secure blockchain environment.


Decentralized Oracle


Merlin Chain uses a decentralized oracle network and second layer (L2) architecture to improve transaction efficiency and ensure security. In this architecture, the sorting node is responsible for collecting and batching transactions, and generating compressed transaction data, ZK state roots, and proofs through zkEVM technology. The oracle network then aggregates this L2 data and uploads it to the taproot of the Bitcoin mainnet, making it publicly accessible to users across the network.


The workflow of Merlin Chain mainly includes: ZK L2 collects and batches transactions, and generates proofs at the same time; aggregating original transaction data, Merkle trees, Bitcoin status and other data Form a joint proof and synchronize with the oracle network. After receiving this L2 data, the oracle network performs circuit compilation to upload the compressed data and commitments to the taproot of the Bitcoin mainnet.


In Merlin Chain, oracle nodes play a vital role. They are not only responsible for verifying zero-knowledge proofs in Merlin Chain, but also for uploading L2 data to the taproot of the Bitcoin mainnet. The specific responsibilities of the oracle node in this process include: compiling L2 data, performing circuit compilation operations, uploading to the Bitcoin main network, batch verification and hash transmission, generating and submitting signatures, and participating in Bitcoin threshold signature verification and ZKP final settlement .


Diversified pledge system


Merlin Chain has introduced a multi-token pledge system. Mechanism to maintain network security, incentivize participants, and ensure decentralization. Users can obtain oracle node qualifications by pledging different encrypted assets, or pledge to existing oracle nodes on behalf of others, thereby participating in the governance and data verification process of Merlin Chain.


The system supports staking BTC, MERL and other mainstream BRC20 assets to meet the needs and risk preferences of different users. The system will dynamically adjust the pledge weight according to the market value and liquidity of each asset, and even small investors may have the opportunity to become an oracle node. In addition, the system will regularly adjust the pledge weight according to the volatility and market performance of the assets to ensure fairness and rationality in reward distribution.


Merlin Chain’s pledge mechanism not only allows users to directly pledge assets to become oracle nodes, but also provides flexible proxy pledge options, allowing users to choose to host assets to An existing and reputable oracle node. Through the proxy staking mechanism, Merlin Chain further enriches its staking system, allowing more users to easily participate in the maintenance and governance of the blockchain.


In order to protect users' pledged assets, the system uses multi-signature and cold storage technology to ensure the security of assets. All staking and reward distribution processes are open and transparent, and users can check their staking status and expected returns at any time. In addition, the use of smart contracts further increases the credibility and automation of the system.


The pledge reward of the oracle node is mainly composed of block rewards and transaction fees. Block rewards are Merl tokens issued at a certain inflation rate, distributed based on the node’s staking weight and network performance. Transaction fees are BTC tokens and are a percentage of each transaction in Merlin Chain. Rewards will be distributed based on the type and amount of pledged assets.


To ensure the fairness of reward distribution, Merlin Chain will adopt a weighted average algorithm based on market value and stake. This algorithm takes into account the market value and liquidity of different assets, as well as the stake of each oracle node, to calculate the rewards that each node should receive.


In addition, Merlin Chain will also use Celestia as a data availability layer to ensure that block data is provably published and anyone can know and store the state of Merlin Chain. The introduction of Celestia makes historical data accessible to anyone so that new Rollup nodes can reconstruct the latest state by replaying historical blocks. Once the data is published on Celestia and ensured to be available, Rollups and applications are responsible for storing their historical data. Specifically, when a node receives a new block added to the chain, it will verify the data availability and try to download all the transaction data of the new block to verify the availability. If the node can download all the transaction data, the data availability is successfully verified, proving that the block data has indeed been published to the network.


Merlin Chain realizes the processing, verification and storage of transactions and data through the collaboration of sorting nodes and oracle networks, and finally completes the settlement and updates the status of L2 chain through ZKP, while taking into account security and decentralization.


On-chain fraud prevention mechanism


Merlin Chain's future upgrade plans include the introduction of a Bitcoin chain fraud proof mechanism to solve the current problem of not being able to directly verify zero-knowledge proofs on the Bitcoin mainnet. Due to the Turing incompleteness of the Bitcoin network, the traditional method of verifying zero-knowledge proofs on a layer of blockchain networks is not feasible for Bitcoin. To address this challenge, Merlin Chain writes the aggregated zero-knowledge proofs and Rollup data to the Bitcoin mainnet by utilizing Taproot, ensuring that the ZK-Rollup data is anchored and tamper-proof on Bitcoin.


Future upgrades will use the Bitcoin chain fraud proof mechanism to ensure the correctness of the data and ZKP submitted by the decentralized oracle network. In this mechanism, nodes in the oracle network must pledge BTC on the Bitcoin network in advance, laying the foundation for the Bitcoin on-chain challenge mechanism. Users can challenge ZK-Rollup based on the compressed transaction data, ZK state root, and ZK proof on the Bitcoin mainnet. If there is an inconsistency between the challenge proof data and the proof, the user can claim the assets pledged in advance on the Bitcoin mainnet, and ZK-Rollup will roll back to the last verified state.


The Bitcoin on-chain fraud proof mechanism adopted by Merlin Chain is different from Optimistic Rollup. The Bitcoin mainnet no longer conducts fraud proofs for the entire transaction volume, but focuses on verifying the security of the ZK state root and ZK proof.


There are two roles in this mechanism: prover and verifier. The prover compiles the program into a huge binary circuit and submits the circuit to the Taproot address of the leaf script with each logic gate. The prover and the verifier pre-sign a series of transactions to enable the challenge-response mechanism between the two. In this form, the decentralized oracle network first publishes and stores all Rollup data off-chain, and only the commitment is stored on the chain.


Any computable function can be expressed as a Boolean circuit, and the NAND gate (not AND gate) is a universal logic gate that can combine any Boolean function. In the script language, the NAND gate is implemented by two BVCs, and a script for verification is shown below.


By combining a series of NAND gates, any circuit can be expressed, each step is submitted under the Taproot leaf node and finally merged to the same Taproot address, allowing the prover to execute any gate in the circuit. To execute a gate, the prover needs to open the corresponding NAND gate and set the input and output bit values. The binary circuit structure off-chain can be very large, but due to the characteristics of Taproot, it occupies very little space on the chain.


Merlin Chain borrows the concept of BitVM, placing the execution of complex programs off-chain and then placing key evidence on the chain. It designs the simplest "circuit unit" and combines these units using the combination power of Taproot to achieve the ability to implement any executable function on the Bitcoin blockchain. Most transactions that occur on the second layer do not need to be re-verified on the BTC chain. However, for any controversial data segment/opcode to be challenged, it must be replayed on the first layer. If the detection conclusion is that the data previously released by the proposer is problematic, the proposer's pledged assets will be slashed; if the challenger is problematic, the challenger's pledged assets will be slashed. If the prover does not respond to the challenge for a long time, he can also be slashed.


Merlin Chain improves the efficiency and usability of Bitcoin Layer2 solutions through its advanced technical architecture and security mechanisms, while ensuring the security of the network and funds. With the implementation of future upgrades, Merlin Chain is expected to further strengthen its leadership in the Bitcoin Layer2 field and provide users with a more secure and efficient blockchain experience.


This article is from a contribution and does not represent the views of BlockBeats.

0

Disclaimer: The content of this article solely reflects the author's opinion and does not represent the platform in any capacity. This article is not intended to serve as a reference for making investment decisions.

PoolX: Locked for new tokens.
APR up to 10%. Always on, always get airdrop.
Lock now!

You may also like

The Daily: Dogecoin investors drop class-action lawsuit against Elon Musk, Michael Saylor plans $100K bitcoin party and more

Dogecoin investors have dropped their class-action lawsuit against Elon Musk, which accused him of manipulating the price of DOGE during its 2021 surge from less than $0.10 to around $0.70.JPMorgan analysts anticipate positive regulatory changes for crypto under President-elect Donald Trump, with clearer frameworks likely to benefit the industry.President-elect Donald Trump nominated bitcoin advocate Robert F. Kennedy Jr. for U.S. Secretary of Health and Human Services on Thursday.The following article is

The Block2024/11/15 20:23

Matrixport Included Developments That Will Affect Bitcoin in December in Its Weekly Report! Here Are the Details

Matrixport's latest weekly report highlights a number of positive factors that have underpinned Bitcoin's recent strong performance.

Bitcoinsistemi2024/11/15 20:00

Trump's Inflow Wave Has Ended! Spot Bitcoin and Ethereum ETFs Experience First Outflows Since Election!

It ended a wave of inflows and outflows in spot Bitcoin and Ethereum ETFs that has been ongoing since Donald Trump was elected president on November 5.

Bitcoinsistemi2024/11/15 19:55

The Scoop: Anti-crypto bias may have cost Democrats the election

A growing base of single-issue crypto voters have become frustrated by Democrats’ general opposition to the industry.This column is adapted from The Scoop newsletter.

The Block2024/11/15 19:22