Brainflayer Documentation

repository·master·Indexed 21 days ago

https://github.com/ryancdotorg/brainflayer

A high-performance Proof-of-Concept tool for cracking brainwallets using libsecp256k1 for pubkey generation. It supports various input types including keccak, priv, warp, bwio, bv2, and rush, and targets uncompressed, compressed, Ethereum, and x-coordinate addresses. The tool is designed for Linux (Ubuntu 20.04 amd64/x86_64) and utilizes bloom filters for efficient hash160 searching.

Tokens
1K
Snippets
4
Records
7
Agent score
27%

What's inside Brainflayer

  1. Optimize Brainflayer performance and memory

    master

    Brainflayer is single-threaded. To utilize multiple CPU cores, you must distribute the work yourself (e.g., by running multiple processes). Because Brainflayer uses mmap for data files in shared memory, running multiple instances does not significantly increase RAM usage.

    Recommended optimization flags:

    • -m FILE: Load a pre-generated ecmult table from FILE (created via ecmtabgen). This significantly reduces startup time and allows multiple processes to share the same table in memory.
    • -f FILE: Verify the check bloom filter against a file containing all hash160s (generated via sort -u example.hex | xxd -r -p > example.bin). This suppresses false positives caused by the finite size of the bloom filter.
  2. Basic usage of Brainflayer

    master

    Brainflayer is used to hunt for brainwallets. The standard workflow involves precomputing a bloom filter from a list of hex-encoded hash160s and then running Brainflayer against that filter using a list of candidate passphrases.

    1. Precompute the bloom filter: Use hex2blf to convert a hex file to a .blf file.
    2. Run Brainflayer: Use the -b flag to specify the bloom filter and -i to specify the input passphrase list, or pipe a generator directly into Brainflayer.
    # Precompute the bloom filter
    hex2blf example.hex example.blf
    
    # Run Brainflayer against the filter using a file
    brainflayer -v -b example.blf -i phraselist.txt
    
    # OR pipe a generator directly to Brainflayer
    your_generator | brainflayer -v -b example.blf
  3. Install and build Brainflayer on Linux

    master

    Brainflayer is designed to compile on Linux using make. It requires build-essential, libgmp-dev, and libssl-dev. The supported build target is Ubuntu 20.04 on amd64/x86_64.

    Note: Support for operating systems other than Linux is not currently provided due to memory optimization requirements.

    apt install build-essential libgmp-dev libssl-dev
    make
  4. Perform incremental private key brute force

    master

    Brainflayer supports an incremental private key brute force mode, useful for targets like directory.io. Use the -I option to specify the starting hex private key.

    brainflayer -v -I 0000000000000000000000000000000000000000000000000000000000000001 -b example.blf
  5. Configure Brainflayer input types with -t

    master

    The -t option allows you to specify the type of input being processed. This changes how the input is hashed or interpreted:

    • -t keccak: Passphrases to be hashed with keccak256 (e.g., for Ethereum tools).
    • -t priv: Raw hex-encoded private keys. This supports arbitrary deterministic wallet schemes. Any trailing data after the hex key is included in the output for reference. Use with -I for sequential key optimizations.
    • -t warp: Salts or passwords/passphrases for WarpWallet.
    • -t bwio: Salts or passwords/passphrases for brainwallet.io.
    • -t bv2: Salts or passwords/passphrases for brainv2 (optimized for GPUs/FPGAs, slow on CPU).
    • -t rush: Passwords for password-protected rushwallets. Use -r to pass the fragment (the part of the URL after the #).
    # Example: Using keccak256 hashing
    brainflayer -t keccak -b example.blf -i passphrases.txt
  6. Configure address types with -c

    master

    The -c option specifies the format of the addresses being targeted. You can combine multiple types (e.g., -c uc for uncompressed and compressed).

    Available types:

    • u: Uncompressed addresses
    • c: Compressed addresses
    • e: Ethereum addresses
    • x: Most significant bits of public point's x coordinate