Create Brain Wallet from Command Line
When it comes to protecting your Ethereum (ETH) wallet, having a Brain Wallet becomes essential. Brain Wallet is a unique wallet address that combines several private keys, making it virtually impossible to hack or steal your funds. Although creating a Brain Wallet is a complex process, I will show you a step-by-step solution using the command line.
What is a brain wallet?
Brain Wallet is an Ethereum wallet with multiple private keys and addresses. Each key is associated with a specific address, which allows you to manage your funds from different points of view (for example, the sender, the recipient or the account owner).
Creating a Brain Wallet from the Command Line: A Step-by-Step Guide
- Install the necessary tools

: You will need
opensslandxxd. Install them using your distribution’s package manager:
- In Ubuntu/Debian:
sudo apt-get install openssl xxd
- In Red Hat/CentOS/Fedora:
sudo dnf install openssl xxd
- Choose a wallet generation method: You can use the
cryptography' library or generate a Brain wallet usingLedger’ (if you have a Ledger device).
- Cryptography library: this method is more complex, but allows you to configure each key and address.
- Create a brain wallet with the Crypto Library
Cryptography library example (example.com)openssl genrsa -out brainwallet.key 2048 | openssl rsa -pubout -in brainwallet.key -out brainwallet.pub
echo "ecb:2048,base64:$(echo -n 'sausage' | xxd -r -p | sha256sum | awk '{print $1}' | rmd160 -x | blablabla)"
In this example, we generate an RSA private key and a public key using openssl. The generated keys will be used to create a brain wallet address.
- Generate Brain Wallet Address: Use the public key to generate a Brain Wallet address.
Example of using the cryptography library (example.com)echo "0x$(echo -n 'sausage' | xxd -r -p | sha256sum | awk '{print $1}' | rmd160 -x | blablabla)"
This will generate the Brain wallet address.
- Store and verify your Brain wallet: Store your private key securely and verify it with a tool like
opensslto generate the corresponding public key.
Checking the Brain wallet (on the example of the crypto library)echo "$1" | openssl rsa -pubout -in brainwallet.pub -out brainwallet_pubkey.pem
Using Ledger to Create Brain Wallet
If you have a Ledger device, you can use its built-in “Ledger” app to create a Brain wallet. Here is an example:
Create Brain Wallet (using Ledger)$ ledger brainwallet generate 2048 | xxd -r -p > brainwallet.bin
Conclusion
Creating a brain wallet from the command line is a viable solution, but it requires more complex steps and tools than using dedicated wallet software. However, for those who prefer to use “cryptography” or Ledger devices, these methods provide flexibility and control over each key and address.
Please note that creating a Brain Wallet is not as easy as using a web wallet, and appropriate security measures should always be taken when storing your private keys.
Leave a Reply