Vanity Addresses and Keys
What are vanity addresses and how to generate them: SSH, PGP, ETH, BTC, TOR and I2P
Obtaining a personalized (vanity) address can make it be unique and stand out.
An address is usually a string of alphanumerical characters that uniquely identify a resource such as domain names on alternative networks (TOR, I2P, …) or a crypto wallet. Note that most of the time those kind of addresses make use of asymmetric cryptography where the public key is the address.
A key is a parameter used in public key cryptography and can be represented by alphanumerical characters or a fingerprint. PGP make use of a pair of keys (public and private) and a fingerprint which identifies them. SSH keys also behave in the same way.
Simplifying, to create a pair of asymmetric keys a random number is fed into a math function which is not reversible. The outcome of this function generate both keys. While it's impossible to create directly a keys pair with the desired features, the process use to generate them can be autonomous allowing a brute-force approach. Here are the steps I took to generate various vanity addresses.
SSH
I was looking for a personalized public key with my name in it and I found this tool:
./vanityssh-go --regex '(?i)[+/]fabrice([+/]|$)
After quite some time i got my public key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGmMu+K2UNZAroHx1ia9u1WrWaaAB9igxGyt/fAbriCe
PGP
Custom fingerprint, composed of 40 hex characters
paru -Syyu rustup clang
rustup install stable
rustup default stable
cargo install vanity_gpg
vanity_gpg -c Ed25519 -j8 -u "Name <e-mail>" -p 'FAB41CE.{17}FAB.*'
And I got FAB4 1CEC DF4A 78EA 32C1 AB3D FAB6 1F5B AA7E AA7D
You can then proceed to change the key details such as expiration date, trust, validity…:
ETH & BTC
In this case I wanted a personalized address containing my name, case insensitive. Keep in mind that there are strict rules on what character are allowed and how the address should start:
Any ETH address must start with 0x
and contain only hexadecimal characters (0123456789abcdef
), so the letters r
and i
can't be present.
BTC addresses use Base58 (like Base64 but without similar character: IOl0+/
) and must start with either 1
, 3
, bc1q
or bc1p
depending on what type of address it is.
BTC: ./vanitygen++ -i -o BTC 1fabric
⇛ 1fabric4vMrN3zyCGoe3soNG3RqJ5czgv
ETH: ./vanitygen++ -C ETH -i -o ETH fab41ce
⇛ 0xfab41ceBF70eB0fAD05684E9C17AA37e7612cb5a
TOR
Custom .onion
domain starting with mfabrice
paru -Syyu libsodium
git clone https://github.com/cathugger/mkp224o.git; cd mkp224o
./autogen.sh
./configure --enable-donna --enable-intfilter #ARM processors
# ./configure --enable-amd64-64-24k --enable-intfilter #x86 processors
make
./mkp224o -s -d out/ mfabrice
And I got my custom domain: mfabricev6qriidybi2xpjb7u2xwbcsyy6kxfbx7yg2r3rrjtkwsslad.onion
I2P
Custom .i2p
domain starting with fabrice
. Note that you can register a "normal" domain: http://reg.i2p/add. The tool is packaged into the AUR but doesn't compile.
git clone --recursive https://github.com/purplei2p/i2pd-tools; cd i2pd-tools
make
./vain -o fabrice.dat fabrice
./keyinfo fabrice.dat
And I got my custom domain: fabricexhumxqngfziy4xkao5m5ez27jpih4chtmigg46eu7rroa.b32.i2p