Clef is a standalone signing tool included with go-ethereum. It manages keys and signs transactions as a separate process, so Geth never has direct access to private keys. All signing requests from Geth (or any other caller) are forwarded to Clef over IPC or HTTP, where they are logged, validated against an optional rules engine, and either auto-approved or presented to the user for manual confirmation.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.
Why use Clef
- Process isolation — private keys live only inside the Clef process; Geth cannot read them.
- Audit log — every signing request is written to an append-only audit log (
audit.logby default). - Rules-based signing — a JavaScript rules file can auto-approve routine requests without user interaction.
- Credential storage — account passwords are stored in Clef’s encrypted vault, not passed on the command line.
Initial setup
Initialize Clef
Before first use, Clef must generate a master seed used to encrypt its internal
storage (credentials, rule hashes, configuration).You will be prompted to set a master password. The seed is written to
~/.clef/masterseed.json.Start Clef
Point Clef at your keystore directory and specify the chain ID:Common chain IDs:
On startup, Clef opens an IPC endpoint (default
| Network | Chain ID |
|---|---|
| Mainnet | 1 |
| Holesky | 17000 |
| Sepolia | 11155111 |
| Hoodi | 560048 |
~/.clef/clef.ipc) and prints
connection details:Clef operations
Account listing
List all accounts in the keystore from the Clef CLI:Signing transactions
When a connected application (such as Geth) requests a transaction signature, Clef displays the transaction details and asks for approval:Signing messages (personal_sign)
Clef handlespersonal_sign requests in the same way — the message content and signing
account are displayed before the user is asked to approve.
The rules system
For automated workflows, Clef supports a JavaScript rules file. Each signing request invokes a corresponding JS function. The function can return:"Approve"— auto-approve without prompting the user."Reject"— auto-reject without prompting the user.- Anything else (or an error) — forward to the user for manual confirmation.
storage object for keeping state between
invocations, and a console object for logging.
Example: auto-approve account listing
Example: approve transfers below a weekly limit
Attesting a rule file
Clef will not load a rules file unless its SHA-256 hash has been explicitly registered (“attested”) in the secure configuration store. This prevents an attacker who can write files to disk from silently replacing your rules.Storing account passwords
For rules that need to auto-sign transactions (not just list accounts), Clef must be able to decrypt the key files without user input. Store the account password in Clef’s encrypted vault:Security model
Clef’s security properties depend on process isolation:- Geth communicates with Clef only through the IPC socket (or HTTP). It cannot call into Clef’s internal memory.
- Private keys are decrypted inside the Clef process only when a signing request is being processed, and are not retained in memory after use.
- The audit log records every request and response, giving an independent record of all signing activity.
- Rule file attestation ensures that the JavaScript policy code cannot be changed without the operator’s explicit knowledge.
Clef exposes a deliberately narrow External API to callers such as Geth. A richer
Internal API is available for building custom UI integrations (for example, a GUI that
communicates with Clef over stdio).
