eth_sign - BSC

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

The eth_sign method requires the account to be unlocked on the node. It is not available on public RPC endpoints. Use client-side signing libraries (e.g., ethers.js, viem) for signing when using public RPCs.

The eth_sign method calculates an Ethereum-specific signature for the given data.

Parameters

Parameter
Type
Required
Description

address

string

Yes

Address to sign with

message

string

Yes

Data to sign (hex)

Returns

Field
Type
Description

result

string

Signature (65 bytes hex)

Request Example

curl
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_sign",
    "params": [
        "0x8D97689C9818892B700e27F316cc3E41e17fBeb9",
        "0x48656c6c6f20576f726c64"
    ],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Parameter
Type
Description

result

string

Signature (if supported)

error

object

Error for public RPCs

Use Cases

  • Message signing (local nodes)

  • Authentication systems

  • Off-chain signatures

Error Handling

Error Code
Description

-32601

Method not supported

-32000

Account not unlocked

SDK Integration

Last updated

Was this helpful?