{"id":40730539,"url":"https://github.com/hadv/vaneth","last_synced_at":"2026-01-21T14:31:33.543Z","repository":{"id":149599157,"uuid":"169547839","full_name":"hadv/vaneth","owner":"hadv","description":"GPU-accelerated CREATE2 vanity address miner for Ethereum","archived":false,"fork":false,"pushed_at":"2025-12-06T16:03:19.000Z","size":1223,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T00:17:31.952Z","etag":null,"topics":["create2-contract-deployment","cuda","ethereum","gpu","gpu-acceleration","gpu-programming","open-cl","vanity-address"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hadv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-07T09:34:02.000Z","updated_at":"2025-12-07T08:21:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"fabe1575-4959-4e2e-9f06-544193b0dad9","html_url":"https://github.com/hadv/vaneth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hadv/vaneth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadv%2Fvaneth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadv%2Fvaneth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadv%2Fvaneth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadv%2Fvaneth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hadv","download_url":"https://codeload.github.com/hadv/vaneth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadv%2Fvaneth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28634809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["create2-contract-deployment","cuda","ethereum","gpu","gpu-acceleration","gpu-programming","open-cl","vanity-address"],"created_at":"2026-01-21T14:31:33.481Z","updated_at":"2026-01-21T14:31:33.536Z","avatar_url":"https://github.com/hadv.png","language":"Go","readme":"# Vaneth - Ethereum Vanity Address Miner ⛏️\n\n```\n__   _____    _   _ _____ _____ _   _\n\\ \\ / / _ \\  | \\ | | ____|_   _| | | |\n \\ V / |_| | |  \\| |  _|   | | | |_| |\n  \\_/|_/ \\_\\ |_|\\__|_____| |_| |_| |_|\n\n      ⛏️  CREATE2 Vanity Miner  ⛏️\n```\n\n\u003e GPU-accelerated CREATE2 vanity address miner for Ethereum using [Solady CREATE2 Factory](https://github.com/Vectorized/solady)\n\n## Overview\n\nThis tool uses brute force to find a salt value that, when used with the CREATE2 opcode, will deploy a smart contract to a vanity address (e.g., starting with `0x00000000`).\n\nThe CREATE2 address is calculated as:\n```\naddress = keccak256(0xff ++ deployer_address ++ salt ++ keccak256(init_code))[12:]\n```\n\n## Features\n\n- 🚀 **Highly Optimized**: Direct byte comparison, pre-calculated values, zero allocations in hot loop\n- 🔥 **SIMD Acceleration**: AVX2-optimized 4-way parallel Keccak256 (~10x faster than standard CPU)\n- ⚡ **Multi-core Support**: Automatically uses all CPU cores with configurable goroutines\n- 🎮 **GPU Acceleration**: OpenCL support on macOS/Linux, CUDA support for NVIDIA GPUs on Linux\n- 🎯 **Flexible Patterns**: Search for any hex pattern (prefix matching)\n- 🔑 **Salt Prefix Support**: Generate salts with fixed prefixes for Solady CREATE2 factory\n- ⏱️ **Real-time Stats**: Live hash rate monitoring during mining\n- 🔧 **Easy Configuration**: CLI arguments for all search parameters\n\n## Installation\n\n### Standard Build (CPU only)\n\n```bash\ngit clone https://github.com/hadv/vaneth.git\ncd vaneth\ngo build\n```\n\n### Build with GPU Support\n\n#### macOS (OpenCL)\n\nFor GPU acceleration on macOS with AMD GPUs:\n\n```bash\nmake build-gpu\n```\n\n**Requirements:**\n- macOS with OpenCL framework (built-in)\n- AMD GPU (e.g., Radeon Pro 555X, 560X, 5500M, etc.)\n- CGO enabled (default on macOS)\n\n#### Linux (OpenCL)\n\nFor GPU acceleration on Linux using OpenCL (supports AMD, NVIDIA, and Intel GPUs):\n\n```bash\n# Install OpenCL development libraries\n# Ubuntu/Debian:\nsudo apt install opencl-headers ocl-icd-opencl-dev\n\n# For NVIDIA GPUs, also install:\nsudo apt install nvidia-opencl-dev\n\n# For AMD GPUs, install ROCm or AMDGPU-PRO drivers\n\n# Build with OpenCL support\nmake build-gpu\n```\n\n**Requirements:**\n- OpenCL 1.2+ runtime and headers\n- Compatible GPU with OpenCL drivers installed\n- CGO enabled\n\n#### Linux (CUDA - NVIDIA GPUs)\n\nFor native CUDA acceleration on Linux with NVIDIA GPUs (recommended for NVIDIA hardware):\n\n```bash\n# Install NVIDIA CUDA Toolkit (Ubuntu/Debian)\nwget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb\nsudo dpkg -i cuda-keyring_1.1-1_all.deb\nsudo apt update\nsudo apt install cuda-toolkit\n\n# Add CUDA to PATH (add to ~/.bashrc for persistence)\nexport PATH=/usr/local/cuda/bin:$PATH\nexport LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH\n\n# Verify nvcc is available\nnvcc --version\n\n# Build with CUDA support\nmake build-cuda\n```\n\n**Requirements:**\n- Linux operating system\n- NVIDIA GPU with Compute Capability 5.0+ (Maxwell architecture or newer, ~2014+)\n- NVIDIA CUDA Toolkit 11.0+\n- `nvcc` compiler in PATH\n- CGO enabled\n\n**Supported NVIDIA GPUs:**\n- GeForce GTX 750 Ti and newer\n- GeForce GTX 900/1000/1600/2000/3000/4000 series\n- Tesla K80 and newer\n- Quadro M series and newer\n\n## Usage\n\n### Standard CREATE2 Deployment\n\n#### 1. Configure the Search Parameters\n\nEdit `main.go` and set these values:\n\n```go\ndeployerAddress := common.HexToAddress(\"0x18Ee4C040568238643C07e7aFd6c53efc196D26b\")  // Your deployer address\ninitCodeHashStr := \"ed6d47ef8858bf77ca8c43589269de4a0242b881ab9d2f8704546ce86ab20879\" // keccak256(init_code)\npattern := \"0x00000000\"                                                               // Pattern to search for\nnumCores := runtime.NumCPU()                                                          // CPU cores to use\nnumGoroutines := numCores * 100                                                       // Goroutines per core\n```\n\n#### 2. Get Your Init Code Hash\n\nThe init code hash is the keccak256 hash of your contract's creation bytecode. You can get this from:\n- Hardhat/Foundry deployment scripts\n- Remix compiler output\n- Or calculate it manually: `keccak256(type(YourContract).creationCode)`\n\n#### 3. Run the Program\n\n```bash\n./vaneth\n```\n\n#### 4. Example Output\n\n```\nSearching for CREATE2 address starting with '0x00000000'...\nDeployer: 0x0000000000FFe8B47B3e2130213B802212439497\nInit Code Hash: 0x747dd63dfae991117debeb008f2fb0533bb59a6eee74ba0e197e21099d034c7a\nUsing 12 CPU cores with 9600 goroutines\n\n\nFound!\nSalt: 0x18ee4c040568238643c07e7afd6c53efc196d26bb3aa4a73c14310c5a4a12b1b\nAddress: 0x000000006e38ec9e8074ed84cbcbf4b9d8773b7e\nTime elapsed: 2m51.724719347s\n```\n\n### Using Solady CREATE2 Factory\n\nThe Solady CREATE2 factory requires salts with a specific prefix (the caller's address). This tool supports generating salts with fixed prefixes.\n\n#### Configuration for Solady Factory\n\nThe current configuration in `main.go` is set up for the Solady CREATE2 factory:\n\n```go\n// Solady CREATE2 Factory Configuration\ndeployerAddress := common.HexToAddress(\"0x0000000000ffe8b47b3e2130213b802212439497\")  // Solady factory address\ninitCodeHashStr := \"747dd63dfae991117debeb008f2fb0533bb59a6eee74ba0e197e21099d034c7a\" // Your contract's init code hash\npattern := \"0x000000\"                                                                 // Pattern to search for\n\n// Salt prefix (pre-calculated outside the loop for performance)\nsaltPrefix := common.HexToAddress(\"0x18Ee4C040568238643C07e7aFd6c53efc196D26b\")  // Your address (caller)\n```\n\n#### How Salt Prefix Works\n\n- **First 20 bytes**: Fixed prefix (your address as the caller)\n- **Last 12 bytes**: Randomly generated\n- The prefix is pre-calculated once for optimal performance\n\n#### Deploying with Solady Factory\n\nOnce you find a matching salt, deploy using the Solady CREATE2 factory:\n\n```solidity\n// Solady CREATE2 factory interface\ninterface ICreate2Factory {\n    function deploy(bytes32 salt, bytes memory initCode) external returns (address);\n}\n\n// Deploy your contract\nICreate2Factory factory = ICreate2Factory(0x0000000000FFe8B47B3e2130213B802212439497);\nbytes memory initCode = type(YourContract).creationCode;\nbytes32 salt = 0x18Ee4C040568238643C07e7aFd6c53efc196D26b000000000000000000000123; // Salt found by the tool\naddress deployed = factory.deploy(salt, initCode);\n```\n\n#### Key Points\n\n- The Solady factory is deployed at: `0x0000000000FFe8B47B3e2130213B802212439497`\n- The factory automatically prepends the caller's address to the salt\n- Your salt prefix must match your deploying address\n- The tool optimizes by only randomizing the last 12 bytes\n\n### SIMD Mode (Recommended for CPU)\n\nSIMD mode uses AVX2 instructions to compute 4 Keccak256 hashes in parallel, providing up to **10x faster** mining compared to standard CPU mode.\n\n```bash\n./vaneth --simd \\\n  -i 747dd63dfae991117debeb008f2fb0533bb59a6eee74ba0e197e21099d034c7a \\\n  -s 0x18Ee4C040568238643C07e7aFd6c53efc196D26b \\\n  -p 0x00000000\n```\n\n**Requirements:**\n- CPU with AVX2 support (Intel Haswell 2013+ or AMD Excavator 2015+)\n- Automatically falls back to standard CPU mode if AVX2 is not available\n\n### GPU Mode\n\nGPU acceleration provides significantly faster mining compared to CPU mode.\n\n#### Command-Line Options\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--simd` | Enable SIMD-optimized CPU miner (AVX2) | `false` |\n| `--gpu`, `-g` | Enable GPU mode | `false` |\n| `--gpu-backend` | GPU backend: `opencl`, `cuda`, or `auto` | `opencl` |\n| `--gpu-device` | GPU device index | `0` |\n| `--batch-size` | Hashes per GPU batch | `5000000` |\n| `--list-gpus` | List available GPUs and exit | - |\n\n#### List Available GPUs\n\n```bash\n# List OpenCL GPUs (macOS/Linux)\n./vaneth --list-gpus\n\n# List CUDA GPUs (Linux with NVIDIA)\n./vaneth --list-gpus --gpu-backend cuda\n```\n\nExample output (OpenCL):\n```\nAvailable GPUs:\n  [0] Intel(R) UHD Graphics 630\n  [1] AMD Radeon Pro 555X Compute Engine\n```\n\nExample output (CUDA):\n```\nFound 1 CUDA GPU device(s):\n\n  Device 0: NVIDIA GeForce RTX 3080\n    Compute Units (SMs): 68\n    Max Threads per Block: 1024\n    Total Memory: 10240 MB\n```\n\n#### Run with OpenCL (macOS/Linux)\n\n```bash\n./vaneth --gpu --gpu-device 1 \\\n  -i 747dd63dfae991117debeb008f2fb0533bb59a6eee74ba0e197e21099d034c7a \\\n  -s 0x18Ee4C040568238643C07e7aFd6c53efc196D26b \\\n  -p 0x0000\n```\n\n#### Run with CUDA (Linux with NVIDIA GPU)\n\n```bash\n./vaneth --gpu --gpu-backend cuda \\\n  -i 747dd63dfae991117debeb008f2fb0533bb59a6eee74ba0e197e21099d034c7a \\\n  -s 0x18Ee4C040568238643C07e7aFd6c53efc196D26b \\\n  -p 0x0000\n```\n\n#### Auto-detect GPU Backend\n\nThe `auto` backend tries CUDA first, then falls back to OpenCL:\n\n```bash\n./vaneth --gpu --gpu-backend auto \\\n  -i 747dd63dfae991117debeb008f2fb0533bb59a6eee74ba0e197e21099d034c7a \\\n  -s 0x18Ee4C040568238643C07e7aFd6c53efc196D26b \\\n  -p 0x0000\n```\n\n#### GPU Example Output\n\n```\nSearching for CREATE2 address starting with '0x0000'...\nDeployer: 0x0000000000FFe8B47B3e2130213B802212439497\nSalt Prefix: 0x18Ee4C040568238643C07e7aFd6c53efc196D26b\nInit Code Hash: 0x747dd63dfae991117debeb008f2fb0533bb59a6eee74ba0e197e21099d034c7a\nUsing GPU: AMD Radeon Pro 555X Compute Engine\nBatch size: 5000000 hashes per iteration\n\nFound!\nSalt: 0x18ee4c040568238643c07e7afd6c53efc196d26b000000000000000000004030\nAddress: 0x0000e628d423549be95a4113c4b59765b6cee09d\nTime elapsed: 56.4974ms\nTotal hashes: 5000000\nHash rate: 88.50 MH/s\n```\n\n## Performance Comparison\n\n### CPU Mode Comparison (Standard vs SIMD)\n\n| Mode | Throughput | Speedup |\n|------|------------|---------|\n| Standard CPU (single thread) | ~1.5 MH/s | baseline |\n| SIMD CPU (single thread) | ~5-6 MH/s | **~4x** |\n| Standard CPU (12 cores) | ~4 MH/s | baseline |\n| SIMD CPU (12 cores) | ~35-40 MH/s | **~10x** |\n\n*SIMD mode uses AVX2 4-way parallel Keccak256 with zero allocations*\n\n### CPU vs GPU Performance\n\n| Pattern | Standard CPU | SIMD CPU | GPU (OpenCL) |\n|---------|--------------|----------|--------------|\n| `0x0000` (4 hex) | ~73ms | ~7ms | ~57ms |\n| `0x000000` (6 hex) | ~18s | ~2s | ~1.5s |\n| `0x00000000` (8 hex) | ~5-8 min | ~30-60s | ~30-60s |\n\n*Tested on MacBook Pro with Intel i7-9750H (12 threads) and AMD Radeon Pro 555X*\n\n### GPU Tips\n\n- **Thermal Management**: MacBooks may throttle under heavy GPU load. Monitor temperatures.\n- **Power**: Keep the laptop plugged in for best GPU performance.\n- **Batch Size**: Larger batch sizes improve throughput but increase memory usage.\n- **Device Selection**: Use `--list-gpus` to find your discrete GPU (usually index 1 on MacBooks).\n\n## Performance Tuning\n\n### CPU Cores\n```go\n// Use all available cores (default)\nnumCores := runtime.NumCPU()\n\n// Limit to specific number\nnumCores := 8\n\n// Use half of available cores\nnumCores := runtime.NumCPU() / 2\n```\n\n### Goroutines\n```go\n// Light load\nnumGoroutines := numCores * 10\n\n// Balanced (recommended)\nnumGoroutines := numCores * 100\n\n// Heavy load\nnumGoroutines := numCores * 1000\n```\n\n## Pattern Difficulty\n\nThe difficulty increases exponentially with pattern length:\n\n| Pattern Length | Approximate Attempts | Time (estimate)    |\n|---------------|---------------------|--------------------|\n| 6 hex chars   | ~16 million         | seconds ~ minutes  |\n| 8 hex chars   | ~4 billion          | minutes ~ hours    |\n| 10 hex chars  | ~1 trillion         | hours ~ days       |\n\n## How It Works\n\n1. **Pre-calculation**: Pattern bytes and deployer address bytes are calculated once\n2. **Parallel Search**: Multiple goroutines generate random salts concurrently\n3. **CREATE2 Calculation**: Each salt is used to compute the resulting contract address\n4. **Direct Comparison**: Bytes are compared directly (no string operations)\n5. **Early Exit**: Stops immediately when a match is found\n\n## Optimizations\n\n### CPU Mode (Standard)\n- ✅ Direct byte comparison (no string allocations)\n- ✅ Pre-calculated pattern and deployer bytes\n- ✅ Pre-calculated salt prefix (for Solady factory mode)\n- ✅ Returns bytes directly from CREATE2 calculation\n- ✅ Early exit on byte mismatch\n- ✅ Fast PRNG (xoroshiro128+) instead of crypto/rand (~800x faster)\n- ✅ Zero-allocation hashing with pre-allocated buffers\n- ✅ Multi-core parallel processing\n- ✅ Real-time hash rate monitoring\n\n### CPU Mode (SIMD)\n- ✅ All standard CPU optimizations plus:\n- ✅ AVX2 4-way parallel Keccak256 (Cloudflare CIRCL library)\n- ✅ Computes 4 hashes simultaneously per CPU core\n- ✅ Zero allocations in hot path (0 B/op)\n- ✅ ~10x faster than standard CPU mode\n\n### GPU Mode (OpenCL - macOS/Linux)\n- ✅ OpenCL 1.2 compatible (native macOS support, Linux with drivers)\n- ✅ Optimized Keccak256 kernel implementation\n- ✅ Batch processing (millions of hashes per kernel launch)\n- ✅ Atomic operations for early exit on match\n- ✅ Efficient memory transfers between CPU and GPU\n- ✅ Support for Intel, AMD, and NVIDIA GPUs\n\n### GPU Mode (CUDA - Linux)\n- ✅ Native NVIDIA GPU support via CUDA\n- ✅ Optimized Keccak256 kernel with `__constant__` memory\n- ✅ Loop unrolling with `#pragma unroll` for performance\n- ✅ Batch processing (millions of hashes per kernel launch)\n- ✅ Atomic operations (`atomicCAS`) for thread-safe early exit\n- ✅ Efficient memory management with device memory allocation\n- ✅ Support for Compute Capability 5.0+ (Maxwell and newer)\n\n## Use the Salt in Your Contract\n\nOnce you find a salt, use it in your Solidity contract:\n\n```solidity\ncontract Factory {\n    function deploy(bytes32 salt) public {\n        bytes memory bytecode = type(YourContract).creationCode;\n        address addr;\n        assembly {\n            addr := create2(0, add(bytecode, 0x20), mload(bytecode), salt)\n        }\n        require(addr != address(0), \"Deploy failed\");\n    }\n}\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details\n\n## Contributing\n\nContributions are welcome! Feel free to open issues or submit pull requests.\n\n## Author\n\nHa ĐANG ([@hadv](https://github.com/hadv))\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadv%2Fvaneth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhadv%2Fvaneth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadv%2Fvaneth/lists"}