Pre-alphaWork in progress
Skip to content

eth_signTransaction ​

Signs a transaction with the key of an account held by the node, without sending it.

Ethereum specification · All supported methods

Parameters ​

Parameters are positional, in the order below.

ParameterTypeRequiredDescription
TransactionTransaction objectYesThe transaction to sign. See the fields below.

Transaction fields ​

FieldMeaning
fromAddress of the account that signs and sends the transaction
toRecipient address; omit to deploy a contract
gasGas limit as a hexadecimal quantity
maxFeePerGas, maxPriorityFeePerGasEIP-1559 fee caps as hexadecimal quantities; or gasPrice for a legacy transaction
valueAmount in wei as a hexadecimal quantity
dataCall data or contract creation code as hexadecimal bytes
nonceAccount nonce as a hexadecimal quantity; filled in by the node if omitted

Return value ​

The signed transaction as hexadecimal bytes, ready for eth_sendRawTransaction.

Example ​

Replace <gateway-url> with your gateway base URL and <service-url> with the chain’s service path, such as service/ethereum.

sh
curl -X POST "<gateway-url>/<service-url>" \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_signTransaction","params":[{"from":"0xc94770007dda54cF92009BFF0dE90c06F603a09f","to":"0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas":"0x5208","maxFeePerGas":"0x2540be400","maxPriorityFeePerGas":"0x3b9aca00","value":"0x9184e72a","nonce":"0x0"}]}'

Illustrative response; values depend on the selected network and request:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x02f8730180843b9aca008502540be40082520894d46e8dd67c5d32be8058bb8eb970870f07244567849184e72a80c080a0c8d8d4f6a8a1b7e0f5d2b6c3a9e4f1d7b2c8e5a0f3d6b9c1e4a7f0d3b6c9e2a5f8a07b1e4d9c2f5a8b0e3d6c9f2a5b8e1d4c7f0a3b6e9d2c5f8a1b4e7d0c3f6a9b2e5"
}

Unstoppable Infrastructure.