Understanding Midgard L2
Execution on Midgard L2 is designed to be efficient, secure, and scalable, leveraging the innovative architecture of optimistic rollups adapted to the UTxO model
Execution Framework
Midgard's Optimistic Rollup Architecture
At the core of Midgard’s execution framework lies its optimistic rollup architecture, a sophisticated system designed to scale Cardano while maintaining its security guarantees. This architecture combines a validator network, efficient state management, UTxO-optimized fraud proofs, and carefully balanced economic incentives to create a high-throughput, secure Layer 2 solution tailored specifically for Cardano
Operator Network
State Management
Midgard’s state management revolves around a State Validator smart contract on Cardano’s L1, optimized for the eUTxO model.
The system maintains three key components: the current state, incoming transactions, and the next state, all represented as Merkle roots. This compact representation allows for efficient state transitions and verification. The current state encapsulates valid L2 transactions and balances, while incoming transactions await processing. The next state represents the outcome after processing these transactions
UTxO-Optimized Fraud Proofs
The integrity of Midgard is upheld by a robust fraud proof system, which is tailored to Cardano’s eUTxO model. It offers unique advantages for optimistic rollups.
It enables local state validation, allowing for parallel processing of fraud proofs and reduced computational overhead. The system supports granular transaction validation, targeting specific aspects like input validity, output correctness, and script execution integrity. Utilizing Merkle-based state representation, Midgard efficiently manages and proves the L2 state.
A sophisticated evaluation mechanism handles complex fraud proofs through a multi-step evaluation thread.
This bespoke approach results in faster, more cost-effective fraud detection compared to account-based blockchain rollups
Economic Incentives
Operators stake ADA as a bond, risking forfeiture for dishonest behavior. Watchers who submit valid fraud proofs are incentivized with rewards, encouraging oversight of the network.
The challenge period allows for scrutiny of state transitions. This economic structure creates a balanced system of rewards and penalties, ensuring high integrity within the network and aligning the interests of all participants with the overall health of the protocol.
Optimistic Rollups
Optimistic rollups are a cutting-edge scaling solution that processes transactions off-chain, reducing the computational load on the main blockchain. By assuming transactions are valid by default and only verifying them if a fraud proof is submitted, optimistic rollups significantly increase throughput and efficiency.
Midgard uses optimistic roll-up technology, which assumes transactions are valid by default and only checks them if a fraud-proof is submitted. This reduces the computational load on the L1 and improves efficiency through a bespoke Cardano native design.
Seamless Integration with Cardano
Midgard seamlessly integrates with Cardano’s Layer 1 (L1) blockchain. It uses smart contracts to manage state transitions and employs Merkle roots for efficient proof submissions, ensuring that off-chain transactions are secure and verifiable.
Fraud Proof System
A foundational component of Midgard’s execution framework is thes fraud proof system. This mechanism ensures the integrity and correctness of transactions by allowing participants to challenge invalid state updates
Challenge Period
After a state update is submitted, there is a designated challenge period during which participants can submit fraud proofs to contest the validity of the update
Submitting Fraud Proofs
To submit a fraud proof, a challenger provides evidence that a specific transaction or state transition is fraudulent. This involves providing the original transaction data and Merkle proofs
Challenge-Response Mechanism
Types of Fraud Proofs
Double-Spending Proofs
Detects when the same UTXO is used in multiple transactions illegitimately
Invalid Signature Proofs
Proves that a UTXO is included in a transaction without the necessary cryptographic signature
Value Not Preserved Proofs
Ensures that the total value of inputs and outputs, minus fees, is consistent
Timestamp Misuse Proofs
Validates that transaction and block timestamps are within the allowed ranges
Improper Incentives/Fees Proofs
Ensures that transaction fees are calculated correctly
Economic Incentives
Midgard’s execution framework is reinforced by strong economic incentives designed to promote honest behavior and discourage fraudulent activities
Operator Bonds
Operators are required to post bonds, which are at risk of being slashed if they attempt to submit fraudulent transactions or invalid state updates
Watcher Rewards
Watchers who successfully submit fraud proofs are rewarded, incentivizing the community to actively monitor and maintain the integrity of the system