Owner: @Thomas Lavaur @David Rusu

Reviewers: 🟢@Giacomo Pasini 🟢@Mehmet 🟢@Álvaro Castro-Castilla 🟢@Marcin Pawlowski 🟢@Daniel Sanchez Quiros 🟢@Gusto Bacvinka 🟢@Youngjoon Lee

Introduction

Mantle is a foundational element of Bedrock, designed to provide a minimal and efficient execution layer that connects together Nomos Services in order to provide the necessary functionality for Sovereign Rollups. It can be viewed as the system call interface of Bedrock, exposing a safe and constrained set of Operations to interact with lower-level Bedrock services, similar to syscalls in an operating system.

Mantle Transactions provide Operations for interacting with Nomos Services. For example, a Sovereign Rollup node posting an update to Bedrock, or a node operator declaring its participation in the Blend Network, would be done through the corresponding Operations within a Mantle Transaction.

Mantle manages assets using a Note-based ledger that follows an UTXO model. Each Mantle Transaction includes a Ledger Transaction, and any excess balance serves as the fee payment.

Overview

Mantle Transaction

The features of Nomos are exposed through Mantle Transactions. Each transaction can contain zero or more Operations and one Ledger Transaction. Mantle Transactions enable users to execute multiple Operations atomically. The Ledger Transaction serves two purposes: it can pays the transaction fee and allows users to issue transfers.

Mantle Operations

Nomos features are exposed through Mantle Operations, which can be combined and executed together in a single Mantle Transaction. These Operations enable functions such as on-chain data posting, SDP interaction, and leader reward claims.

Mantle Ledger

The Mantle Ledger enables asset transfers using a transparent UTXO model. While a Ledger Transactions can consume more NMO than it creates, the Mantle Transaction excess balance must exactly pay for the fees.

Transaction Fees

Mantle Transaction fees are derived from a gas model. Nomos has three different Gas markets, accounting for permanent data storage, ephemeral data storage through DA, and execution costs. Permanent data storage is paid at the Mantle Transaction level, while ephemeral data storage is paid at the Blob Operation level. Each Operation and Ledger Transaction has an associated Execution Gas cost. Users can specify their Gas prices in their Mantle Transactions or in the Blob Operation to incentivize the network to include their transaction.

Gas Market Charged On Pricing Basis
Execution Gas Ledger Transaction and Operations Fixed per Operation
Permanent Storage Gas Signed Mantle Transaction Proportional to encoded size
DA Storage Gas Blob Operation Proportional to blob size

Mantle Transaction

Mantle Transactions form the core of Mantle, enabling users to combine multiple Operations to access different Nomos functions. Each transaction contains zero or more Operations plus a Ledger Transaction. The system executes all Operations atomically, while using the Mantle Transaction's excess balance—calculated as the difference between consumed and created value— as the fee payment.

class MantleTx:
	  ops: list[Op]
	  ledger_tx: LedgerTx                   # excess balance is used for fee payment
  	permanent_storage_gas_price: int      # 8 bytes
  	execution_gas_price: int              # 8 bytes
	
class Op:
	  opcode: byte
	  payload: bytes

def mantle_txhash(tx: MantleTx) -> zkhash:
    h = Hasher()  # zk hash
    h.update(b"NOMOS_MANTLE_TXHASH_V1")
    
    for op in tx.ops:
        h.update(op.opcode)
        h.update(op.payload) # as a slice of 31-byte elements.

		h.update(b"END_OPS")

		h.update(tx.permanent_storage_gas_price.to_bytes(8, byteorder='little'))
		h.update(tx.execution_gas_price.to_bytes(8, byteorder='little'))

    h.update(ledger_txhash(ledger_tx))

    return h.digest()

The hash function used, as well as other cryptographic primitives like ZK proofs and signature schemes, are described in Common Cryptographic Components.