Skip to content

dnnagy/wallet_search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETH Wallet Searcher

A high-performance multi-threaded command-line tool for searching Ethereum wallet and contract addresses with specific characteristics.

Features

  • Generate random Ethereum private keys and corresponding wallet addresses
  • Multi-threaded for high performance
  • Filter addresses by prefix and/or suffix
  • Find addresses that maximize or minimize the numeric value
  • Search for wallets that deploy contracts with specific CREATE1 addresses (at a given nonce)
  • Brute-force salts for CREATE2, CREATE3, and CREATE5 to find vanity contract addresses
  • Securely encrypt private keys with AES-256-GCM
  • Save matching results to disk (JSON)

Building

cargo build --release

The compiled binary will be available at target/release/wallet_search.

Usage

./wallet_search [COMMAND] [OPTIONS]

Commands

  • search: Search for Ethereum EOAs (wallets) with specific vanity address characteristics
  • contract: Search EOAs whose CREATE1-deployed contract (at a given nonce) matches vanity criteria
  • create2: Brute-force salts for CREATE2 to find vanity contract addresses
  • create3: Brute-force salts for CREATE3 (factory-only) to find vanity contract addresses
  • create5: Brute-force salts for domain-scoped deployments (CREATE5 pattern) to find vanity contract addresses
  • decrypt: Decrypt a saved wallet file to view the private key

Search Command Options

  • --threads, -t: Number of threads to utilize (default: number of CPU cores)
  • --prefix=<prefix>: Only save wallet addresses with this specific prefix (e.g., "0x000000")
  • --suffix=<suffix>: Only save wallet addresses with this specific suffix (e.g., "ffff")
  • --method=<method>: How to process matches ("maximize", "minimize", or "exact")
  • --output, -o: Directory to save found wallets (default: ./wallets)
  • --password-prompt, -P: Use interactive password prompt for encryption (required)

Contract Command Options (CREATE1 via EOA at nonce)

  • --threads, -t: Number of threads to utilize (default: number of CPU cores)
  • --nonce=<n>: Nonce to use when computing CREATE1 address (default: 0)
  • --prefix=<prefix>: Only save contract addresses with this specific prefix (e.g., "0x000000")
  • --suffix=<suffix>: Only save contract addresses with this specific suffix (e.g., "ffff")
  • --method=<method>: How to process matches ("maximize", "minimize", or "exact")
  • --output, -o: Directory to save found wallets and contract matches (default: ./wallets)
  • --password-prompt, -P: Use interactive password prompt for encryption (required)

Note: This command does NOT require bytecode; CREATE1 address depends only on the sender address and nonce.

CREATE2 Command Options

  • --threads, -t: Number of threads to utilize (default: number of CPU cores)
  • --sender=<address>: Deployer address (EOA or contract) as 0x-prefixed hex
  • --init-code=<path>: Path to hex-encoded init code file (mutually exclusive with --init-code-hash)
  • --init-code-hash=<0x...>: Precomputed keccak256(init_code) as 32-byte 0x-prefixed hex (mutually exclusive with --init-code)
  • --prefix=<prefix>: Contract address prefix to match
  • --suffix=<suffix>: Contract address suffix to match
  • --method=<method>: "maximize", "minimize", or "exact"
  • --max-results=<n>: Optional maximum number of matches before stopping
  • --output, -o: Directory to save results (default: ./results)

CREATE3 Command Options

  • --threads, -t: Number of threads to utilize (default: number of CPU cores)
  • --factory=<address>: Factory (deployer) address as 0x-prefixed hex
  • --prefix=<prefix>: Contract address prefix to match
  • --suffix=<suffix>: Contract address suffix to match
  • --method=<method>: "maximize", "minimize", or "exact"
  • --max-results=<n>: Optional maximum number of matches before stopping
  • --output, -o: Directory to save results (default: ./results)

CREATE5 Command Options (domain-scoped)

  • --threads, -t: Number of threads to utilize (default: number of CPU cores)
  • --factory=<address>: Factory (deployer) address as 0x-prefixed hex
  • --domain=<0x...>: Domain as 0x-prefixed 32-byte hex (64 hex chars)
  • --prefix=<prefix>: Contract address prefix to match
  • --suffix=<suffix>: Contract address suffix to match
  • --method=<method>: "maximize", "minimize", or "exact"
  • --max-results=<n>: Optional maximum number of matches before stopping
  • --output, -o: Directory to save results (default: ./results)

Decrypt Command Options

  • --file, -f: Path to the wallet JSON file to decrypt
  • --password-prompt, -P: Use interactive password prompt for decryption (enabled by default)

Methods

  • exact: Save all addresses matching the prefix/suffix criteria
  • minimize: Save addresses with the numerically smallest value that matches criteria
  • maximize: Save addresses with the numerically largest value that matches criteria

Examples

Search for EOAs with a specific prefix

./wallet_search search --prefix="0x000000" --method="exact" -t 8 -P

Find the wallet with the smallest numeric value starting with 0x123

./wallet_search search --prefix="0x123" --method="minimize" -P

Find addresses ending with "ffff"

./wallet_search search --suffix="ffff" --method="exact" -P

Find an EOA whose CREATE1-deployed contract (nonce 0) starts with 0x000

./wallet_search contract --prefix="0x000" --nonce 0 -P

CREATE2 with init code file

./wallet_search create2 --sender 0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF \
  --init-code ./my_contract.hex --prefix "0x1234" --max-results 5 -t 8 -o ./results

CREATE2 with precomputed init code hash

./wallet_search create2 --sender 0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF \
  --init-code-hash 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
  --suffix "ffff" --method "exact" --max-results 1

CREATE3 vanity search

./wallet_search create3 --factory 0x0000000000000000000000000000000000000000 \
  --prefix "0x0000" --max-results 3

CREATE5 vanity search with domain

./wallet_search create5 --factory 0x0000000000000000000000000000000000000000 \
  --domain 0x1111111111111111111111111111111111111111111111111111111111111111 \
  --suffix "abcd" --method minimize --max-results 10

Decrypt a wallet file to view the private key

./wallet_search decrypt --file "./wallets/0x1234567890abcdef1234567890abcdef12345678.json"

Contract Address Search (CREATE1)

The contract command searches for EOA private keys such that the contract deployed from that EOA at a given nonce (default 0) has a vanity address matching your criteria. This uses the standard formula keccak256(rlp([sender, nonce]))[12:] and does not require bytecode.

For vanity searches using bytecode or precomputed bytecode hash, use the create2 command instead.

Security

  • Private keys are encrypted with AES-256-GCM using a key derived from your password via SHA3-256.
  • The encrypted key is stored as a single base64 string in the format <nonce_b64>.<ciphertext_b64>.

Output

Results are saved as pretty-printed JSON files.

Wallet Files (named as 0x<address>.json in ./wallets/):

{
  "wallet_address": "0x...",
  "encrypted_key": "<nonce_b64>.<ciphertext_b64>",
  "found_at": "2025-01-01T00:00:00+00:00",
  "counter": 1
}

CREATE1 Contract Files (named as contract_0x<contract>.json in ./wallets/):

{
  "wallet_address": "0x...",
  "contract_address": "0x...",
  "encrypted_key": "<nonce_b64>.<ciphertext_b64>",
  "found_at": "2025-01-01T00:00:00+00:00",
  "nonce": 0,
  "counter": 1
}

CREATE2 Result Files (named as create2_0x<contract>.json in ./results/):

{
  "sender_address": "0x...",
  "contract_address": "0x...",
  "salt": "0x<32-byte-hex>",
  "found_at": "2025-01-01T00:00:00+00:00",
  "counter": 1
}

CREATE3 Result Files (named as create3_0x<contract>.json in ./results/):

{
  "factory_address": "0x...",
  "contract_address": "0x...",
  "salt": "0x<32-byte-hex>",
  "found_at": "2025-01-01T00:00:00+00:00",
  "counter": 1
}

CREATE5 Result Files (named as create5_0x<contract>.json in ./results/):

{
  "factory_address": "0x...",
  "domain": "0x<32-byte-hex>",
  "contract_address": "0x...",
  "salt": "0x<32-byte-hex>",
  "found_at": "2025-01-01T00:00:00+00:00",
  "counter": 1
}

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages