Go to file
cathugger 870c089a3c
better ruler fix
2023-09-06 02:24:14 +03:00
.github/workflows Docker support (#99) 2023-08-06 18:22:54 +00:00
contrib revamp docker support 2023-08-06 16:08:33 +00:00
ed25519 fix assembler compilation on MacOS 2023-01-14 14:37:41 +00:00
.editorconfig various things 2020-11-21 11:34:25 +00:00
.gitattributes .gitattributes: make sure *.h *.c are detected as C 2018-10-28 22:43:51 -05:00
.gitignore a bit of calcest and some other stuff 2021-11-03 00:20:43 +00:00
COPYING.txt README & COPYING 2017-09-25 22:22:07 +03:00
GNUmakefile.in remove slow/fast workers 2023-06-09 17:16:46 +03:00
OPTIMISATION.txt adjust OPTIMISATION.txt for current stuff 2020-07-18 16:18:24 +03:00
README.md Docker support (#99) 2023-08-06 18:22:54 +00:00
autogen.sh add amd64-{51-30k,64-24k} from SUPERCOP, now use autoconf 2017-09-27 02:35:56 +03:00
base16.h improvements all over the place 2017-09-25 20:49:47 +03:00
base16_from.c some more explicitness 2018-02-23 00:11:20 +00:00
base16_to.c init 2017-09-24 22:13:16 +03:00
base32.h harden pseudo-YAML validation 2018-07-12 12:11:44 +00:00
base32_from.c some more explicitness 2018-02-23 00:11:20 +00:00
base32_to.c improvements all over the place 2017-09-25 20:49:47 +03:00
base64.h split worker off 2019-03-16 21:57:29 +02:00
base64_from.c stronger base64 validation 2018-07-12 11:56:43 +00:00
base64_to.c optional functionality for writing results to the single file and extracting specific keys from it 2018-07-06 13:16:48 +03:00
calcest.c more stuff 2022-05-17 16:01:52 +00:00
common.h rawyaml mode 2020-01-17 14:15:56 +00:00
configure.ac some cleanups & make depend 2022-05-31 02:11:40 +03:00
cpucount.c glibc isn't limited to linux 2019-03-31 19:26:53 +00:00
cpucount.h explicit void declaration, remove unused arg. thanks ccomp 2017-10-23 02:15:23 +00:00
filters.h explicit void params declarations, add warnings to keep it correct 2019-05-14 20:29:27 +03:00
filters_common.inc.h fix intfilter expansion logic 2021-03-21 16:52:15 +00:00
filters_inc.inc.h various things 2020-11-21 11:34:25 +00:00
filters_main.inc.h whatever i implemented it anyway 2021-03-21 17:16:23 +00:00
filters_worker.inc.h split worker off 2019-03-16 21:57:29 +02:00
hex.h add numwords functionality 2017-10-22 05:07:45 +00:00
ifilter_bitsum.h fix compilation err in non-intfilter cases 2021-03-23 10:36:42 +00:00
ioutil.c fix syncwritefile on windows 2022-06-24 18:08:51 +00:00
ioutil.h make checkpoint stuff actually proper 2021-12-08 20:14:20 +00:00
keccak.c explicit void declaration, remove unused arg. thanks ccomp 2017-10-23 02:15:23 +00:00
keccak.h explicit void declaration, remove unused arg. thanks ccomp 2017-10-23 02:15:23 +00:00
likely.h some fixes and optimizations 2017-09-27 21:38:15 +03:00
main.c better ruler fix 2023-09-06 02:24:14 +03:00
test_base16.c delet trailing whitespace 2018-07-12 13:05:53 +00:00
test_base32.c delet trailing whitespace 2018-07-12 13:05:53 +00:00
test_base64.c cleanups, make clang happy 2019-03-15 21:04:40 +00:00
test_ed25519.c rebase on newer SUPERCOP, use PIE, some other stuff 2022-05-05 13:22:34 +00:00
testutil.h small cleanup, makefile preparation for calcdiff 2019-12-22 22:01:26 +02:00
types.h more flexible intfilter config 2017-10-22 01:58:22 +00:00
vec.c some vec tweaks 2017-10-10 03:14:45 +00:00
vec.h small fixup, implement deduplication support 2018-09-26 20:54:14 +03:00
worker.c onionready: always refer warnnear 2023-09-06 02:15:13 +03:00
worker.h near passkeys skip/warn modes & help tweak 2023-09-06 01:00:04 +03:00
worker_batch.inc.h near passkeys skip/warn modes & help tweak 2023-09-06 01:00:04 +03:00
worker_batch_pass.inc.h near passkeys skip/warn modes & help tweak 2023-09-06 01:00:04 +03:00
worker_impl.inc.h remove slow/fast workers 2023-06-09 17:16:46 +03:00
yaml.c more helpful error messages 2022-12-19 18:30:24 +02:00
yaml.h rawyaml mode 2020-01-17 14:15:56 +00:00


mkp224o - vanity address generator for ed25519 onion services

This tool generates vanity ed25519 (hidden service version 3, formely known as proposal 224) onion addresses.

Requirements for building

  • C99 compatible compiler (gcc and clang should work)
  • libsodium (including headers)
  • GNU make
  • GNU autoconf (to generate configure script, needed only if not using release tarball)
  • UNIX-like platform (currently tested in Linux and OpenBSD, but should also build under cygwin and msys2).

For debian-like linux distros, this should be enough to prepare for building:

apt install gcc libc6-dev libsodium-dev make autoconf


Run ./autogen.sh to generate a configure script, if there isn't one already.

Run ./configure to generate a makefile. On *BSD platforms you may need to specify extra include/library paths: ./configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib".

On AMD64 platforms, you probably also want to pass something like --enable-amd64-51-30k to the configure script invocation for faster key generation; run ./configure --help to see all available options.

Finally, make to start building (gmake in *BSD platforms).


mkp224o needs one or more filters to work. You may specify them as command line arguments, eg ./mkp224o test, or load them from file with -f switch.

It makes directories with secret/public keys and hostnames for each discovered service. By default, the working directory is the current directory, but that can be overridden with -d switch.

Use -s switch to enable printing of statistics, which may be useful when benchmarking different ed25519 implementations on your machine.

Use -h switch to obtain all available options.

I highly recommend reading OPTIMISATION.txt for performance-related tips.

FAQ and other useful info

  • How do I generate address?

    Once compiled, run it like ./mkp224o neko, and it will try creating keys for onions starting with "neko" in this example; use ./mkp224o -d nekokeys neko to not litter current directory and put all discovered keys in directory named "nekokeys".

  • How do I make tor use generated keys?

    Copy key folder (though technically only hs_ed25519_secret_key is required) to where you want your service keys to reside:

    sudo cp -r neko54as6d54....onion /var/lib/tor/nekosvc

    You may need to adjust ownership and permissions:

    sudo chown -R tor: /var/lib/tor/nekosvc
    sudo chmod -R u+rwX,og-rwx /var/lib/tor/nekosvc

    Then edit torrc and add new service with that folder.
    After reload/restart tor should pick it up.

  • How to generate addresses with 0-1 and 8-9 digits?

    Onion addresses use base32 encoding which does not include 0,1,8,9 numbers.
    So no, that's not possible to generate these, and mkp224o tries to detect invalid filters containing them early on.

  • How long is it going to take?

    Because of probablistic nature of brute force key generation, and varience of hardware it's going to run on, it's hard to make promisses about how long it's going to take, especially when the most of users want just a few keys.
    See this issue for very valuable discussion about this.
    If your machine is powerful enough, 6 character prefix shouldn't take more than few tens of minutes, if using batch mode (read OPTIMISATION.txt) 7 characters can take hours to days.
    No promisses though, it depends on pure luck.

  • Will this work with onionbalance?

    It appears that onionbalance supports loading usual hs_ed25519_secret_key key so it should work.

  • Is there a docker image?

    Yes, if you do not wish to compile mkp224o yourself, you can use the ghcr.io/cathugger/mkp224o image like so:

    docker run --rm -it -v $PWD:/keys ghcr.io/cathugger/mkp224o:master -d /keys neko

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see CC0.

  • keccak.c is based on Keccak-more-compact.c
  • ed25519/{ref10,amd64-51-30k,amd64-64-24k} are adopted from SUPERCOP
  • ed25519/ed25519-donna adopted from ed25519-donna
  • Idea used in worker_fast() is stolen from horse25519
  • base64 routines and initial YAML processing work contributed by Alexander Khristoforov (heios at protonmail dot com)
  • Passphrase-based generation code and idea used in worker_batch() contributed by foobar2019