repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | name: pump-rust-vanity |
| #3 | description: "Production-grade multi-threaded Rust vanity address generator for Solana — 100K+ keys/sec using Rayon parallel iterators with solana-sdk, Base58 pattern matching, prefix/suffix support, security-hardened file output, and Criterion benchmarks." |
| #4 | metadata: |
| #5 | openclaw: |
| #6 | homepage: https://github.com/nirholas/pump-fun-sdk |
| #7 | requires: |
| #8 | bins: |
| #9 | - cargo |
| #10 | --- |
| #11 | |
| #12 | # Rust Vanity Generator — High-Performance Solana Address Mining |
| #13 | |
| #14 | Production-grade Rust binary achieving 100K+ keys/sec using Rayon parallel iterators with security-hardened file output and Solana CLI compatibility. |
| #15 | |
| #16 | ## Architecture |
| #17 | |
| #18 | ``` |
| #19 | CLI Args ──► VanityConfig ──► VanityGenerator |
| #20 | │ |
| #21 | Rayon par_iter |
| #22 | ┌─────┼─────┐ |
| #23 | Thread Thread Thread ... |
| #24 | │ │ │ |
| #25 | Keypair::new() per iteration |
| #26 | │ │ │ |
| #27 | Base58 encode + match |
| #28 | │ │ │ |
| #29 | └─────┼─────┘ |
| #30 | │ |
| #31 | AtomicBool found |
| #32 | │ |
| #33 | SecureOutput (0o600) |
| #34 | ``` |
| #35 | |
| #36 | ## CLI Arguments |
| #37 | |
| #38 | | Argument | Description | |
| #39 | |----------|-------------| |
| #40 | | `--prefix` | Required Base58 prefix to match | |
| #41 | | `--suffix` | Optional Base58 suffix | |
| #42 | | `--output` | Output file path (default: stdout) | |
| #43 | | `--threads` | Number of threads (default: all CPUs) | |
| #44 | |
| #45 | ## Core Types |
| #46 | |
| #47 | ```rust |
| #48 | struct VanityConfig { |
| #49 | prefix: String, |
| #50 | suffix: Option<String>, |
| #51 | output: Option<PathBuf>, |
| #52 | threads: Option<usize>, |
| #53 | } |
| #54 | |
| #55 | struct GeneratedAddress { |
| #56 | keypair: Keypair, |
| #57 | address: String, |
| #58 | attempts: u64, |
| #59 | } |
| #60 | ``` |
| #61 | |
| #62 | ## Generation Engine |
| #63 | |
| #64 | ```rust |
| #65 | fn generate(config: &VanityConfig) -> Result<GeneratedAddress> { |
| #66 | let found = AtomicBool::new(false); |
| #67 | let result = (0..num_cpus::get()) |
| #68 | .into_par_iter() |
| #69 | .find_map_any(|_| { |
| #70 | let mut attempts = 0u64; |
| #71 | loop { |
| #72 | if found.load(Ordering::Relaxed) { return None; } |
| #73 | attempts += 1; |
| #74 | let keypair = Keypair::new(); |
| #75 | let address = keypair.pubkey().to_string(); |
| #76 | if matches_pattern(&address, &config) { |
| #77 | found.store(true, Ordering::Relaxed); |
| #78 | return Some(GeneratedAddress { keypair, address, attempts }); |
| #79 | } |
| #80 | } |
| #81 | }); |
| #82 | result.ok_or_else(|| anyhow!("No match found")) |
| #83 | } |
| #84 | ``` |
| #85 | |
| #86 | ## Security Features |
| #87 | |
| #88 | | Feature | Implementation | |
| #89 | |---------|---------------| |
| #90 | | CSPRNG | `OsRng` via `solana-sdk` | |
| #91 | | Memory cleanup | `Zeroize` trait on secret key bytes | |
| #92 | | File permissions | `0o600` via `std::fs::set_permissions` | |
| #93 | | No network | Pure offline operation | |
| #94 | |
| #95 | ## Dependencies |
| #96 | |
| #97 | | Crate | Purpose | |
| #98 | |-------|---------| |
| #99 | | `solana-sdk` | Keypair generation, Base58, signing | |
| #100 | | `rayon` | Data-parallel iteration | |
| #101 | | `clap` | CLI argument parsing | |
| #102 | | `anyhow` | Error handling | |
| #103 | | `criterion` | Benchmarking | |
| #104 | |
| #105 | ## Testing |
| #106 | |
| #107 | ```bash |
| #108 | cargo test # Unit + integration tests |
| #109 | cargo test --test security_tests # Security-focused tests |
| #110 | cargo bench # Criterion benchmarks |
| #111 | ``` |
| #112 | |
| #113 | ## Patterns to Follow |
| #114 | |
| #115 | - Only use `solana-sdk` for cryptographic operations |
| #116 | - Use `Zeroize` on all key material |
| #117 | - Set file permissions to `0o600` immediately after writing |
| #118 | - Use `AtomicBool` for cross-thread termination signaling |
| #119 | - Use `find_map_any` for early termination on first match |
| #120 | |
| #121 | ## Common Pitfalls |
| #122 | |
| #123 | - Base58 is case-sensitive — `pump` ≠ `Pump` |
| #124 | - Longer prefixes grow exponentially harder (~58× per character) |
| #125 | - `Keypair::new()` uses OS entropy — do not seed with user input |
| #126 | - `rayon` thread pool size should match CPU cores for optimal throughput |
| #127 | |
| #128 |