Solana vanity address generator in C. GPU-accelerated via Metal on Apple Silicon.
| Mode | Throughput | Method |
|---|---|---|
| Seed | 357M/s | Metal GPU + ARM SHA-256 hardware |
| Keypair | 17M/s | Metal GPU ed25519 scalar multiply |
Benchmarks on Apple M1 Pro. Scales linearly across multiple Macs via built-in TCP distribution.
Requires libsodium:
brew install libsodium
# CPU only
make
# CPU + Metal GPU (recommended on Apple Silicon)
make ENABLE_METAL=1Generates ed25519 keypairs. Output is Solana CLI compatible.
# Find address starting with "pipe"
./vain keypair -p pipe
# Case-insensitive, find 3 matches
./vain keypair -p dave -i -c 3
# Prefix + suffix
./vain keypair -p ab -s xyzOutput:
address: pipeMXQicFoESLebuk5TCMgwGQkhytF14HQ7ez1HxSJ
seed: eff3550d4e6559fa...
keypair: [239,243,85,13,...,180,215]
Save the keypair line to a JSON file for use with Solana CLI:
./vain keypair -p cool 2>/dev/null | grep keypair | sed 's/keypair: //' > wallet.json
solana-keygen pubkey wallet.jsonGrinds CreateAccountWithSeed seeds — much faster (SHA-256 only, no curve math).
./vain seed -p abc -b <base_pubkey> -o <owner_pubkey>-p <str> Base58 prefix to match
-s <str> Base58 suffix to match
-i Case-insensitive matching
-t <N> CPU thread count (default: all cores)
-c <N> Number of matches to find (default: 1)
-b <pubkey> Base public key (seed mode)
-o <pubkey> Owner program public key (seed mode)
Run across multiple Macs over the network. Each machine uses its own CPU + GPU.
# Coordinator (parses args, accepts workers, grinds locally)
./vain keypair -p pipeNetwork --listen 9999
# Workers (connect, receive config, grind)
./vain keypair --connect 192.168.1.10:9999
./vain keypair --connect 192.168.1.10:9999 # add as many as you wantThroughput scales linearly. First match from any machine stops all nodes.
src/main.c CLI, pthreads, matching, output
src/base58.c Firedancer O(1) base58 encoder + decoder
src/sha256_arm.c ARM Crypto Extensions SHA-256
src/net.c TCP coordinator/worker distribution
src/grind_seed.metal Metal GPU kernel (SHA-256 + base58)
src/grind_keypair.metal Metal GPU kernel (ed25519 + base58)
src/metal_grind.m Metal host code (Obj-C)
- Firedancer base58: precomputed table encoder, O(1) vs O(n²) division
- Partial prefix check: early reject from first intermediate digits
- ARM SHA-256: hardware crypto extensions for seed mode
- SHA-512 precomputation: constant padding precomputed for keypair mode
- Montgomery batch inversion: 8 keypairs share one
fe_inverton GPU - Chain PRNG: SHA-512 output reuse eliminates RNG calls on GPU
- Double-buffered Metal dispatch: overlaps GPU execution with result checking