Owner: @Thomas Lavaur @David Rusu

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

Introduction

The Mantle is a foundational element of the 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 and Zones. 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.

The Mantle Transactions provide operations for interacting with Nomos Services. For example, a sequencer posting a zone or rollup 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.

The Mantle manages assets using a Note-based ledger that follows the UTXO model. Each Mantle Transaction includes a Ledger Transaction, and any excess balance from this transaction 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 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 individual Ledger Transactions can consume more NMO than they create, the total NMO must remain conserved at the block level.

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 is paid at the Blob Operation level. Each Operation and Ledger Transaction has an associated execution gas value. Users can bid on 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
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 the 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 Ledger 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
  	storage_gas_price: int      # 8 bytes
  	execution_gas_price: int    # 8 bytes
	
class Op:
	  opcode: byte
	  payload: bytes

def mantle_txhash(tx: MantleTx) -> hash:
    h = Hasher()
    h.update(b"NOMOS_MANTLE_TXHASH_V1")
    
    for op in tx.ops:
        h.update(op.opcode)
        h.update(op.payload)

		h.update(b"END_OPS")

		h.update(tx.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 proof and signature schemes) is described in Common Cryptographic Components.