Crates.io | btc-addgen |
lib.rs | btc-addgen |
version | 0.1.1 |
source | src |
created_at | 2024-07-26 19:01:51.088018 |
updated_at | 2024-07-26 19:03:16.430026 |
description | Bitcoin address generator |
homepage | |
repository | |
max_upload_size | |
id | 1316606 |
size | 21,328 |
This project is a Bitcoin address generator written in Rust. It leverages various cryptographic libraries to generate a Bitcoin address, along with the corresponding public and private keys. The project is designed to be installed and run via Cargo, the Rust package manager.
To install this project, ensure you have Rust and Cargo installed on your system. Clone this repository and navigate to its directory, then run the following command:
cargo build --release
To use the Bitcoin address generator, run the compiled binary with optional command-line arguments:
./target/release/bitcoin_address_generator [OPTIONS]
-p, --private-key <PRIVATE_KEY>
: Specify a private key in hexadecimal format.-v, --version <VERSION>
: Specify the version byte in hexadecimal format (e.g., 0x00
for mainnet).Generate a Bitcoin address with a random private key:
./target/release/bitcoin_address_generator
Generate a Bitcoin address using a specific private key and version:
./target/release/bitcoin_address_generator -p <PRIVATE_KEY> -v <VERSION>
Config
: Holds the configuration for the address generation, including optional private key and version.RunResult
: Represents the result of the address generation, including the private key, public key, and address.RunError
: Enum for handling errors during the address generation process.get_key_pair
: Generates a key pair (private and public key) based on the provided configuration.run
: The main function that performs the address generation process.The project relies on several external crates for cryptographic operations:
base58check
: For Base58Check encoding.rand
: For random number generation.ripemd
: For RIPEMD-160 hashing.secp256k1
: For elliptic curve operations.sha2
: For SHA-256 hashing.This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project uses various cryptographic libraries and builds upon standard Bitcoin address generation techniques. Special thanks to the authors of the base58check
, rand
, ripemd
, secp256k1
, and sha2
crates for their invaluable work.