Crates.io | stellar_vanity |
lib.rs | stellar_vanity |
version | 0.9.0 |
source | src |
created_at | 2018-03-27 04:45:26.865392 |
updated_at | 2021-11-23 05:52:53.306156 |
description | A simple CLI for generating Stellar vanity addresses |
homepage | |
repository | https://github.com/robertDurst/stellar-vanity-address-generator |
max_upload_size | |
id | 57676 |
size | 51,238 |
A simple CLI tool to generate Stellar vanity addresses.
Vanity Address: similar to a vanity license plate, a vanity cryptocurrency address is an address where either the beginning (prefix) or end (postfix) is a special or meaningful phrase. Generating such an address requires work.
Benchmarking is performed by using criterion.rs via cargo bench
, which executes the benches/benchmark.rs
file.
Ah, thanks so much! I have limited computing power (if you do too... do not attempt, will likely be long and costly)
git clone https://github.com/robertDurst/stellar-vanity-address-generator.git
cd stellar-vanity-address-generator
cargo bench
Benchmark Configurations:
Note: this uses num_cpus::get()
from num_cpus to determine the maximum number of cores availible. If that is not desired, you'll have to dig in and set this number manually... or open a pr if you know how to pass CLI args to cargo bench
:)
use stellar_vanity::vanity_key::AddressGenerator, deserialize_public_key};;
let mut generator: AddressGenerator = Default::default();
let keypair = generator.find(|key| {
let public = deserialize_public_key(key);
// any conditions go here
public.as_str().ends_with("RUST") // e.g. find address with the "RUST" suffix
});
This will continuously loop until a key with the desired properties is found. Once the vanity address is found, a keypair will be returned, which may be deserialized with deserialize_public_key
and deserialize_private_key
respectively. Note, this is a synchronous function.
cargo run -- [--postfix=<POSTFIX>] [--prefix=<PREFIX>] [-c=<NUMBER_OF_THREADS>]
Either `--postfix` or `--prefix` option is required, while thread count is optional.
As an example, the following looks for an address ending in pizza with 8 threads:
cargo run -- -c=8 --postfix=pizza
The --prefix
and --postfix
options will search using RegEx expressions. You may need to enclose the expression in quotes when running from the command-line.
The following looks for an address ending in joe with a number before it, using 8 threads:
cargo run -- -c=8 --postfix='[0-9]joe'