Skip to main content

eth_signTransaction

Overview

The 'eth_signTransaction' method allows users to sign a transaction with a specific private key.

Request

{
"jsonrpc": "2.0",
"method": "eth_signTransaction",
"id": 1,
"params": [
{
"from": "0x...",
"to": "0x...",
"gas": "0x...",
"gasPrice": "0x...",
"value": "0x...",
"data": "0x..."
}
]
}

Request Parameters

  • from: The address the transaction is sent from.
  • to: (optional for contract creation) The address the transaction is directed to.
  • gas: (default: 90000) The integer of the gas provided for the transaction execution.
  • gasPrice: The integer of the gasPrice used for each paid gas, in wei.
  • value: The integer of the value sent with this transaction, in wei.
  • data: The compiled code of a contract or the hash of the invoked method signature and encoded parameters.

Response

{
"transaction": {
"from": "0x...",
"to": "0x...",
"gas": "0x...",
"gasPrice": "0x...",
"value": "0x...",
"data": "0x..."
}
}