A blazing-fast Rust-based tool for mining Ethereum contract addresses with specific prefixes or postfixes using CREATE2 and CREATE3 deployment patterns.
- π₯ High Performance: Multi-threaded parallel processing with optimal batch sizes
- π― Dual Patterns: Support for both CREATE2 and CREATE3 address generation
- π¨ Pattern Matching: Mine addresses with custom prefixes, postfixes, or both
- π€ Case Sensitivity: Support for both case-sensitive (EIP-55) and case-insensitive matching
- π Real-time Progress: Beautiful colored output with live progress indicators
- β‘ Optimized Performance: Up to millions of salts per second on modern hardware
- π² Flexible Salt Generation: Sequential or random salt generation modes
Requirements:
- Rust 1.70+ installed (rustup.rs)
cargo install --git ssh://[email protected]/mitosis-org/ca-miner.git
After installation, the ca-miner
binary will be available in your PATH.
Alternatively, you can build from source:
git clone https://github.com/mitosis-org/ca-miner.git
cd ca-miner
cargo build --release
The binary will be available at target/release/ca-miner
.
Mine a CREATE2 address with "dead" prefix:
ca-miner create2 \
0x4e59b44847b379578588920cA78FbF26c0B4956C \
0x1234567890123456789012345678901234567890123456789012345678901234 \
dead \
--max-iterations 1000000
Mine a CREATE3 address with "cafe" postfix:
ca-miner create3 \
0x4e59b44847b379578588920cA78FbF26c0B4956C \
"https://example.com/init" \
cafe \
--postfix \
--max-iterations 1000000
ca-miner create2 <FACTORY> <BYTECODE_HASH> <PREFIX> [OPTIONS]
Arguments:
FACTORY
: Factory contract address (e.g.,0x4e59b44847b379578588920cA78FbF26c0B4956C
)BYTECODE_HASH
: 32-byte bytecode hash in hex format (e.g.,0x1234...
)PREFIX
: Desired address prefix in hex (e.g.,dead
,cafe
)
ca-miner create3 <FACTORY> <URL> <PREFIX> [OPTIONS]
Arguments:
FACTORY
: Factory contract addressURL
: Initialization URL stringPREFIX
: Desired address prefix in hex
Option | Description | Default |
---|---|---|
--start-salt <SALT> |
Starting salt value | 0 |
--max-iterations <N> |
Maximum iterations to try | 10,000,000,000 |
--batch-size <SIZE> |
Processing batch size | 100,000 |
--random |
Use random salts instead of sequential | false |
--case-sensitive |
Use EIP-55 checksum matching | false |
--postfix |
Match postfix instead of prefix | false |
--postfix-pattern <PATTERN> |
Pattern for dual prefix+postfix matching | - |
# Mine addresses starting with "dead"
ca-miner create2 \
0x4e59b44847b379578588920cA78FbF26c0B4956C \
0x1234567890123456789012345678901234567890123456789012345678901234 \
dead
# Mine with proper Ethereum checksum
ca-miner create2 \
0x4e59b44847b379578588920cA78FbF26c0B4956C \
0x1234567890123456789012345678901234567890123456789012345678901234 \
DeaD \
--case-sensitive
# Mine addresses ending with "beef"
ca-miner create2 \
0x4e59b44847b379578588920cA78FbF26c0B4956C \
0x1234567890123456789012345678901234567890123456789012345678901234 \
beef \
--postfix
# Mine addresses with both prefix "dead" AND postfix "beef"
ca-miner create2 \
0x4e59b44847b379578588920cA78FbF26c0B4956C \
0x1234567890123456789012345678901234567890123456789012345678901234 \
dead \
--postfix-pattern beef
# Use random salts for better distribution
ca-miner create2 \
0x4e59b44847b379578588920cA78FbF26c0B4956C \
0x1234567890123456789012345678901234567890123456789012345678901234 \
cafe \
--random \
--max-iterations 5000000
# Optimize for your hardware
ca-miner create2 \
0x4e59b44847b379578588920cA78FbF26c0B4956C \
0x1234567890123456789012345678901234567890123456789012345678901234 \
dead \
--batch-size 500000 \
--max-iterations 100000000
address = keccak256(0xff + factory + salt + keccak256(bytecode))[12:]
Uses Solady's CREATE3 implementation:
- Deploy proxy contract via CREATE2
- Deploy actual contract via CREATE from proxy (nonce=1)
- Parallel Processing: Utilizes all CPU cores via Rayon
- Batch Processing: Optimal batch sizes for cache efficiency
- Fast Hex Matching: Custom hex comparison without string allocation
- Memory Efficient: Minimal allocations in hot paths
The miner provides beautiful, colored terminal output with:
- π Colored headers and status messages
- π Real-time progress indicators with spinning animations
- β‘ Live performance metrics (salts/sec)
- π― Formatted results with proper spacing
- π Performance summaries
- Memory Safe: Written in Rust with zero unsafe code
- Overflow Protection: All arithmetic operations are checked
- Input Validation: Comprehensive validation of all inputs
- Error Handling: Graceful error handling with descriptive messages
Run the test suite:
cargo test
Run with optimizations:
cargo test --release
Generate test coverage reports:
# Install cargo-tarpaulin (one-time setup)
cargo install cargo-tarpaulin
# Generate coverage report
cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml --out Html --out stdout
Or use the provided script:
./scripts/test-coverage.sh
This generates:
cobertura.xml
- XML format for CI/CD integrationtarpaulin-report.html
- Detailed HTML report
Current test coverage: 27.45% (101/368 lines covered)
The test suite covers:
- β Utility functions: Address parsing, number formatting, salt conversion
- β Address generation: CREATE2 and CREATE3 address computation
- β Pattern matching: Prefix, postfix, and dual pattern matching
- β Configuration: Salt computation for different modes
- β Mining logic: Batch processing and early termination
- π Integration tests: End-to-end mining scenarios (planned)
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git clone https://github.com/mitosis-org/ca-miner.git
cd ca-miner
cargo build
cargo test
# Profile with flamegraph
cargo flamegraph --bin ca-miner -- create2 <args>
# Benchmark with criterion
cargo bench
This project is licensed under the MIT License - see the LICENSE file for details.
- Alloy - Ethereum library for Rust
- Rayon - Parallel processing
- Clap - Command line parsing
- Solady - CREATE3 implementation reference
β Star this repository if you find it useful!
For questions, issues, or feature requests, please open an issue on GitHub.