Network Overview
This document provides an overview of the SL-Chain, covering key concepts, network architecture, and example workflows. For more details please refer to the specifications and design documents for each component.
Overview
The SL-Chain enables application-specific sequencing with Verifiable Sequencing Rules (VSRs), Verifiable Aggregation Rules (VARs), and the MTX transaction standard.
MTX
MTX is a transaction standard developed by Semantic Layer Labs that works with the SL-Chain to enforce Verifiable Sequencing Rules (VSR) and Verifiable Aggregation Rules (VAR), providing enhanced control for dApps over transaction execution. MTX leverages the existing ERC-4337 standard, maximizing compatibility with current DeFi infrastructure. In the future, MTX can be extended to support additional intent standards, such as ERC-7521, to expand its functionality.
There are two types of MTX: UserMTX and SolverMTX.
- UserMTX: It includes ERC-4337 User Operations signed by the user, along with dApp operations, VSR, and VAR defined by dApp developers.
- SolverMTX: It contains solver operations for a given UserMTX.
See here for more detailed information about MTX.
VAR and VSR
Developers can deploy customized VSR and VAR on the SL-Chain as smart contracts. VSR and VAR contracts implement specific interfaces and functions, which the SL-Chain references to process the MTX with the defined VSR and VAR.
VSR exposes a view function that the SL-Chain can use to calculate the VSR score of an MTX bundle. The SolverMTX with the highest score will be selected for the given UserMTX and eventually executed in the execution environment.
VAR exposes functions that the SL-Chain can reference for aggregating multiple MTX bundles.
See here for more detailed information about VSR and VAR.
Architecture
The network mainly consists of the following components:
-
SL Nodes: A peer-to-peer (P2P) node network, with each node connecting to a set of solvers. It acts as a gateway network for SL-Chain, enabling solvers to efficiently access UserMTX and submit SolverMTX.
Solvers submit their SolverMTX to connected nodes. SolverMTXs are simulated and evaluated based on the defined VSR/VAR. For each UserMTX, the node selects the best SolverMTX and submits it to the SL-Chain. Different nodes may connect to different solver sets, leading to multiple local-best MTX bundles for the same UserMTX. The SL-Chain processes these local-best bundles and selects the global best for execution.
For MTX that does not require solver solutions, it will be submitted directly to the SL-Chain and processed.
-
SL Execution Contract: An entry point contract deployed on the destination execution environment (for example, Ethereum and L2s). MTX executor will call this execution contract to execute the bundled operations.
-
SL-Chain: A modified EVM with a set of stateful precompiles designed to facilitate MTX processing.
After receiving MTX from SL nodes, the SL-Chain evaluates the MTX based on the specified VSR/VAR and selects the best MTX bundle. The MTX executor then sends the selected MTX bundle to the SL execution contract deployed on the destination execution environment for executing the bundled operations.
-
SL Oracle: The SL-Chain needs on-chain states from the destination execution environment to confirm the successful execution of the MTX. The SL oracle enables the SL-Chain to access blockchain and smart contract states on the destination execution environment.
SL-Chain High Level Workflow
The following is a high-level workflow of the SL-Chain, covering the process from UserMTX generation to SolverMTX selection and final on-chain submission. It provides a basic overview of how the Semantic Layer operates.
For more detailed explanations, please refer to the relevant sections for each component.
-
UserMTX Generation and Signing at the dApp Frontend: A user interacts with a dApp frontend, which generates ERC-4337 UserOperations based on the user's intent, and the ERC-4337 UserOperation is added to the EIP-712 object. Optionally, VSR address, VAR address, dApp operations, and other configurations can also be added to the EIP-712 object to create a UserMTX for the user to sign. Note that VAR and VSR are deployed by developers ahead of the time, and the UserMTX only includes the contract addresses of VAR and VSR instead of the code.
-
Submitting UserMTX to SL Nodes: The signed UserMTX is submitted by the dApp frontend to the SL nodes through the SL node API endpoint. The SL nodes will broadcast UserMTX to the entire network of connected solvers.
-
SolverMTX Submission: Each SL node connects with different sets of solvers. Solvers submit SolverMTXs containing the solver operations for the given UserMTX through their connected SL nodes.
-
SolverMTX Evaluation and Selection:
SolverMTXs go through two stages of evaluation and selection based on the VSR score defined in the UserMTX.
- Local Best SolverMTX Selection: Each SL node evaluates and selects the SolverMTX with the best VSR score among those it has received. The SL node submits this local best SolverMTX to SL-Chain for further processing.
- Global Best SolverMTX Selection: The SL-Chain receives the local best SolverMTXs from different nodes, with MTX processing precompiled contracts, the SL-Chain selects the global best SolverMTX (SolverMTX with the best VSR score) among the local best submissions.
-
On-Chain Submission: The MTX executor packages the global best SolverMTX with the corresponding UserMTX and submits it to the SL execution contract deployed on the destination execution environment using the builder precompile.