A blazing-fast GPU-accelerated Solana vanity address generator written in Zig with Metal compute shaders.
- ๐ฎ GPU Acceleration - Metal compute shaders for parallel key generation
- ๐ High Performance - 2+ Million keys per second on M1/M2/M3 Max
- ๐ฏ Flexible Pattern Matching - Starts-with, ends-with, or both
- ๐ข Target Counts - Generate multiple addresses per pattern
- ๐ Case Options - Case-sensitive or case-insensitive matching
- ๐พ Auto-Save - Found keypairs saved to JSON files
- ๐ฅ๏ธ CLI Interface - Similar to
solana-keygen grind - ๐ macOS Native - Optimized for Apple Silicon (Metal)
- โ Optimized Performance - Fixed-Base Comb optimization yields ~2M keys/s (8x speedup)
- โ
Complete CLI Rewrite - Now supports
--starts-with,--ends-with,--starts-and-ends-with - โ Metal GPU Backend - Real GPU acceleration with Verified 64-bit Ed25519
- โ Multiple Patterns - Search for multiple patterns simultaneously
- โ Target Counts - Specify how many matches you want per pattern
- โ
JSON Output - Each found keypair saved to
<ADDRESS>.json
- Zig 0.15.2
- macOS with Metal support (for GPU acceleration)
# Build optimized release binary
zig build -Doptimize=ReleaseFast --global-cache-dir ./.zig-global-cache
# Run directly
zig build run --global-cache-dir ./.zig-global-cache -- --starts-with ABC:1Note: Use
--global-cache-dirif you encounter permission issues with Zig cache.
To install grincel for global usage:
- Build the release binary:
zig build -Doptimize=ReleaseFast
- The executable will be located at
zig-out/bin/grincel. - Add it to your PATH or copy it to a bin directory:
cp zig-out/bin/grincel /usr/local/bin/
- Verify installation:
grincel --help
# Find one address starting with "SOL"
zig build run -- --starts-with SOL:1
# Find 5 addresses ending with "ANA"
zig build run -- --ends-with ANA:5
# Find addresses starting with "CRT" and ending with "LESS"
zig build run -- --starts-and-ends-with CRT:LESS:1
# Case-insensitive matching
zig build run -- --starts-with abc:1 --ignore-case
# Multiple patterns at once
zig build run -- --starts-with SOL:2 --ends-with ANA:1 --ignore-caseUsage: grincel [options]
Options:
--starts-with <PREFIX>[:COUNT] Find addresses starting with PREFIX
--ends-with <SUFFIX>[:COUNT] Find addresses ending with SUFFIX
--starts-and-ends-with <PRE>:<SUF>[:COUNT] Find addresses starting with PRE and ending with SUF
--ignore-case Case-insensitive matching
--help, -h Show this help
Found keypairs are automatically saved to JSON files named <ADDRESS>.json.
The format is a standard Solana keypair file (JSON array of 64 bytes), compatible with solana-cli.
[15,240,99,201,38,...]You can import this wallet directly:
solana config set --keypair CRTtn6wqCH3WTxHwdPerR5rhkMfq9FtiZRmCyKjY69Zn.jsongraph LR
A[CLI Args] --> B[Pattern Parser]
B --> C[Metal Context]
C --> D[GPU Shader]
D --> E[SHA-512]
E --> F[Ed25519]
F --> G[Base58]
G --> H[Pattern Match]
H --> I[Results Buffer]
I --> J[JSON Files]
- Metal Shader (
src/shaders/vanity.metal) - GPU compute kernel with SHA-512, Ed25519, Base58 - Objective-C Bridge (
src/metal_bridge.m) - Interface to Metal APIs - Zig Integration (
src/metal.zig) - Host-side GPU dispatch - Pattern System (
src/pattern.zig) - Multi-mode pattern matching - CLI Parser (
src/main.zig) - Argument parsing and main loop
The GPU implementation successfully calls custom Metal compute shaders. The infrastructure is complete with:
- โ SHA-512 hashing on GPU
- โ Base58 encoding on GPU
- โ Pattern matching on GPU
- โ Full 64-bit Ed25519 Arithmetic (Verified against CPU)
- โ Fixed-Base Optimization (Comb Method w/ 64KB Tables)
| Device | Speed | Notes |
|---|---|---|
| Apple M1/M2/M3 Max | ~2,000,000 keys/s | 8x Faster than CPU |
solana-keygen grind |
~500,000 keys/s | 12 CPU threads |
The generator produces cryptographically valid Solana keypairs. The Ed25519 implementation uses standard 5-limb 64-bit field arithmetic ("Ref10" logic) and has been verified against Python and CPU reference implementations for correctness. It properly handles scalar clamping, point multiplication, and encoding.
Note: While verified correct, this is experimental software. Always verify generated keys with a second tool if managing significant funds.
# Quick test
$ zig build run -- --starts-with gr:1
Using GPU backend: metal
Patterns current: 1
Case-sensitive: true
Searching for Solana addresses matching patterns...
Searched 262_144 keypairs in 0.13s. 0 matches found.
Searched 524_288 keypairs in 0.26s. 0 matches found.
[Pattern 0] Found match 1/1: grb4eR3RA7UY69XHVvb5FtTkoxezt7NnUvjeXjDGJCt
All target matches found!grincel.gpu/
โโโ src/
โ โโโ main.zig # CLI entry point
โ โโโ metal.zig # Metal backend
โ โโโ metal_bridge.m # Objective-C bridge
โ โโโ metal_bindings.zig # Zig FFI
โ โโโ pattern.zig # Pattern matching
โ โโโ search_state.zig # Search state management
โ โโโ ed25519.zig # Ed25519 wrapper
โ โโโ base58.zig # Base58 encoding
โ โโโ shaders/
โ โโโ vanity.metal # GPU compute shader
โโโ build.zig # Build configuration
โโโ README.md
The next major milestone is implementing complete Ed25519 in Metal:
- Field Arithmetic - Addition, subtraction, multiplication, squaring, inversion over GF(2^255-19)
- Point Operations - Point addition, doubling on Edwards curve
- Scalar Multiplication - Double-and-add or windowed method
- Key Derivation - SHA-512 based per RFC 8032
This will enable production-ready vanity address generation.
Contributions welcome! Key areas:
- Full Ed25519 implementation in Metal
- Performance optimizations
- Cross-platform support (Vulkan for Linux/Windows)
- Additional pattern matching modes
This project is released into the public domain under the Unlicense.
- Inspired by
solana-keygen grind - Built with Zig and Metal
- Ed25519 reference: RFC 8032