Docs
Supported ChainsMantleJSON-RPC APITransaction Methods

eth_signTransaction - Mantle RPC Method

Sign a transaction without broadcasting it on Mantle. Public shared RPC endpoints commonly return deprecation, unsupported-method, or account-management errors because they do not keep unlocked signers.

Signs a transaction with the private key of the specified account on Mantle without submitting it to the network.

Why Mantle? Build on the world's largest ZK rollup by TVL with $2.5B+ secured and deep Bybit integration with near-instant ZK finality via OP Succinct, $6.2B treasury backing, mETH liquid staking, and 25% Bybit trading fee discounts.

Security Warning: Public Dwellir endpoints do not keep unlocked signers. On shared infrastructure, eth_signTransaction commonly returns a deprecation, unsupported-method, or account-management error instead of a signed payload. For production use, sign transactions client-side using libraries like ethers.js or web3.py, then broadcast with eth_sendRawTransaction.

When to Use This Method

eth_signTransaction is relevant for DeFi developers, liquid staking builders, and teams seeking institutional exchange integration in limited scenarios:

  • Understanding the Signing Flow — Learn how transaction signing works before implementing client-side signing
  • Local Development — Sign transactions on a local dev node (Hardhat, Anvil, Ganache) where accounts are unlocked
  • Offline Signing Workflows — Generate signed transaction payloads for later broadcast

Request Parameters

Request
fromDATA (20 bytes)

Address of the account to sign with (must be unlocked)

toDATA (20 bytes)

Recipient address (omit for contract creation)

gasQUANTITY

Gas limit for the transaction (default: 90000)

gasPriceQUANTITY

Gas price in wei (legacy transactions)

valueQUANTITY

Value to send in wei

dataDATA

Compiled contract code or encoded method call

nonceQUANTITY

Transaction nonce (defaults to eth_getTransactionCount)

Response Body

Response
rawDATA

The RLP-encoded signed transaction, ready for eth_sendRawTransaction

txObject

The transaction object including v, r, s signature fields

Code Examples

Bash
# Local dev node only. Public Dwellir endpoints do not expose unlocked-account signing.
curl -X POST http://127.0.0.1:8545 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_signTransaction",
    "params": [{
      "from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1",
      "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
      "gas": "0x76c0",
      "gasPrice": "0x9184e72a000",
      "value": "0x9184e72a",
      "nonce": "0x0"
    }],
    "id": 1
  }'

Common Use Cases

1. Offline Transaction Signing

Sign transactions on an air-gapped machine for later broadcast:

JavaScript
import { Wallet } from 'ethers';

async function createSignedTransaction(privateKey, to, value, { chainId, nonce, gasLimit }) {
  const wallet = new Wallet(privateKey);
  const tx = {
    to,
    value,
    gasLimit,
    nonce,
    chainId,
  };

  const signedTx = await wallet.signTransaction(tx);
  // Store signedTx and broadcast from an online machine
  return signedTx;
}

2. Batch Transaction Preparation

Pre-sign multiple transactions for sequential submission on Mantle:

JavaScript
async function prepareBatch(wallet, transactions) {
  const signed = [];

  for (let i = 0; i < transactions.length; i++) {
    const tx = {
      ...transactions[i],
      nonce: baseNonce + i
    };
    signed.push(await wallet.signTransaction(tx));
  }

  return signed; // Submit via eth_sendRawTransaction in order
}

Error Handling

Common errors and solutions:

Error CodeDescriptionSolution
-32000Deprecated, unavailable, or account not unlockedUse client-side signing instead of node-side signing
-32601Method not foundMethod disabled on this node — use client-side signing
-32602Invalid paramsVerify transaction fields (from, to, gas, etc.)
-32603Internal errorCheck node logs for signing failures