⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

Mantle Network - Build on the First Modular Layer 2

Chain RPC
With Dwellir, you get access to our global Chain network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.

Get your API key →

Why Build on Mantle?

Mantle Network is the first modular Layer 2 solution, pioneering the use of EigenDA for data availability. Built on the OP Stack with innovative architectural designs, Mantle offers:

Modular Performance

  • Sub-second block times - Fast finality with optimistic rollup
  • Up to 500x lower costs than Ethereum mainnet
  • 20,000+ TPS capacity - High throughput for demanding applications

🔒 Advanced Security

  • EigenDA integration - First L2 with decentralized data availability
  • Optimistic rollup security - Fraud proof protection with 7-day challenge period
  • Ethereum inheritance - Full L1 security guarantees

🛠️ Developer Excellence

  • Full EVM compatibility - Deploy existing contracts without changes
  • MNT gas token - Native token for gas and governance
  • OP Stack foundation - Battle-tested infrastructure

Quick Start with Mantle

Connect to Mantle in seconds with Dwellir's optimized endpoints:

🔗 RPC Endpoints

Mantle Mainnet (Chain ID: 5000)Live
https://api-mantle-mainnet.n.dwellir.com/YOUR_API_KEY
✓ Archive Node✓ Trace API✓ Debug API✓ WebSocket

Quick Connect:

curl -X POST https://api-mantle-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Installation & Setup

import { JsonRpcProvider } from 'ethers';

// Connect to Mantle mainnet
const provider = new JsonRpcProvider(
'https://api-mantle-mainnet.n.dwellir.com/YOUR_API_KEY'
);

// Get network info
const network = await provider.getNetwork();
console.log('Connected to Mantle:', network.chainId); // 5000

// Query blockchain data
const blockNumber = await provider.getBlockNumber();
const balance = await provider.getBalance('0x...');
const gas = await provider.getFeeData();

Network Information

Mainnet Configuration

Testnet Configuration (Sepolia)

Available RPC Methods

Available JSON-RPC Methods

📊 Reading Blockchain Data

Query blocks, transactions, and account states

+

📤 Sending Transactions

Submit and manage transactions

+

📝 Smart Contract Interaction

Call and interact with smart contracts

+

🔧 Node & Network Info

Query node status and network information

+

Ready to integrate Base into your dApp?

Get your API key →

Mantle supports all standard Ethereum JSON-RPC methods plus L2-specific extensions:

Core Methods

  • Transaction Management - Send, sign, and track transactions
  • State Queries - Get balances, code, storage
  • Block Information - Query blocks and receipts
  • Event Logs - Filter and retrieve events
  • Gas Estimation - Estimate fees including L1 costs

L2-Specific Methods

  • eth_estimateL1Fee - Calculate L1 data posting costs
  • rollup_gasPrices - Get current L1/L2 gas prices
  • rollup_getInfo - Query rollup configuration

Debug & Trace Methods

  • debug_traceTransaction - Detailed transaction execution traces
  • debug_traceBlock - Trace all transactions in a block
  • debug_traceCall - Simulate and trace calls

Architecture Overview

Modular Design

Mantle's modular architecture separates core blockchain functions for optimal performance:

  1. Execution Layer - Processes transactions using the EVM
  2. Settlement Layer - Posts state commitments to Ethereum
  3. Data Availability Layer - Uses EigenDA for efficient data storage
  4. Consensus Layer - Inherits security from Ethereum L1

EigenDA Integration

As the first L2 to integrate EigenDA, Mantle benefits from:

  • Lower costs - Reduced data storage expenses
  • Higher throughput - More efficient data availability
  • Decentralization - Distributed DA layer
  • ETH restaking - Additional security through EigenLayer

Transaction Lifecycle

  1. Submission - Users submit transactions to Mantle sequencer
  2. Execution - Transactions processed in batches
  3. Data Posting - Transaction data posted to EigenDA
  4. Settlement - State root submitted to Ethereum L1
  5. Finality - After 7-day challenge period

Development Resources

Smart Contract Deployment

Deploy your contracts to Mantle without modifications:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract MantleApp {
mapping(address => uint256) public balances;

function deposit() public payable {
balances[msg.sender] += msg.value;
}

function withdraw(uint256 amount) public {
require(balances[msg.sender] >= amount, "Insufficient balance");
balances[msg.sender] -= amount;
payable(msg.sender).transfer(amount);
}
}

Using MNT Token

MNT is used for gas payments on Mantle:

// Send MNT
const tx = await signer.sendTransaction({
to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
value: ethers.parseEther('1.0') // 1 MNT
});

// Estimate gas in MNT
const gasEstimate = await provider.estimateGas(tx);
const gasPrice = await provider.getFeeData();
const gasCost = gasEstimate * gasPrice.gasPrice; // Cost in MNT

Bridging Assets

Bridge assets between Ethereum and Mantle:

// Bridge configuration
const BRIDGE_ADDRESS = '0x...'; // Mantle Bridge contract
const L1_TOKEN = '0x...'; // Token on Ethereum
const L2_TOKEN = '0x...'; // Token on Mantle

// Deposit from L1 to L2
async function depositToMantle(amount) {
const bridge = new Contract(BRIDGE_ADDRESS, BRIDGE_ABI, l1Signer);
const tx = await bridge.depositERC20(
L1_TOKEN,
L2_TOKEN,
amount,
{ value: bridgeFee }
);
await tx.wait();
}

Gas Optimization

Understanding Mantle Fees

Mantle fees consist of two components:

  1. L2 Execution Fee - Cost to run transaction on Mantle
  2. L1 Data Fee - Cost to post data to Ethereum (via EigenDA)
// Calculate total fee
const l2GasPrice = await provider.getGasPrice();
const l2GasUsed = await provider.estimateGas(tx);
const l1Fee = await provider.send('eth_estimateL1Fee', [tx]);

const totalFee = (l2GasPrice * l2GasUsed) + BigInt(l1Fee);
console.log('Total fee:', ethers.formatEther(totalFee), 'MNT');

Optimization Tips

  1. Batch Operations - Combine multiple operations in one transaction
  2. Use Events - Cheaper than storage for data that doesn't need to be on-chain
  3. Optimize Calldata - Minimize transaction input data
  4. Storage Packing - Pack multiple values into single storage slots

Common Use Cases

DeFi Protocols

  • Lower fees enable more frequent rebalancing and smaller trades
  • High throughput supports order book DEXs
  • Fast finality improves user experience

Gaming & NFTs

  • Affordable minting and trading
  • High-frequency game actions
  • Complex on-chain game logic

DAOs & Governance

  • Cost-effective voting
  • More frequent proposal submissions
  • On-chain treasury management

Best Practices

Error Handling

try {
const tx = await contract.someMethod();
const receipt = await tx.wait();

if (receipt.status === 0) {
throw new Error('Transaction reverted');
}
} catch (error) {
if (error.code === 'CALL_EXCEPTION') {
console.error('Contract reverted:', error.reason);
} else if (error.code === 'INSUFFICIENT_FUNDS') {
console.error('Not enough MNT for gas');
}
}

Rate Limiting

// Implement exponential backoff
async function retryWithBackoff(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (i === maxRetries - 1) throw error;

const delay = Math.pow(2, i) * 1000;
await new Promise(resolve => setTimeout(resolve, delay));
}
}
}

Support & Resources

Official Resources

Dwellir Support

Start Building

Ready to build on Mantle? Get your free API key and start developing:

🚀 Launch Your Mantle dApp Today

Get instant access to Mantle's modular L2 with our high-performance RPC endpoints

Get Your Free API Key →


Need help? Check our API reference or contact support.