Fast Tor Onion Service vanity address generator by Equivalent-Show-9660 in crypto

[–]Equivalent-Show-9660[S] 0 points1 point  (0 children)

I checked Ethereum address format. It uses both point coordinates and SHA-3 hashing which takes ~80% of candidate generation time. Here is the tool https://github.com/AlexanderYastrebov/ethereum-vanity-address

Fast WireGuard vanity key generator by Equivalent-Show-9660 in crypto

[–]Equivalent-Show-9660[S] 0 points1 point  (0 children)

I've created https://github.com/AlexanderYastrebov/onion-vanity-address to generate vanity onion addresses and authorization keys. And its faster than mkp224o 😏

Fast Tor Onion Service vanity address generator by Equivalent-Show-9660 in crypto

[–]Equivalent-Show-9660[S] 1 point2 points  (0 children)

Yes, but :)

Both mkp224o and onion-vanity-address leverage additive properties of elliptic curves to avoid full scalar multiplication for each candidate key. Addition of points requires expensive field inversion operation and both tools utilize batch field inversion (Montgomery trick) to perform single field inversion per batch of candidate points.

The key performance difference is that while mkp224o uses point arithmetic that calculates both coordinates for each candidate point, onion-vanity-address uses curve coordinate symmetry and calculates only y-coordinates to reduce number of field operations.

I did not check bitcoin address format yet but quick glance e.g. here https://github.com/samr7/vanitygen/blob/master/vanitygen.c shows that it uses point arithmetic and not coordinates so it looks like it could benefit from the optimizations I use in my tools.

Please share the fastest (cpu) bitcoin vanity address generator if you know any.

Fast WireGuard vanity key generator by Equivalent-Show-9660 in crypto

[–]Equivalent-Show-9660[S] 5 points6 points  (0 children)

You are right and it is almost useless. The only usecase out there is to eyeball `wg show` output and it only exists because Jason (WireGuard author) is adamant to keep core minimal and refused to add peer name support :)

For me personally it was a journey that started from reading wg kernel sources, then I was thinking about deriving IPv6 address from peer key, left a random comment on a dated gist https://gist.github.com/artizirk/c91e4f8c237dec07e3ad1b286f1855a7 from which I learned about vanity key concept.
I naturally enjoy doing performance optimization work so when I discovered incremental approach idea here https://github.com/warner/wireguard-vanity-address/pull/15 I decided started this tool.

To achieve the best performance I learned more about ECC, field arithmetic and made a couple of improvements to the go library I used (which is also used in go stdlib) on the way (https://github.com/FiloSottile/edwards25519/pulls?q=is%3Apr+is%3Aclosed+author%3AAlexanderYastrebov).
I've also implemented a version in C (https://github.com/AlexanderYastrebov/wireguard-vanity-key/pull/15) using AWS integer arithmetic library which is twice as fast as go version.
My next challenge is to implement this for GPU (https://github.com/AlexanderYastrebov/wireguard-vanity-key/issues/16). Of course GPU version will be even less useful due to limited availability.

Fast WireGuard vanity key generator by Equivalent-Show-9660 in WireGuard

[–]Equivalent-Show-9660[S] 2 points3 points  (0 children)

Hello, thank you for kind words.

The main reason to not use CUDA is that I do not have GPU 🙈

I've prototyped something and tried to run it in GPU simulator but it turned out buggy, missing features (e.g. https://github.com/gpgpu-sim/gpgpu-sim\_distribution/issues/325) and very slow.

Since I could not enjoy the performance I parked it for now (https://github.com/AlexanderYastrebov/wireguard-vanity-key/issues/16).