Alright, I'll throw my hat in the ring.

This is an act of purely passive-aggressive coding.

First, we read in words from dictionaries (only using words that contain valid onion values), then we use those words to construct a tree. Each "branch" is a comparison, so if the word starts with 'h', we create an 'h' branch from the root, then and 'e' branch from 'h', and an 'l' branch from 'e', etc. At the end of each word we leave a boolean flag to say that it denotes where a full word ends. Each valid path through the tree represents a word in our dictionary.

for example 'hello', 'hi', 'helping', and 'help' become a structure like this, where `*` denotes the end of a full known word.

    [h]___[e]___[l]___[l]___[o]*
        |_[i]*      |_[p]*__[i]___[n]___[g]*

Then we generate our onions, for each letter in the onion address we check if there is a valid branch in our tree. If there is, we follow it and check the next letter against the branches stemming from it. Using this method, we compare the onion address to every word in the dictionary simultaneously, so the number of comparisons to check if a valid word in the dictionary is found is, in the worst case, the length of the onion address regardless of how many words we have in our dictionary.

I've implemented this in C, and also included libssl code for generating, encoding, matching and saving matches found.

It has a bonus mode where it will match against onion addresses that consist purely of words from the dictionary.

Code is available here: [searchlol](https://github.com/epidemics-scepticism/searchlol)

    onions $ ./main -d /tmp/dictionary
    Populating search from '/tmp/dictionary'
    Starting search. Use ctrl-c to exit.
    main: found 'clankibd4yfa7gri'
    main: found 'swotsg6rthhb3vs3'
    main: found 'propsugtrvrfnsqw'
    ^CCleaning up...
    Bye o/
    onions $ cat propsugtrvrfnsqw
    -----BEGIN RSA PRIVATE KEY-----
    MII[...SNIP...]
    -----END RSA PRIVATE KEY-----