Skip to content

Simplify vanitygen to -u address-list mode; remove all non-needed code paths and cleanup bruteforce implementation#1

Open
stud0709 wants to merge 2 commits intomainfrom
cosine/cleanup/keep-only-u-mode
Open

Simplify vanitygen to -u address-list mode; remove all non-needed code paths and cleanup bruteforce implementation#1
stud0709 wants to merge 2 commits intomainfrom
cosine/cleanup/keep-only-u-mode

Conversation

@stud0709
Copy link
Copy Markdown
Owner

@stud0709 stud0709 commented Mar 3, 2026

This pull request constrains vanitygen to the address-list matching mode (-u) and removes all code paths related to other generation modes. The project is streamlined to load an address list and match candidates against the 21-byte payload (version + hash160) of Base58Check addresses.

What changed

  • vanitygen/vanitygen.c
    • Dropped support for all modes except -u. CLI parsing now only handles -u, -t, -1, -a, -v, -q, -o, -z.
    • The main flow now loads an address list from a file or stdin, initializes a bruteforce context, and runs the -u matcher.
    • usage() and messaging reflect that only address-list matching is supported.
    • Simplified output handling and thread setup suitable for -u mode.
  • vanitygen/bruteforce.c / bruteforce.h
    • Reworked for address-list matching context. Payloads are stored with their corresponding address strings, and hashing buckets contain bruteforce_entry_t entries with payload and address.
    • Hashing uses the 21-byte payload (version + hash160) extracted from each decoded address.
    • bruteforce_test() now detects a payload match and reports the matching address, then controls flow based on -1/-a and -u semantics.
    • Context lifecycle and utility functions adjusted to support -u mode only.
  • vanitygen/tests
    • Added vanitygen/tests/test_bruteforce.cpp: a minimal unit test that loads a known address, decodes it to a payload, and asserts that bruteforce_test() finds a match and emits the address via the test harness.
    • vanitygen/tests/README.md added to document the new -u mode tests.
  • vanitygen/vanitygen.c changes also reflect a removal of legacy code paths and headers that were only used by other modes. This includes removing references to ed25519, base32, crc16, simplevanitygen, segwit_addr, stellar, and similar components not required for -u.
  • README.md
    • Added a note stating that vanitygen.c has been simplified to support only address-list matching mode (-u).
  • Build metadata
    • vcxproj and vcxproj.filters updated to drop unused sources/headers for non--u features to keep the build minimal.

How this solves the issue

  • The tool now focuses exclusively on matching against a provided address list, which was the requested mode. All extraneous modes were removed, reducing complexity and potential surface area for bugs.
  • The bruteforce context stores address entries in a way that is efficient for -u matching, and the test confirms the core path from loading addresses to reporting a match works as intended.

Usage (for -u mode)

  • Build oclvanitygen as usual.
  • Provide an address list file (one per line) and run vanitygen with -u to search against that list. Other options are deprecated in this fork and not supported.

Notes

  • The changes include changes to headers and project files to align with the single-mode focus and reduce compilation dependencies.
  • A minimal unit test is included to verify the address-list load and match path working end-to-end.

https://cosine.sh/stud0709/vaintygen/task/b1hfj8pxm49r
https://cosine.sh/gh/stud0709/vaintygen/pull/1
Author: Yuriy Dzhenyeyev

stud0709 and others added 2 commits March 3, 2026 09:01
…ctor bruteforce to store payloads and match payloads; add tests and README note

Co-authored-by: Cosine <agent@cosine.sh>
…c/util.c, drop PCRE), fix bruteforce to handle compressed vs uncompressed pubkeys, update VS and tests

Co-authored-by: Cosine <agent@cosine.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant