Crates.io | ragnar |
lib.rs | ragnar |
version | 0.1.1 |
source | src |
created_at | 2023-09-18 06:15:02.58667 |
updated_at | 2023-09-18 06:39:10.929314 |
description | A command line tool for generating BIP39 mnemonic phrases and deriving BIP32 HD wallets. |
homepage | |
repository | https://github.com/richardanaya/ragnar |
max_upload_size | |
id | 975602 |
size | 22,902 |
Ragnar is a command-line interface (CLI) tool written in Rust, designed to generate secure Bitcoin private keys from 12-word mnemonic phrases. This codebase was created to easily show how this is done in the most minimal way possible.
BIP-39 (Bitcoin Improvement Proposal 39) is a protocol that describes the implementation of a mnemonic code or mnemonic sentence—a group of easily readable words—to serve as a back-up or seed for deterministic wallets. These mnemonic sentences are mathematically related to your wallet's private key, providing a human-readable format that is easier to write down or memorize than a raw binary or hexadecimal string.
A 12-word mnemonic of BIP-39 generates 128 bits of entropy. The security level provided by 128 bits of entropy is considered to be strong and adequate for most cryptographic purposes. To put the security level into perspective: using the most advanced supercomputers, it would take longer than the age of the universe to brute-force a 128-bit entropy.
cargo install ragnar
To generate a Bitcoin private key, execute the Ragnar CLI and pass your 12-word mnemonic phrase as an argument:
ragnar -m "word1 word2 word3 ... word12"
The CLI will then output the corresponding Bitcoin private key (starts with letters "xprv"), calculated based on the BIP-39 specification.
ragnar
Will simply generate random 12 words and a private key. If you ever need to generate the private key, you'll have to remember the 12 words and put them in using the above method.
ragnar --help
Can give you additional info.
Feel free to contribute to Ragnar by submitting pull requests or reporting bugs and suggestions as GitHub issues.
Ragnar is released under the MIT License. Check out the LICENSE file for more information.