A fast vanity pubkey miner for Nostr.
Generate Nostr keypairs where the pubkey matches your desired prefix:
npub1swag...
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# Hex prefix
./nostr-vanity dead
# npub prefix
./nostr-vanity --npub kyle
# More threads, JSON output
./nostr-vanity -t 8 -f json cafe-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
For npub matching, characters b, i, o, 1 are not valid bech32 and cannot be used.
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
MIT