Docs
Docs
Home
Getting Started
Agent Tooling
CLI
Supported Chains
Acala
Aptos
Arbitrum
Arc
Asset Hub
Astar
Avalanche
Base
Berachain
Bifrost
Binance Smart Chain
Bittensor
Blast
Boba Network
Bridge Hub
Celo
Centrifuge
Chiliz
Cronos
Enjin
Ethereum
Etherlink
Flow EVM Gateway
Gnosis
Hydration
Hyperliquid
Immutable
Ink
IoTeX
Kusama
Linea
LISK
Manta Atlantic
Manta Pacific
Mantle
MegaETH
Monad
Movement
Neuroweb
opBNB
Optimism
Plasma
Polkadot
Polygon
Pulsechain
Robinhood
Ronin
Scroll
Sonic
Starknet
Taiko
Tempo
Sui
TRON
Unichain
Viction
World Chain
XDC Network
XX Network
Zetachain
zkSync Era
Zora
Supported ChainsMantleMantle-Specific Methods

eth_estimateL1Fee - Estimate L1 data posting fee

Estimate L1 data posting fee on Mantle Network. Essential for understanding transaction costs on the modular L2 rollup.

Mantle RPC endpoint: endpoint URLs, plans and pricing.

Estimate L1 data posting fee on the Mantle network. This method helps calculate the additional cost of posting transaction data to Ethereum L1 via EigenDA as part of Mantle's modular L2 architecture.

Overview

Mantle's modular L2 is an optimistic rollup that periodically submits batched transaction data to Ethereum L1 through EigenDA for data availability. While most transaction execution happens on L2 with low gas costs paid in MNT, there's an additional fee component for the L1 data availability costs.

cURL request
curl -X POST https://api-mantle-mainnet.n.dwellir.com/YOUR_API_KEY \\
      -H "Content-Type: application/json" \\
      -d '{
        "jsonrpc": "2.0",
        "method": "eth_estimateL1Fee",
        "params": [
          {
            "from": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5",
            "to": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
            "gas": "0x5208",
            "gasPrice": "0x3b9aca00",
            "value": "0x1bc16d674ec80000",
            "data": "0x"
          }
        ],
        "id": 1
      }'

Implementation Example

Understanding L1 Fees on Mantle

Fee Components

  1. L2 Execution Fee: Standard gas cost for transaction execution on Mantle (paid in MNT)
  2. L1 Data Fee: Cost of posting transaction data to Ethereum L1 via EigenDA for data availability

Data Size Impact

L1 fees scale with transaction data size:

  • Simple transfers: Minimal L1 fee
  • Contract interactions: Moderate L1 fee based on calldata
  • Large data payloads: Significant L1 fee component

Cost Optimization Strategies

  1. Minimize Data: Reduce unnecessary data in transactions
  2. Batch Operations: Combine multiple operations into single transaction
  3. Use Events: Emit events instead of storing large data on-chain
  4. Optimize Encoding: Use efficient data encoding methods
  5. Leverage EigenDA: Benefit from efficient data availability

Common Use Cases

1. Transaction Cost Planning

JavaScript
// Plan transaction costs before execution
async function planTransactionCosts(transactions) {
  const feeEstimator = new MantleFeeEstimator(rpcUrl);
  const plans = [];
  
  for (const tx of transactions) {
    const breakdown = await feeEstimator.getFullFeeBreakdown(tx);
    plans.push({
      transaction: tx,
      estimatedCost: breakdown.totalEstimatedCost,
      l1FeeRatio: breakdown.breakdown.l1FeePercentage,
      recommendation: breakdown.breakdown.l1FeePercentage > 70 ? 
        'Consider batching or data optimization' : 'Cost efficient'
    });
  }
  
  return plans.sort((a, b) => a.estimatedCost - b.estimatedCost);
}

2. Data Optimization Analysis

Python
def optimize_contract_call_data(base_transaction, data_variations):
    """Find most cost-effective data encoding"""
    
    fee_estimator = MantleFeeEstimator(rpc_url)
    results = []
    
    for name, data in data_variations.items():
        tx = {**base_transaction, 'data': data}
        breakdown = fee_estimator.get_full_fee_breakdown(tx)
        
        results.append({
            'encoding': name,
            'data_size': len(data) // 2 - 1,  # Hex bytes
            'total_cost': breakdown['total_estimated_cost'],
            'l1_fee': breakdown['l1_fee'],
            'efficiency': breakdown['l1_fee'] / (len(data) // 2 - 1)
        })
    
    # Sort by total cost
    return sorted(results, key=lambda x: x['total_cost'])

Related Methods

  • eth_estimateGas - Estimate L2 execution gas
  • eth_gasPrice - Get current L2 gas price
  • eth_feeHistory - Historical fee data

Need help? Contact our support team or check the Mantle documentation.

eth_coinbase

Check the legacy eth_coinbase compatibility method on Mantle. Public endpoints may return an address, `unimplemented`, or another unsupported-method response depending on the client.

rollup_gasPrices - Get modular L2 gas price o...

Get modular L2 gas price oracle data on Mantle Network. Essential for understanding gas pricing on the optimistic rollup.

On this page

OverviewImplementation ExampleUnderstanding L1 Fees on MantleFee ComponentsData Size ImpactCost Optimization StrategiesCommon Use Cases1. Transaction Cost Planning2. Data Optimization AnalysisRelated Methods