The keystore is Geth’s built-in mechanism for storing Ethereum private keys on disk as encrypted JSON files. Each account corresponds to a single key file whose private key is protected by a password using the Web3 Secret Storage specification (scrypt KDF by default).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ethereum/go-ethereum/llms.txt
Use this file to discover all available pages before exploring further.
Key file format
Key files are named using the convention:Default keystore location
| Platform | Default path |
|---|---|
| Linux | ~/.ethereum/keystore |
| macOS | ~/Library/Ethereum/keystore |
| Windows | %APPDATA%\Ethereum\keystore |
--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
Create a new account
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.
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:| Path | Description |
|---|---|
m/44'/60'/0'/0 | Root path (legacy Ledger) |
m/44'/60'/0'/0/0 | First account (standard base path) |
m/44'/60'/0'/0/1 | Second account, etc. |
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.
