eth_sign- Arbitrum

Example code for the eth_sign JSON RPC method. Сomplete guide on how to use eth_sign JSON RPC in GetBlock Web3 documentation.

This method signs an arbitrary message using the private key of the given address. The message is prefixed following the Ethereum signed message standard before hashing and signing.

This method requires the account to be unlocked on the node or handled by a wallet provider such as MetaMask.

Parameters

Field
Type
Description

address

string

The account address that signs the message. Must be unlocked or handled by a wallet.

message

string

The raw message to sign (hex encoded or UTF-8 encoded).

Request

curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
   "jsonrpc": "2.0",
    "method": "eth_sign",
  "params": [
    "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
    "0x48656c6c6f20576f726c64"
  ],
    "id": "getblock.io"
}'

Response

Reponse Parameter Definition

Field
Description
Data Type

result

The hash of the submitted transaction, as a hexadecimal string.

String

Use case

The eth_sign method helps developers to:

  • Verify a user identity without sending a transaction

  • Implement login flows for dApps (Sign-in with Ethereum style)

  • Generate signatures for permit, authentication, and meta transactions

  • Build trustless systems where only message signatures (not transactions) are needed

Error handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS_TOKEN.

-3200

Unknown account

  • Invalid account address

  • user rejected request

  • message must be hex or string

Integration with Web3

The eth_sign method enables developers to:

  • Implement secure message signing with intuitive UX

  • Build login or authorization flows for any dApp

  • Create contract interactions that rely on signed messages

  • Validate signed payloads on servers or smart contracts

  • Use MetaMask or WalletConnect to sign and broadcast actions securely

Last updated

Was this helpful?