Skip to content

privkeyio/vain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vain

A fast vanity pubkey miner for Nostr.

What

Generate Nostr keypairs where the pubkey matches your desired prefix:

npub1swag...

Install

Requires c3c and libnostr-c.

# Build and install libnostr-c
git clone https://github.com/privkeyio/libnostr-c
cd libnostr-c
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DNOSTR_FEATURE_RELAY=OFF
make && sudo make install
cd ../..

# Build vain
git clone https://github.com/privkeyio/vain
cd vain
c3c build

Usage

# Hex prefix
./nostr-vanity dead

# npub prefix
./nostr-vanity --npub kyle

# More threads, JSON output
./nostr-vanity -t 8 -f json cafe

Options

-t, --threads <N>      Number of threads (default: 4)
-f, --format <FMT>     Output: hex, bech32, json (default: bech32)
-n, --npub             Match against npub instead of hex
-c, --case-insensitive Case-insensitive matching (hex only)
-q, --quiet            Suppress progress output

Notes

For npub matching, characters b, i, o, 1 are not valid bech32 and cannot be used.

Benchmarks

Single-threaded comparison:

vain:                   ~50,000 keys/sec  (~20,000 ns/op)
rana (Rust):            ~50,000 keys/sec  (~20,000 ns/op)
vanity-npub (Go):       ~31,000 keys/sec  (~32,000 ns/op)

See rana and vanity-npub.

vain
├─ 1 thread:   ~50,000 keys/sec
├─ 4 threads: ~170,000 keys/sec
└─ 8 threads: ~300,000 keys/sec

License

MIT

About

Nostr public key mining tool

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages