Pre-alphaWork in progress
Skip to content

personal_importRawKey ​

Imports an unencrypted private key into the node’s keystore, encrypted with a passphrase.

Geth reference · All supported methods

Parameters ​

Parameters are positional, in the order below.

ParameterTypeRequiredDescription
KeyHexadecimal bytesYesThe private key, without the 0x prefix.
PassphraseStringYesEncrypts the key in the keystore.

Return value ​

The imported account’s 20-byte address.

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":"personal_importRawKey","params":["<private key>","<passphrase>"]}'

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

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

Unstoppable Infrastructure.