@bsv/rando
v1.0.3
Published
Generate BSV private keys with user-generated entropy
Downloads
375
Readme
@bsv/rando
Generate BSV private keys with user-generated entropy.
Description
rando is a command-line tool that creates Bitcoin SV (BSV) private keys by combining user-generated entropy with system randomness. This approach ensures high-quality randomness for secure key generation.
Installation
npm install -g @bsv/randoOr use directly with npx:
npx @bsv/randoUsage
Simply run the command:
randoYou will be prompted to type random characters to add entropy:
Please type random characters to add entropy (press Enter when done):
>Type any random characters you like, then press Enter. The tool will:
- Hash your input using SHA-256
- Generate 32 bytes of system randomness
- XOR combine both sources for maximum entropy
- Generate a BSV private key from the combined entropy
- Save the key and display the results
Output
The command will display:
- wif: Wallet Import Format (WIF) private key
- private: Private key in hexadecimal format
- address: The corresponding BSV address
Example output:
{
wif: 'L2vJK...',
private: '8f3a...',
address: '1A1zP1...'
}Where Files Are Saved
Private keys are automatically saved to:
~/.wifs/Each key is saved in a file named after its address:
~/.wifs/<address>.keyFor example:
~/.wifs/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa.keyThe file contains the WIF (Wallet Import Format) private key.
Security Notes
Intended Use
This tool is designed for generating keys for small, casual amounts of BSV - amounts that wouldn't be worth the effort of hacking into your laptop to obtain. Think of it as a convenient tool for:
- Testing and development
- Small transactions
- Casual everyday use
- Learning and experimentation
For Large Amounts
If you plan to store significant amounts of BSV, this tool is NOT appropriate. Instead, you should:
- Use a dedicated, air-gapped computer that has never been connected to the internet
- Generate keys on that isolated system
- Never connect that system to any network
- Follow industry best practices for cold storage
The security of keys generated on an internet-connected laptop is fundamentally limited by the security of that laptop. Any malware, keyloggers, or compromise of your system could potentially expose your keys.
General Security
- Keep the
~/.wifs/directory secure and backed up - Never share your private keys with anyone
- The combination of user and system entropy provides strong randomness
- Make sure to provide truly random input when prompted
- Remember: your keys are only as secure as the computer they're generated on
License
Apache-2.0
