Merlin Chain 백서

Merlin Chain

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 8쪽 중 5쪽

ck reaches 100% capacity, this parameter determines transaction priority, the same as before EIP-1559. Consider changing to a `gasPrice` value when `maxFeePerGas` and `maxPriorityFeePerGas` were used. ### Sending Native Token (transfer, send, call) There's no difference between Ethereum and Merlin sending native token(ETH in Ethereum or BTC in Merlin). However we strongly recommend not using some methods supported. You can send native token to others by * `transfer` (2300 gas, throws error) * `send` (2300 gas, returns bool) * `call` (forward all gas or set gas, returns bool) `call` in combination with re-entrancy guard is the only recommended method to use.&#x20; Though supported, `transfer` and `send` are not recommended to use. 2300 gas will cause serious problems like [upgradeable contract cannot be receiver](https://forum.openzeppelin.com/t/openzeppelin-upgradeable-contracts-affected-by-istanbul-hardfork/1616). # Maintenance & Upgrade Guidelines # erigon-rpc: v2.0.2 to v2.0.3 ### Mainnet Maintenance & Upgrade Notice > MerlinChain will begin a mainnet service upgrade on January 20, 2026 at 15:00 UTC. > > During this maintenance window, the cdk-erigon-rpc component will be upgraded to version v2.0.3, with the goal of improving overall system stability and performance. > > * Upgrade Start Time: UTC: 2026-01-20 15:00 > * Estimated Duration: 48–72 hours > * Impact: Mainnet RPC and related services may experience intermittent availability > * Deposit and withdrawal functions related to Merlin Chain should be temporarily disabled by all CEXs prior to the upgrade to prevent potential transaction anomalies or asset risks. ### Release Notes * <https://github.com/MerlinLayer2/cdk-erigon/releases/tag/v2.0.3> ### Upgrade Guideline * Update docker image version to v2.0.3 in docker compose file * ```yml image: merlinadmin/cdk-erigon:v2.0.3 ``` * Rebuild container * ```shellscript docker compose pull docker compose up -d --force-recreate ``` # User Quick Start Welcome to the User Quick Start guide for Merlin Chain! This document is designed to help you efficiently get started with the [**important concepts**](/merlin-docs/user-quick-start/important-concepts) **and core operations** on Merlin Chain. Our focus will be on the essential "How to" steps, enabling you to navigate and utilize the Merlin Chain with ease.&#x20; ## How to The core of this guide focuses on the practical steps you need to take to start using Merlin Chain effectively. Here are the key activities you will learn about: * [**Wallet**](/merlin-docs/user-quick-start/how-to/wallet): Setting up and managing your AA Wallet to interact with Merlin Chain. * [**MERL**](/merlin-docs/user-quick-start/how-to/merl): Acquiring and utilizing the native token of Merlin Chain, MERL. * [**M-Token**](/merlin-docs/user-quick-start/how-to/m-token): Understanding and managing various tokens within the Merlin Chain ecosystem. * [**Staking and Unstaking**](/merlin-docs/user-quick-start/how-to/staking-and-unstaking): How to participate in staking activities to earn rewards and how to unstake when necessary. * [**Bridge**](/merlin-docs/user-quick-start/how-to/bridge): Utilizing the bridge functionality to transfer assets between Merlin Chain and other blockchain networks. These sections will provide you with detailed, step-by-step instructions to ensure you can perform these operations confidently. #### Step-by-step Video Tutorial For a visual walkthrough, please check out our comprehensive [YouTube Tutorial](https://www.youtube.com/watch?v=IOI4KtKMvio\&list=PLo35i7l--xz-PeaQ0y3mthr9g8ivRDj2M\&index=2) that complements this written guide. The tutorial will guide you through the setup and usage processes, making it even easier to get started. # Important Concepts This section contains important concepts related to Merlin Chain that users, especially beginners, need to understand. <table><thead><tr><th width="143">Concepts</th><th>Resource</th></tr></thead><tbody><tr><td>BTC Layer2</td><td><a data-mention href="/merlin-docs/user-quick-start/important-concepts/btc-layer2">BTC Layer2</a></td></tr><tr><td>UTXO</td><td><a data-mention href="/merlin-docs/user-quick-start/important-concepts/utxo">UTXO</a></td></tr><tr><td>M-Point</td><td><a data-mention href="/merlin-docs/user-quick-start/how-to/staking-and-unstaking/staking-merlins-seal-already-concluded/m-points-rewards-and-team-rules">M-Points Rewards and Team Rules</a></td></tr><tr><td>AA Wallet</td><td><a data-mention href="/merlin-docs/user-quick-start/important-concepts/aa-wallet">AA Wallet</a></td></tr><tr><td>M-Token</td><td><a data-mention href="/merlin-docs/user-quick-start/how-to/m-token">M-Token</a></td></tr><tr><td>Merlin_BTC</td><td><a data-mention href="/merlin-docs/user-quick-start/important-concepts/merlin_btc">Merlin_BTC</a></td></tr><tr><td>MERL</td><td><a href="/merlin-docs/about-merlin/tokenomics">Tokenomics</a> and <a href="/merlin-docs/user-quick-start/how-to/merl">Related Operations</a></td></tr></tbody></table> # BTC Layer2 ## Why BTC Network Need Layer2? Blockchain, often described as a "world computer," boasts key attributes like transparency, decentralization, security, computational power, performance, storage, and privacy protection. Users typically perceive these attributes through the network's computational power and performance, commonly measured by Turing completeness and transactions per second (TPS). However, Bitcoin stands apart because Satoshi Nakamoto deliberately designed it to be Turing incomplete, prioritizing network stability and security. Moreover, certain instruction sets were intentionally removed during its development. As a result, the Bitcoin network cannot deploy smart contracts and struggles with efficiently handling large volumes of transactions. This is due to the need to balance decentralization, security, and scalability, as well as the pressing need to overcome the limitations imposed by Turing incompleteness to facilitate broader ecosystem development. Given that the Ethereum Layer2 landscape has already matured, future market solutions aimed at enhancing blockchain system capacity, reducing costs, and providing custom features are collectively referred to as Layer2. However, because the Bitcoin network cannot run smart contracts, all existing Bitcoin Layer 2 solutions fundamentally differ from those of Ethereum Layer 2. ## What is Side Chain? > I think the term "Layer 2" is more of a branding term for various projects, but essentially, we are a side chain, aiming to add smart contracts to Bitcoin assets. —— Jeff, Founder of Merlin Chain A sidechain is essentially an independent public blockchain designed to enable asset transfers between itself and the Bitcoin network. It features its own unique accounting methods, consensus mechanisms, and support for smart contracts and scripts, all while connecting to the Bitcoin mainnet through specific cross-chain technologies. Since the Bitcoin was not designed to support smart contracts, sidechains provide a way to achieve smart contract compatibility. This allows developers to build applications independently without leaving the Bitcoin ecosystem, thereby enhancing scalability and composability. To address the critical congestion issues of the Bitcoin network, sidechains use customized consensus mechanisms and block generation times to improve transaction confirmation speeds. Merlin Chain, fundamentally a sidechain anchored to Bitcoin Layer 1 (L1), facilitates asset interaction with L1 through an official bridge. It periodically submits transaction records back to L1, leveraging the inherent security features of the Bitcoin network to enhance its own security. # UTXO ## What is UTXO? As one of the earliest cryptocurrencies to emerge, Bitcoin adopted the UTXO model as its underlying storage data structure. Unspent Transaction Outputs (UTXOs) represent specific amounts of Bitcoin that you have received but have not yet spent. Think of each UTXO as a distinct bill in your wallet, each with its own unique value. As implied by its name, a UTXO is an output from a Bitcoin transaction. It remains a UTXO until it is used as an input for a subsequent transaction. When you receive Bitcoin, what you are actually receiving is a UTXO. The balance displayed in your wallet is the sum of all UTXOs you have received. <figure><img src="https://4229568706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuWoxXnGgpNfN7RzTGB3%2Fuploads%2FO4zfeDALQuWVfRyQUt0p%2F%E6%88%AA%E5%B1%8F2024-06-25%2015.10.35.png?alt=media&amp;token=7d83e479-a0da-402a-942b-71158e3aa764" alt=""><figcaption></figcaption></figure> The UTXO set encompasses all UTXOs present on the Bitcoin blockchain at any given time. Bitcoin nodes maintain this set to verify the existence and ownership of coins, thus helping to prevent double-spending, an issue that had undermined earlier efforts to create a decentralized digital currency. ## How does UTXO work between transactions? Transactions based on the UTXO model consist of two parts: inputs and outputs. When a user initiates a new transaction, their wallet selects sufficient UTXOs to cover the required amount. In every valid transaction, the sum of all input values must be greater than the sum of all output values. The difference between these sums represents the transaction fee: $$ \sum\_{\text{inputs}} \text{value} = \sum\_{\text{outputs}} \text{value} + \text{fee} $$ Similar to cash payments, a person can't pay someone $5 by tearing a $10 bill in half. Instead, they must use the $10 bill and receive the change. UTXOs function similarly; they must be spent in their entirety, and any Change is given back as a new UTXO. $$ \text{Change} = \sum\_{\text{inputs}}\text{value} -\text{Price} - \text{fee} $$ ## User Concerns: Transaction Fees Transaction fees are a significant concern for BTC users during transactions. It's common to hear complaints within the community about small transactions necessitating additional fees, sometimes consuming up to 80% of the transaction amount. As mentioned earlier, the number of UTXOs involved in a transaction determines the transaction cost for the user. $$ \text{Transaction size} = \text{input count} \times \text{input size} + \ \text{output count} \times \text{output size} + 10 $$ Where: * **Transaction size:** influenced by the number of input UTXOs being spent and the number of output UTXOs being created in that transaction. * **Input & Output size:** varies depending on the type of Bitcoin address used. The total fee for a transaction is determined by multiplying the transaction size by the selected fee rate. $$ \text{Total fee} = \text{Transaction size} \times \text{Fee rate} $$ Where: * **Fee rate:** measured in Satoshis per virtual byte (Sat/vByte), which depends on the current fee market. In a UTXO-based blockchain network, consolidating multiple UTXOs into a single UTXO is a common practice, in addition to making change. In the Bitcoin network, each UTXO is roughly the same size regardless of the amount of money it holds. Therefore, large transactions often require multiple UTXOs as inputs, which significantly increases the transaction's miner fees. # AA Wallet ## Basic Concepts of Wallet ### Categories Generally, wallets can be roughly divided into 2 categories: * Externally Owned Accounts(EOAs), such as MetaMask * Contract Accounts (CAs), such as Safe The main difference between EOAs and contract wallets lies in their control mechanisms. EOAs are controlled by individual users through private keys, whereas contract wallets are controlled by smart contracts. While EOAs are simpler and used for managing individual cryptocurrency holdings, contract wallets can have more complex rules and be used for specific purposes. ### Pain Points EOA wallet users need to be careful to protect their private keys. Any mistakes or negligence regarding the private key can lead to the loss of funds, making the use of EOA wallets relatively high-cost and high-risk. Additionally, complicated operations, the inability to bypass gas fees or perform gas fee delegation, and limited wallet functionality are all issues that trouble users. Smart contract wallets provide solutions to some of these problems, but currently, all operations are required to be packaged in transactions from an EOA protected by ECDSA. This results in additional transaction fees and the consumption of an extra 21,000 gas, along with potential centralization risks and complex operations. These pain points have led to the emergence of the new AA standard — [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337). ## What is AA Wallet? **AA Wallets (Account Abstraction) based on ERC-4337**, combines the advantages of existing CA and EOA, making the account itself "programmable.” While ensuring that assets are held only by smart contracts, it allows for more customization and extended functionalities, such as * **Gas Abstraction:** Gas abstraction includes transactions without gas fees and the ability to pay gas fees using any ERC20 token. This logic can be executed in a Paymaster contract or through relayers. For AA, many smart contract wallets themselves can implement Paymaster contracts compatible with EIP-4337 and stake tokens on the entry point contract to help users pay gas fees. * **Social Recovery:** In case of lost or compromised private keys, users can authorize new keys as legitimate wallet owners. The logic for social login and social recovery is typically defined in the wallet's main contract. Various methods can be used, such as email, multi-signature, MPC, etc.. * **Transaction Batching:** Transaction batching is a unique feature of CAs, allowing wallet users to execute multiple transactions in a single on-chain transaction. * **Cross-chain Bridging and Bridge Integration:** Currently, many wallets collaborate with third-party providers to integrate fiat payment and cross-chain bridging into the wallet. These fiat ramps and cross-chain bridges can further integrate with payment contracts (Paymasters) in gas abstraction. * **Modular Design:** One of the advantages of AA may be its modular services, where Bundlers, Paymasters, and other components can be flexibly combined. ## [Particle Network](https://particle.network/): AA Wallet on Merlin Chain Merlin Chain is an EVM-compatible BTC Layer2 network, and the assets of most BTC ecosystem users are typically stored in BTC wallets such as UniSat, XVerse, OKX, etc. Therefore, if there is a need to connect to these wallets, it requires corresponding wallet adaptation and abstraction. Merlin Chain collaborated with Particle Network, using its AA wallets to simplify operations during bridging in and out. ### How does Particle Operate? 1. When users initiate transactions with a BTC wallet address, the BTC wallet must first use the SDK provided by the Particle Network to generate the EVM CM corresponding to the Layer1 address, and the AA address initiates a transaction in the EVM environment, requesting a response from the Merlin Chain interface. 2. When users first use Merlin Chain for bridging operations, they need to pre-deposit a portion of their Bitcoin Layer1 assets into the Particle AA wallet address, thereby using its Paymaster function and executing subsequent transaction delegations, gas deductions, and other operations. 3. After the AA address is generated, the Particle Network will work in coordination with Merlin Chain, i.e., when Merlin Chain receives a new transaction request, the AA will call the contract to verify the signature and complete the transaction. ### User Guide Using the Particle AA Wallet on Merlin Chain: 1. Navigate to Merlin Chain Bridge <figure><img src="https://4229568706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuWoxXnGgpNfN7RzTGB3%2Fuploads%2F4pAUFGH1Y4LJnDuG2O27%2FUntitled%20(7).png?alt=media&amp;token=fbdda024-08dc-4320-8acb-8d254d49bebd" alt=""><figcaption></figcaption></figure> 2. Connect Your Wallet <figure><img src="https://4229568706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuWoxXnGgpNfN7RzTGB3%2Fuploads%2Fc767alpUlCASBBpw5JcF%2FUntitled%20(8).png?alt=media&amp;token=4bb4d091-b9dc-499e-b3d4-96a68ff883f1" alt=""><figcaption></figcaption></figure> # Merlin\_BTC ## Introduction to Merlin\_BTC Merlin\_BTC is a tokenized representation of Bitcoin (BTC) on the Merlin Chain, a blockchain network designed for interoperability and enhanced functionality. This allows users to leverage the value of their BTC within the Merlin ecosystem while still maintaining a link to the original Bitcoin blockchain. ## **How to Obtain Merlin\_BTC** To obtain Merlin\_BTC, please follow the steps here 👉 [Merlin\_BTC](/merlin-docs/user-quick-start/how-to/gas/merlin_btc). # How to This section covers the basic operations related to Merlin Chain, specifically involving the following areas: * [Wallet](/merlin-docs/user-quick-start/how-to/wallet) * [MERL](/merlin-docs/user-quick-start/how-to/merl) * [M-Token](/merlin-docs/user-quick-start/how-to/m-token) * [Staking and Unstaking](/merlin-docs/user-quick-start/how-to/staking-and-unstaking) * [Merlin Phantom](https://app.gitbook.com/o/3rrPU5hB8eo4QNhDSCs0/s/XuWoxXnGgpNfN7RzTGB3/~/changes/60/user-quick-start/how-to/merlin-phantom) # Wallet Currently, we recommend using the ***OKX, MetaMask, UniSat*** ***and XVerse*** wallets. ## OKX Wallet 1. **Setup Guide**: The OKX Wallet can be set up using either the browser extension or the mobile/web app. * **Browser Extension**: * Download the OKX Wallet extension from the Chrome Web Store. * Create a new wallet or import an existing wallet using seed words. * Create a password and record your seed phrase. * Transfer funds to your wallet. * **Mobile/Web App**: * Download the OKX mobile/web app. * Create a new wallet or import an existing wallet using seed words. * Create a password and record your seed phrase. * Transfer funds to your wallet. * For detailed steps, visit the [OKX Wallet Guide](https://www.okx.com/help/what-is-okx-web3-wallet). ## MetaMask Wallet 1. **Setup Guide**: MetaMask is available as a browser extension and a mobile app. * **Browser Extension**: * Download the MetaMask extension for Chrome, Firefox, or Brave. * Create a new wallet or import an existing wallet using the seed phrase. * Set up a strong password and back up your seed phrase securely. * **Mobile App**: * Download the MetaMask app from the iOS App Store or Google Play Store. * Create a new wallet or import an existing wallet using the seed phrase. * Set up a password and back up your seed phrase securely. * For detailed instructions, visit the [MetaMask Support Center](https://docs.metamask.io/wallet/). ## UniSat Wallet 1. **Setup Guide**: UniSat is a web-based Bitcoin wallet. * **Creating a Wallet**: * Visit the UniSat website. * Click on "Create Wallet" and follow the prompts to generate a new wallet. * Record the seed phrase provided and secure it safely. * **Managing the Wallet**: * Use the wallet interface to manage your Bitcoin, including sending and receiving BTC. * For more information, visit the [UniSat Wallet Guide](https://docs.unisat.io/knowledge-base/unisat-wallet-faq). ## XVerse Wallet 1. **Setup Guide:** XVerse is a web-based Bitcoin wallet designed for seamless transactions and user-friendly management. * **Creating a Wallet:** * Visit the XVerse website. * Click on "Create Wallet" and follow the prompts to generate a new wallet. * Scure the seed phrase provided safely. 2. **Special Cases of BTC Accounts Connected to the Website via Xverse** When a user connects their BTC wallet to Merlin Chain via Xverse (after a successful connection), and later imports this BTC account into UniSat and connects via a Taproot address, the receiving address will differ during their bridging in and out.&#x20; * All **BTC / Ordinals*
프로젝트로 돌아가기