Mantle 백서

Mantle

원문

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

nsactions (or an entire block if necessary) to check their validity. If confirmed to be invalid, the batch submitter (the *Sequencer*) gets their stake (deposited as bond at the time of batch submission) slashed, setting a disincentive in place to discourage invalid submissions. **For more details, we recommend reading:**&#x20; * [Introduction to Optimistic Rollups](https://medium.com/privacy-scaling-explorations/an-introduction-to-optimisms-optimistic-rollup-8450f22629e8) - Optimism * [An Incomplete Guide to Rollups](https://vitalik.ca/general/2021/01/05/rollup.html) - Vitalik Buterin # Modular Blockchain Taking a modular chain approach to offer hyper-scaled transaction throughput {% hint style="danger" %} Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)! {% endhint %} ## Existing systems Traditional Optimistic Rollups (ORs) rely on Ethereum for data availability, final settlement, and as an execution layer for fraud proofs. To get a clearer idea on why we built Mantle network with a modular architecture, let's talk about the standard operations of a traditional OR. A typical OR can be thought of as a blockchain that processes L2 transactions on a separate execution layer, but ultimately relies on Ethereum for final settlement. In order to maintain Ethereum-level security, an OR must also use Ethereum for data availability and as an execution layer for fraud proofs. This design improves Ethereum's scaling, but also introduces several downsides: 1. L2 users are exposed to expensive fees because the OR posts transaction data to Ethereum 2. Using Ethereum as a data availability layer constrains throughput for L2 nodes 3. Traditional ORs must allow for a lengthy challenge period (typically 7 days) before finality is achieved and users can exit their funds from the L2 chain Ideally, an L2 scaling solution should offer the benefits of an OR without the downsides of the current architecture. ## Modular Rollups In a **Modular Blockchain**, the core functions of blockchain operation (execution, consensus, settlement, data availability) are performed on **specialized** layers. By applying this principle to a rollup, we are able to optimize the solution since each layer is now performing a specialized task. This leads to lower costs and better overall performance. Many popular blockchains like Ethereum, Binance Smart Chain, Solana, etc. handle processes such as execution, consensus, settlement, and data availability all at the node/network level (hence sometimes referred to as *Monolithic blockchains*). Modular blockchains essentially break these functions into separate layers that can be run by network actors at different levels. This translates to lower gas costs and better overall performance.&#x20; A system like this is also a potential solution to the popular Scalability, Security, and Decentralization [blockchain trilemma](https://learn.bybit.com/deep-dive/blockchain-trilemma/). Here's how. 1. The separation of resources results in increased network efficiency since each layer specializes at a particular task. 2. All users operate at the same level of improved security, as opposed to only validators (full nodes) on L1. 3. Technologies such as fraud proofs and ZK proofs that operate on separate layers reduce the overall execution and validation load on the nodes since they don't need to execute all the transactions for checking validity anymore. # Data Availability Unlocking hyper-scaled data availability on a Layer 2 rollup {% hint style="danger" %} Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)! {% endhint %} ## What is Data Availability? By "Data Availability" (DA) we are referring to the ability for any node in the Mantle network to access the transaction history posted by the Sequencer. Access to block data for all network participants is a major scalability issue that must be addressed, especially in the case of blockchains that operate on a rollup architecture to eliminate the possibility of block data being withheld, maliciously or otherwise. So the challenge of maintaining a *trustless* L2 network is distilled into ensuring that transaction data remains available! {% hint style="info" %} It turns out that guaranteeing data availability is a challenge in its own right. To understand how this is handled, you can read more about the data availability problem and erasure coding [here](https://github.com/ethereum/research/wiki/A-note-on-data-availability-and-erasure-coding).&#x20; {% endhint %} ## Trust Minimization One of the foundational pillars of blockchain design is *trustlessness*. When we say "trustless", we mean that a user on a blockchain should be able to accomplish their tasks *without placing unnecessary trust* in third-parties.&#x20; This explains why blockchains use cryptography. Instead of relying on soft agreements and social contracts with other network participants (aka trust), blockchains use hard rules and code to enforce expected behavior. What this means practically is that blockchains are designed so that any user can verify whether a network participant has followed the rules.&#x20; On a network like Ethereum, this means a certain reliance on **full nodes.** Full nodes will publicly store the entire history of blockchain data so that all other network participants can verify the state transition of the chain was correct. In the case of Mantle, transactions are submitted and executed on the L2 chain. This means that Mantle nodes need access to the L2 transaction data in order to verify the state transition. This verification is enabled by having the Sequencer **publish** the full transaction data and cryptographic evidence of the state transition (a Merkle Proof) on Ethereum. The reliability of Ethereum's trust network is derived from its widespread validator network running a solid consensus algorithm, adoption that ensures security, combined with the value of the relatively well-distributed $ETH token.&#x20; ## EigenLayer [**EigenLayer**](https://www.eigenlayer.com/)**,** a re-staking protocol, leverages Ethereum's existing trust network for enabling **any** rollup-based L2 to guarantee data availability to its execution layer, while maintaining the same level of security as the Ethereum mainnet. This is achieved through a **re-staking** mechanism, where L1 validators can opt in to provide data availability services being subjected to additional performance conditions using their staked $ETH as collateral. {% hint style="info" %} Think of it as an Ethereum middleware platform. {% endhint %} Just as optimistic rollups use economic incentives to maintain system integrity, this mechanism also puts incentives in place for Ethereum validators to provide their services for additional yield opportunities. Read more on EigenLayer [here](https://ethresear.ch/t/an-eigenlayer-centric-roadmap-or-cancel-sharding/14141#what-is-eigenlayer-1).&#x20; ## Mantle DA - Powered by EigenDA Technology 1. [EigenLayer](https://www.eigenlayer.xyz/) is a protocol built on Ethereum that introduces restaking, a new primitive in cryptoeconomic security. EigenDA (Data Availability), built by EigenLabs, is one core application on EigenLayer, which we have selected for Mantle Network's data availability module. 2. The current version of MantleDA is powered by EigenDA technology and licensed by EigenLabs. The Mantle team has been working with the support of the EigenLayer team on this simplified solution until the canonical solution is ready for mainnet launch. 3. For MantleDA, rollup data is available here: [State Roots on L1](https://etherscan.io/address/0x89E9D387555AF0cDE22cb98833Bae40d640AD7fa/advanced#internaltx), [Rollup Tx Data on L1](https://etherscan.io/address/0x291dc3819b863e19b0a9b9809F8025d2EB4aaE93), and [DA Rollup Tx on L2](https://explorer.mantle.xyz/eigenda-batches?batch_index=1196\&page_number=1\&page_size=50\&pages_limit=25). 4. We plan to migrate to EigenDA after EigenDA mainnet launches. Note that: **Mantle DA**, allows permissioned nodes to provide data availability services to the Mantle network and requires $MNT staking. {% hint style="info" %} See the section on [Network Roles](/network/network/for-validators/network-roles#da-nodes) to find out more about how the different participating actors that are part of the **Mantle DA** module function. {% endhint %} ## Mantle DA Characteristics * Allows **decoupling** of the **data availability layer** from the **consensus layer** * Employs a **unicast channel** for **data exchange** between network participants to deliver efficiency gains both in terms of data transmission and storage * Maintaining an **erasure rate** ensures pieces of block data from L2 and L1 sources can be used by verifying actors to reconstruct complete block data This approach will provide the **high throughput** and **low gas cost** necessary for next-generation applications in blockchain gaming, decentralized social networks, and more. {% hint style="info" %} **Mantle Explorer** displays the [transaction batch details](https://explorer.mantle.xyz/eigenda-batches) for the rollup data that has been stored on the DA layer, just as it does for the transactions taking place on L2. {% endhint %} # Threshold Signature Scheme Implementing TSS node modules on L2 to minimize the trust risk of execution results {% hint style="danger" %} Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)! {% endhint %} ## Background Optimistic Rollups have a limitation in terms of imposing long waiting times for withdrawals in the form of challenge periods. In order to address the uncertainty problem of transaction validation during the challenge period, we implement a distributed signing scheme for the verification of block data. This paradigm of distributed key generation combined with digital signatures is more popularly known as the **Threshold Signature Scheme (TSS)**. It enables each party of the client network to generate a valid signature, and ensures the verifiability of distributed signature data as long as enough of them are honest. The private key also ceases to be a single point of failure now that every TSS client only holds a part of it. <div data-full-width="true"><figure><img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2F7LZl6cq4MAMU5OlhAEWP%2FMPC%20execution%20simple.drawio.png?alt=media&amp;token=a8c6f4d8-5bd2-495e-82ed-bc2f67ff9bba" alt=""><figcaption><p>TSS Data Flow</p></figcaption></figure></div> Here multiple TSS nodes verify the block data sent by Sequencers and sign it, guaranteeing its correctness. The process of computing digital signatures using TSS basically involves three steps: 1. **Key Generation:** The key generation function run by each TSS client generates a private key, and then generates a public key based off of the private key. It is designed such that the public key it generates the same public key for every client, and the private key is unique and never shared in any manner. 2. **Signing:** The signing function takes a public input available to all clients as the message to be signed, and then generates a signature using the private key. 3. **Verification:** A verification algorithm takes the signature data and verifies it with the public key. TSS nodes stake a fixed amount of **$MNT** on Ethereum as part of the deployment process, and this stake gets slashed if there is malice or failure detected on their part. {% hint style="danger" %} **For Mainnet Alpha** * All TSS nodes will be permissioned by the Mantle core contributor team. * We assume TSS node honesty and operator performance are aligned with that of the Sequencer and Batch Submitter. * The TSS provides an additional check on State Validity prior to Batch Submission. Some third party applications may choose configure their finality requirements to TSS Verification (Batch Submission) instead of number of L2 blocks. * TSS Stake, Rewards, and Slashing mechanisms will all remain in place. However, as Stake, Rewards, and Slashing are provided by, or owed to, Mantle DAO under the administration of the Mantle core contributor team, these incentives do not affect the service uptime assumptions of the TSS. \ **Future Direction** * The future direction of TSS will be a major decision for the next significant upgrade of Mantle Network, and TSS will be evaluated among other architectural choices such as Shared Sequencer, Decentralized Sequencer, Fraud Proofs, Zk Proofs, and other mechanisms that aim to enhance confidence in State Validity. * There is no plan to allow permissionless TSS nodes under the current architecture. {% endhint %} ## **Architecture**&#x20; <figure><img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2FhbGCkObWjvh2F2Eprx6b%2Ftss-architecture%2020230715.jpeg?alt=media&amp;token=3563d699-5c53-4a93-b8a0-b8501dc06f63" alt=""><figcaption></figcaption></figure> The components of the TSS client network the signing mechanism are: 1. **TSS Core:** Uses an implementation of the [**tss-lib**](https://github.com/bnb-chain/tss-lib) as our version of the TSS.&#x20; 2. **TSS Manager:** The TSS Manager is responsible for managing the TSS nodes engaged in multi-party computation, and dispatching signing tasks to them.&#x20; 3. **TSS Nodes:** A TSS node generates its own private key, and communicates with other nodes through a peer-to-peer network to generate signatures by signing messages with its private key. ## **Justification for a TSS Manager** In order to maintain coordination between TSS Nodes to accomplish signing tasks, there needs to be a component that assists with: * discovering nodes that are able to join a signing task at any given point of time * dispatching signing tasks to the TSS nodes Our research determined it would be more efficient to create a TSS Manager versus having each node track the availability of all other node participants. ### Functionality The TSS Manager accepts WebSocket (WS) connections from TSS nodes and transmits messages to the nodes via these connections.&#x20; The signature process begins when the Batch Submitter sends a **signature request** to the TSS Manager. The signature request includes a state root that will be uploaded to L1 if verified.&#x20; The TSS Manager must now coordinate with the TSS nodes to verify that this state root is correct. This process that follows: 1. The TSS Manager determines which TSS nodes are willing to join the signing task&#x20; 2. The TSS Manager dispatches the signing task along with block data to the active TSS nodes (along with data indicating which nodes joined) 3. TSS nodes generate signatures in an attempt to verify the state root 4. The TSS Manager receives and verifies the signatures from the respective TSS nodes 5. If valid, the TSS Manager sends the signature to the batch submitter {% hint style="info" %} Every TSS node is obligated to actively participate in state root verification and signing. Their staked **$MNT** will be slashed in case of failure to fulfill any of these duties, i.e., not returning signed block data under any circumstances. All slashed **$MNT** will be distributed among the functioning TSS nodes. {% endhint %} ### **Execution Result Signing**&#x20; Because TSS nodes re-derive the state root, we alternatively refer to signed state roots generated by TSS nodes as the **execution result**. When the execution result determines that the state root is valid — and can be uploaded to L1 — it is passed back to the Batch Submitter by the TSS Manager.&#x20; Each TSS client runs a **Verifier** (that sync data from Mantle DA) so it can execute transactions and arrive at the correct state root. This state root (the execution result) is used to verify the event data coming from the TSS manager.&#x20; **Execution Result Diagram** <figure><img src="https://3701411312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNHXgeqhgrznnRobzznxl%2Fuploads%2F75tPRPSYNhg7qtE2hIC2%2FMPC%20sequence%201.png?alt=media&amp;token=3e226b0d-b035-408c-b731-8f205b83dd24" alt=""><figcaption></figcaption></figure> ## **TSS Node Election** The following process describes how TSS nodes are elected: 1. A user must stake **$MNT** on the Ethereum mainnet 2. The smart contract on L1 records the user's stake and locks the **$MNT** tokens 3. Mantle team determines which TSS nodes are to be included as a part of the TSS node cluster 4. Elected nodes run the TSS process offline, which manages private key shares and generates the cluster public key 5. The nodes submit the generated cluster public key to L1 6. The cluster public key is confirmed once it is submitted by all TSS nodes ## **TSS Node Slashing** Our system needs deterrents to prevent malicious behavior on part of TSS nodes. We identify two types of malicious behavior and their respective deterrents below: ### Node Liveness To create a deterrent against extended downtime for TSS nodes, the TSS Manager records which nodes are absent from every signing task. As the degree of absence increases, the TSS manager submits a proposition to slash an absent node's stake. If the proposition is signed by a proportional majority of the cohort (by stake), a portion of the absent node's stake will be slashed. ### **Malicious Signing** Another form of malicious behavior would be if an TSS node serves fraudulent data to the TSS cluster to disrupt the signing process. In this event, other nodes will record the node's behavior and report it to the TSS Manager. The TSS Manager will then start a proposition to penalize this malicious node. If the proposition is signed by a proportional majority of the cohort (by stake), this node's stake will be slashed. &#x20; # Fraud Proofs {% hint style="danger" %} Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)! {% endhint %} Optimistic Rollups assume state transition validity for all Layer-2 (L2) transactions, unless proven otherwise. Hence, they’re also called assertions, since their validity hasn’t been established per se. The verification logic takes evidence of an invalid state transition to initiate the validation process, and fraud proofs are the medium to provide that. The protocol allows for a dispute window during which a network actor can come forward and submit a fraud proof disputing a state they deem to be incorrect. This challenge period is roughly 7 days for most optimistic rollup protocols. Any transaction that isn’t disputed within this time frame is assumed to be valid by default. ## Types of Fraud Proofs Fraud proofs can be classified into two distinct categories: non-interactive and interactive. Let's go over the differences in these two types of proving mechanisms. ### Non-interactive Fraud Proofs Non-interactive fraud proofs use a method where no other parties are needed to prove the incorrectness of an assertion. They basically run all the state transitions between two assertions to establish whether the resultant state is consistent or not. They are simpler to design and implement, but they place limitations on the size of assertions, since the assertions need to be small enough to run with the computational capabilities of the current EVM (Ethereum Virtual Machine) architecture. ### Interactive Fraud Proofs Interactive fraud proofs, on the other hand, involve two or more parties that work in tandem to verify an assertion, i.e., a party claiming a fraudulent assertion, and a party defending the said assertion. The verifier narrows down the assertion to a single state transition by interacting with the challenger, and eventually only verifies that one transition to establish i
프로젝트로 돌아가기