Key file format
Key files are named using the convention:Default keystore location
You can override the location with
--keystore <path> or --datadir <path> when
starting geth.
Key files are portable. You can safely copy the entire keystore directory or individual
key files between Ethereum nodes without any conversion.
Managing accounts with the geth CLI
1
Create a new account
2
List existing accounts
3
Import a raw private key
To import an unencrypted private key stored in a hex file:The key file must contain the unencrypted private key in hexadecimal format. Geth
encrypts it with a new password and saves it to the keystore.
4
Update an account (change password or migrate format)
Backing up and restoring accounts
Key files are self-contained. To back up an account, copy its key file from the keystore directory. To restore, place the file back in the keystore directory of any Geth instance.The —unlock flag (deprecated)
Older versions of Geth supported an--unlock flag that decrypted and held private keys
in memory for the duration of a running node. This flag is deprecated and has no
effect in current versions of Geth. Do not rely on it, and do not build tooling that
expects accounts to be unlocked via the node process.
For programmatic signing, use Clef instead.
HD wallet derivation
Geth supports BIP-44 hierarchical deterministic (HD) wallets for hardware wallet integration. The standard Ethereum derivation path is:
The coin type
60' is the SLIP-44 identifier assigned to Ethereum.
Hardware wallet support
Geth includes native USB drivers for:- Ledger hardware wallets
- Trezor hardware wallets (HID and WebUSB)
accounts.Wallet interface as keystore accounts. No
additional configuration is required.
