bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 37쪽 중 26쪽
permissions:
* `createAssertionWithStateBatch` - Proposer
* Delete assertions via `rejectLatestCreatedAssertionWithBatch` - Proposer
* Adjust whitelists and stake handling - Proposer
* rollbackL2Chain - Proposer (potentially transferring to Mantle Security Msig in the future)<br>
#### **FP.AssertionMap**
* The AssertionMap is data handling contract used to store and retrieve data associated with assertionIDs (such as NumStakers, ProposalTime, status of Stakers, etc.).
* The AssertionMap functions can only be called by the Proxy\_\_Rollup contract (section above), and this is enforced by the modifier `rollupOnly`.
\
AssertionMap
* Proxy: [`0xa0d79E982bfD3C2ccD09D2E374ddC75fe328f317`](https://etherscan.io/address/0xa0d79E982bfD3C2ccD09D2E374ddC75fe328f317#writeProxyContract)
* Implementation: [`0x1872Ce78A362c58D093EE107cAdeE2667b7Bd993`](https://etherscan.io/address/0x1872Ce78A362c58D093EE107cAdeE2667b7Bd993)
* Upgradable Admin: Mantle Security Msig
* Write permissions: [Proxy\_\_Rollup contract](https://etherscan.io/address/0xD1328C9167e0693B689b5aa5a024379d4e437858)<br>
#### **FP.VerifierEntry**
* The VerifierEntry is a register of various subverifiers for different types of proofs (stack verifier, memory verifier, etc.). These subverifiers enable onchain one-step-proofs to discover the fraud step and determine the outcome of any challenges.
* Each subverifier is a stateless smart contract.
* Note: we have not enabled fraud proof challenges, and so this register is currently empty.
\
FP.VerifierEntry
* Proxy: [`0x3F77D44E1789D47e076a4d5f2779a1fCAb821C2a`](https://etherscan.io/address/0x3F77D44E1789D47e076a4d5f2779a1fCAb821C2a#writeProxyContract)
* Implementation: [`0xA1C7B28B4743248584725fEf31516fD4Ea72aEA8`](https://etherscan.io/address/0xA1C7B28B4743248584725fEf31516fD4Ea72aEA8)
* Upgradable Admin: Mantle Security Msig
* `setVerifier` Permission: Mantle Engineer Msig can add subverifiers to the registry.
### Bridge
#### L1StandardBridge
* The L1StandardBridge components are used to store deposited L1 tokens that are to be bridged to L2, and facilitate future withdrawals of such tokens on L1.
\
Proxy\_\_BVM\_L1StandardBridge
* Proxy: [`0x95fC37A27a2f68e3A647CDc081F0A89bb47c3012`](https://etherscan.io/address/0x95fC37A27a2f68e3A647CDc081F0A89bb47c3012)
* Implementation: [`0x6b6e0dc564d4603452e40752ecdaa0e9630b38a2`](https://etherscan.io/address/0x6b6e0dc564d4603452e40752ecdaa0e9630b38a2#code)
* Upgradable
* Owner permissions: Mantle Security Msig
\
If the L1StandardBridge component is compromised:
* The LibAddressManager owner (Mantle Security Msig) can reset the address, however existing tokens held in the L1StandardBridge may become inaccessible.
#### L1CrossDomainMessenger
* The L1CrossDomainMessenger component is used to send messages from L1 to L2. This is triggered through the `sendMessage` method of L1CrossDomainMessenger, and routed to the enqueue method in the CTC contract. After the verification is successful, the TransactionEnqueued event is thrown and caught by the DTL Service for relaying to other L2 nodes.
* The L1CrossDomainMessenger component is used to facilitate L2 to L1 communication. This is initiated through the sendMessage method of [L2CrossDomainMessenger](https://explorer.mantle.xyz/address/0x4200000000000000000000000000000000000007/transactions#address-tabs) which will be rolled up to L1. After the challenge period, a user can call the `relayMessage` method of the L1CrossDomainMessenger and the legitimacy of the message will be verified and executed.
* The main fields of messages include: `address_target` which is the address of the contract to be interacted with, and `bytes memory_message` which includes the parameters for calling the contract. Additional L2 to L1 messages will include `address_sender`.
\
L1CrossDomainMessenger
* Proxy: [`0x676A795fe6E43C17c668de16730c3F690FEB7120`](https://etherscan.io/address/0x676A795fe6E43C17c668de16730c3F690FEB7120)
* Implementation: [`0x4692363048d0F32a2dE7816860D48fff0c61B24B`](https://etherscan.io/address/0x4692363048d0F32a2dE7816860D48fff0c61B24B)
* Upgradable
* Owner Permission: Mantle Security Msig
\
If the L1CrossDomainMessenger is compromised:
* The LibAddressManager owner (Mantle Security Msig) can reset the address.
### TSS
* [TSS nodes](https://docs.mantle.xyz/network/introduction/concepts/threshold-signature-scheme) - which provide an additional check on state validity prior to batch submission - is currently a permissioned node network, with all nodes selected and approved by the core team. The future direction of TSS will be a major decision for the next significant upgrade of Mantle Network, and will be evaluated among other mechanisms that aim to enhance confidence in State Validity.
* If the TSS components are compromised, stateroots can not be submitted by the Proposer to the SCC, and the L2 chain may need to be paused depending on the duration of TSS downtime and the establishment of a new TSS group.
* Key TSS components are owned by a combination of Mantle Engineering Msig and Mantle Security Msig.
### Data Availability (DA)
* [Data availability](https://docs.mantle.xyz/network/introduction/concepts/data-availability) through Mantle DA (powered by Eigen DA technology) is currently a permissioned node network, with all nodes selected and approved by the core team, and can be considered an offchain system.
* We plan to migrate to EigenDA after EigenDA mainnet launches.
* Mantle DA stores the majority (\~90%) of the rollup transaction data in place of the CTC. The CTC is where this data would be stored if our data availability was "Onchain L1".
* Mantle DA provides data to the DTL Service (an offchain system). This is for various internal verification purposes and future fraud proof construction purposes.
* Mantle DA receives data from the mt-batcher (a centralized service, considered a component of the sequencer). The mt-batcher will post `init data` to MantleDA, and after some time there will be a `confirm data` with a validity certificate posted into the MantleDA related smart contracts on L1. The frequency of confirmations will be \~15 minutes frequency at its slowest setting.
* The smart contracts are owned by Mantle Security Msig and are upgradable.
\
Proxy\_\_BVM\_EigenDataLayrFee: [`0xF037ba8B0e82439Ad82325D986E097fD19E994ef`](https://etherscan.io/address/0xF037ba8B0e82439Ad82325D986E097fD19E994ef#writeProxyContract)
Proxy\_\_BVM\_EigenDataLayrChain: [`0x50fa427235c7c8caa4a0c21b5009f5a0d015b23a`](https://etherscan.io/address/0x50fa427235c7c8caa4a0c21b5009f5a0d015b23a#writeProxyContract)<br>
If the Mantle DA component is compromised:
* The mt-batcher component can post data to, and DTL Service can read data from, a backup DA solution.
## Other Concepts
### **Choices for system components**
Generally range from:
* Non-upgradable smart contracts - while the key logic can not be modified, some parameters or variables may be modified by permissioned roles.
* Upgradable smart contracts - Upgradability allows for the modification of logic, which is useful for adding features, but essentially allows the upgrade owner to do anything. Upgradable smart contracts can optionally have a time lock function (delay prior to upgrade coming to effect), which may allow users to exit the system prior to the upgrade. See the [following link](https://docs.openzeppelin.com/learn/upgrading-smart-contracts#how-upgrades-work) for more details.
* Distributed node networks - which may have various degrees of permissioning, decentralization, consensus, and economic trust assumptions. These systems can be upgraded through a synchronized process with node operators.
* Centralized systems - which are generally used to handle advanced logic with high performance and low cost requirements. These systems can modify their internal logic at any time.
### Smart Contracts and Roles
Smart contract methods write permissions can be assigned to various roles (owner, operator, etc.). These roles are typically either: a multisignature wallet (msig), single signer (EoA), online private key (HotWallet), multi-party computation (MPC), DAO smart contract module, or other smart contracts.
### Proxy and Upgradable Contracts
* The **proxy contract** is the contract users and other system components interact with, all data is stored in the proxy contract.
* The **implementation contract** (without proxy name) is the core logic, but stores no data.
* Upgrading involves deploying a new logic contract, and pointing the proxy contract to the new implementation contract. The proxy contract address is preserved.
### Core Multisigs
Core team multisigs will maintain anonymous signers for security reasons.
* **Mantle Security Msig** [`0x4e59e778a0fb77fBb305637435C62FaeD9aED40f`](https://etherscan.io/address/0x4e59e778a0fb77fBb305637435C62FaeD9aED40f) is generally used for contract upgrades and super-permissions.
* **Mantle Engineering Msig** [`0x2F44BD2a54aC3fB20cd7783cF94334069641daC9`](https://etherscan.io/address/0x2F44BD2a54aC3fB20cd7783cF94334069641daC9) is generally used for faster response actions such as pausing and resets.
## Other Details
### SCC rollBackL2Chain() Method
**Key points:**
* The **rollBackL2Chain()** method is a placeholder function intended to be used for future Fraud Proof and TSS mechanisms.
* In the current implementation, if the TSS signature verification does not pass, the Proposer will be unable to post stateroots to the SCC. Instead, the sequencer will attempt to resequence the relevant blocks. If multiple attempts to re-sequence fail, there will need to be manual processing by the core team (for example in the case that there is a >64 block L1 reorg).
**Future Purpose:**
* **Fraud Proof:** When the `Fraud Verifier` submits a `Fraud Proof` and the challenge is successful, the SCC status must be rolled back to a historical batch prior to the challenged batch. The corresponding Layer 2 block needs to be rolled back, which is triggered by the `rollBackL2Chain()` method.
* **TSS:** When the set of TSS nodes is unable to have their signature verified, they can use the `rollBackL2Chain()` method to the last verified Layer 2 block. They can then attempt the re-execution of subsequent blocks.
**Current code:**
1\ `BvmRollbackAddress` Variable Declaration
* The variable declaration for the BvmRollbackAddress can be found here\
<https://github.com/mantlenetworkio/mantle/blob/0b7733c10a44e93edbf49b27e056ebe2e5279c63/l2geth/rollup/dump/constants.go#L12C7-L12C7>
2\ Call Entrance Summary
* The TSS nodes ability to call `RollbackL2Chain()` is controlled by a flag in the config `AllowL2AutoRollback`. The current mainnet config has this configured as `False`, so it currently cannot be triggered (include link to mainnet config)\
<https://github.com/mantlenetworkio/mantle/blob/0b7733c10a44e93edbf49b27e056ebe2e5279c63/batch-submitter/drivers/proposer/driver.go#L409C16-L409C16>
* The ability for Fraud Proofs to trigger `RollbackL2Chain()` is controlled by a flag in the config `SccRollback`. The current mainnet config has this configured as `False`, so it currently cannot be triggered (include link to mainnet config)\
<https://github.com/mantlenetworkio/mantle/blob/0b7733c10a44e93edbf49b27e056ebe2e5279c63/batch-submitter/drivers/proposer/driver.go#L430C12-L430C12>
3\ Off Chain Handling
* L1 - > L2 message to the `BvmRollbackAddress` (in our case `0xDeADdeaDdEaDdeADdEaDDeADDEaddEaDDEad2222`) returns nil.\
[https://github.com/mantlenetworkio/mantle/blob/0b7733c10a44e93edbf49b27e056ebe2e5279c63/l2geth/core/vm/evm.go#L219C8-L219C](https://github.com/mantlenetworkio/mantle/blob/0b7733c10a44e93edbf49b27e056ebe2e5279c63/l2geth/core/vm/evm.go#L219C8-L219C8)
* While syncing, if we encounter a rollback, it will be resimulated. However, as rollbacks are currently not enabled on mantle mainnet, this logic should never be reached at this moment in time.\
<https://github.com/mantlenetworkio/mantle/blob/0b7733c10a44e93edbf49b27e056ebe2e5279c63/l2geth/rollup/sync_service.go#L964C17-L964C17>
# Transaction Lifecycle
A transaction's lifecycle on Mantle
{% hint style="danger" %}
Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)!
{% endhint %}
## 1. The Initiation
A wallet user, a dApp, or a script somewhere wants to use a blockchain based system to transfer funds, or perform a task. 
* In the case of the user, they've already connected to the Mantle network by adding the RPC endpoint of a Sequencer node to their wallet. 
* The dApp on the other hand has integrated the [Mantle SDK](https://sdk.mantle.xyz/index.html) and has already instantiated it to be able to talk to the Mantle network. They are both ready to send a request that contains a receiver's address and the amount they want to transfer.
Just like any service, this action requires a fee. And not just for making the transfer itself, but to also maintain a perpetual, immutable public record of it that can be verified by anybody. Their wallet, or dApp, must make sure they have enough balance to do this. 
* For a wallet, things are simpler, since it's easier to calculate the fee required to be paid
* A dApp needs to do more to carefully make that calculation. [**More details here.**](/network/network/introduction/transaction-fees-on-l2)
They use the tools at hand to compose a request, sign it using their private keys, and send it to Mantle network where a Sequencer is ready to process it. This is where the transaction first enters Mantle. [**More details here.**](/network/network/for-validators/network-roles#sequencers)
## 2. The Handling
The transaction triggers a standard state verification process that is carried out by the Ethereum Virtual Machine (EVM) software running on these nodes. This is to make sure the transaction is valid in nature, has paid the necessary fees, and not doing something out of the ordinary.
This transaction updates the local state (the ledger) and awaits further processing as part of a pending block. The process up until this point is particularly fast.
{% hint style="info" %}
In blockchain terms, this means instant transaction confirmations and state updates
{% endhint %}
Many such pending blocks are combined to form batches that will be sent to Ethereum to be finalized. The L2 chain achieves low transaction fees by spreading fixed costs over the multiple transactions in a batch. 
This block data is then verified for correctness by another module that's a part of the Sequencer network known as Threshold Signature Scheme (TSS) nodes. They verify the state roots submitted by the Sequencer as part of the blocks on L2. [**More details here.**](/network/network/for-validators/network-roles#multi-party-computation-mpc-nodes)
## 3. The Storage
Once signed off by TSS nodes, the batched block data is ready to be stored by Mantle DA nodes that use EigenDA technology, while the updated state root is published to L1 Ethereum. The state data is transmitted across the network by the Sequencer to be received by different actors on both L2 and L1. 
On L2, Rollup Verifiers are looking to sync this block data to make it accessible for other users and dApps. [**More details here.**](/network/network/for-validators/network-roles#rollup-verifiers)
On Ethereum, there's an entire trust network ready to verify the updated state roots that are stored in a contract. Once the block goes through Ethereum's consensus mechanism, it is recorded on-chain where it's secure.
The Data Availability nodes, or DA nodes, who will sync the block data and guarantee access to it at any given time in exchange for the $MNT rewards they're going to receive for providing this service. [**More details here.**](/network/network/introduction/concepts/data-availability#da-nodes)
# Transaction Fees on L2
How transaction fees are calculated on Mantle Network
{% hint style="danger" %}
Mantle v2 Tectonic has been released, please move to the new [documentation](https://docs-v2.mantle.xyz/)!
{% endhint %}
## **Understanding Fee Basics**
Transaction fees on Mantle Network work similar to fees on Ethereum. As Mantle network is a Layer 2 (L2) blockchain, there are new paradigms in the fee structure that cause it to differ from Ethereum's fee. 
Since Mantle Network is constantly perfecting EVM compatibility, dApps can conveniently handle any changes with minor modifications. Let's take a look at the two sources of transaction costs on Mantle.
1. The L2 transaction fee for Layer-2 execution
2. The L1 rollup fee to cover the cost of publishing rollup state roots to L1 (divided equally among users whose transactions were included in the rollup batch)
{% hint style="warning" %}
The `estimateGas` API currently only returns L2 gas cost. The L1 gas estimate needs to be calculated separately. We will support fetching the total L1+L2 gas estimate through the `estimateGas` interface in a future network update.
{% endhint %}
### **The L2 Transaction Fee**
Just like Ethereum, transactions on Mantle network have to pay gas for the amount of computation and storage that they use. Every L2 transaction will pay some **execution fee**, equal to the amount of gas used by the transaction multiplied by the gas price attached to the transaction.
Here's the (simple) math:
```
L2ExecutionFee = L2GasPrice * L2GasUsed
```
The amount of L2 gas used depends on the particular transaction that you're trying to send. Thanks to EVM compatibility, transactions typically use approximately the same amount of gas on Mantle Network as they do on Ethereum. Gas prices fluctuate with time and congestion, but you can always check the current estimated L2 gas price on the public Mantle dashboard. Also, since gas fees on L2 Mantle Network are charged in $MNT, it means at the same gas price the transaction cost incurred will still be significantly lower than other L2 networks that use $ETH as the gas token.
### **The L1 Rollup Fee**
All the state roots that are generated on L2 as result of transaction execution are published to Ethereum. This step is crucial to the security properties of Mantle because it means that all of the most up-to-date block data from L2 Mantle Network that you need to sync a node is always publicly available on L1 Ethereum.
{% hint style="info" %}
With the EigenDA-powered Mantle DA module online with Mantle Mainnet, only state roots and a limited amount of necessary transaction data are sent to L1, while the transaction batch data is posted to the DA network. For dApps with high gas consumption, they can be executed at the same cost as an ordinary transaction (like a transfer), and the L1 fee will not increase with the complexity of L2 transaction execution. As a result, for transactions with high complexity, this can even save upto ~70% of the cost compared to the original L1 rollup fee.
{% endhint %}
Mantle publishes rollup states and some necessary transaction data to Ethereum by packaging transactions into batches, and the amount of $ETH spent during this process will be divided among the users whose transactions were included in the batch. The cost-per-user is significantly cheaper than it would be if the transactions were executed on L1. The L1 rollup fee is calculated from the following sub-factors:
1. The current gas price on Ethereum.
2. A fixed overhead (auto-adjusted and set into gas oracle)
3. The scaling factor (currently set to 1)
4. The $ETH to $MNT conversion ratio
Here's the math:
```
L1RollupFee = L1GasPrice * Overhead * Ratio
```
The transaction fees incurred by users is calculated and deducted as described below:
1. A connection is made to the RPC and the `EstimateGas` method is called to calculate the gas cost on L2 (if you use a wallet, such as MetaMask, this step will be executed automatically). This is the L2 Transaction Fee.
2. A transaction is signed and submitted
3. Mantle n프로젝트로 돌아가기