Generating an ETH wallet key
December 1, 2026•
☕ Loading...
Every agent that pays for its own resources needs a private key, and every time I build one I re-decide how much to do it. The answer is always the same, so here is the note.
-
Generate a fresh EOA. One line with viem, no seed phrase. It is a hot wallet from birth.
node -e "const { generatePrivateKey, privateKeyToAccount } = require('viem/accounts'); const pk = generatePrivateKey(); console.log('WALLET_PRIVATE_KEY=' + pk); console.log('address: ' + privateKeyToAccount(pk).address)"The key just lived in your terminal — clear the scrollback, or pipe it straight into the secret store instead of printing it.
-
Fund it with the blast radius you accept. A few EURe on Base is often enough — and that balance is the real security boundary: it is the most a thief can take.
-
Store it where the agent runs. A serverless secret in production, a gitignored
.envfor local runs, nowhere else.
⏳ Loading reactions...
Comments
Loading comments...