10gic / vanitygen-plusplus

A vanity address generator for BTC, ETH, LTC, TRX and 100+ more crypto currencies.
GNU Affero General Public License v3.0
269 stars 94 forks source link

XLM support? #2

Closed thomasb9511 closed 4 years ago

thomasb9511 commented 4 years ago

Would it be possible to add support to gen Stellar XLM addresses?

10gic commented 4 years ago

XLM use ED25519, rather than secp256k1. It can't support XLM only by adding configuration in file base58prefix.txt. As OpenSSL support Ed25519, it's not very difficult to support it.

https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md https://fchainio.github.io/fireflydoc/en/stellar/#stellar-101

10gic commented 4 years ago

@thomasb9511 XLM is supported now.

Prefix example:

$ ./vanitygen++ -C XLM GAAA
Generating XLM Address
XLM patterns GAAA
XLM Address: GAAAI4FDQSNOYE2LRQTUEOYBALDHBA5X2W6Y3DXKHTLWBY3MZIOTIXBO
XLM Privkey: SAOAWAUMIO44YQME4PH7MQKK2LAAQ4UTL6IHTQ2LOZARZ4SFILZI5UYF

Postfix example:

$ ./vanitygen++ -C XLM -r 'XLM$'
Generating XLM Address
XLM patterns XLM$
XLM Address: GDQ5KHUHX2SQ5II6B3PW6VSJHWOLIZ2OW45PRY4IZH5FBWJANQ2LCXLM
XLM Privkey: SCLO4IXZN54VPDTFTIF6Y5ZYWJGZZZGOBA3VU3Z5JFN47TRJHROCAHSH

It's not supported in GPU version (oclvanitygen++) currently. The CPU version (vanitygen++) also fast.

thomasb9511 commented 4 years ago

@10gic

I seem to have issues compiling.

cc -ggdb -O3 -Wall   -c -o vanitygen.o vanitygen.c
cc -ggdb -O3 -Wall   -c -o pattern.o pattern.c
cc -ggdb -O3 -Wall   -c -o util.o util.c
cc -ggdb -O3 -Wall   -c -o groestl.o groestl.c
cc -ggdb -O3 -Wall   -c -o sha3.o sha3.c
cc -ggdb -O3 -Wall   -c -o ed25519.o ed25519.c
ed25519.c: In function ‘thread_loop_ed25519’:
ed25519.c:82:46: error: ‘EVP_PKEY_ED25519’ undeclared (first use in this function); did you mean ‘EVP_PKEY_DSA1’?
     EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_ED25519, NULL);
                                              ^~~~~~~~~~~~~~~~
                                              EVP_PKEY_DSA1
ed25519.c:82:46: note: each undeclared identifier is reported only once for each function it appears in
ed25519.c:112:9: warning: implicit declaration of function ‘EVP_PKEY_get_raw_public_key’; did you mean ‘EC_KEY_get0_public_key’? [-Wimplicit-function-declaration]
         EVP_PKEY_get_raw_public_key(pkey, (unsigned char *)&pub_buf, &buf_len);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
         EC_KEY_get0_public_key
ed25519.c:148:17: warning: implicit declaration of function ‘EVP_PKEY_get_raw_private_key’; did you mean ‘EC_KEY_get0_private_key’? [-Wimplicit-function-declaration]
                 EVP_PKEY_get_raw_private_key(pkey, (unsigned char *)&priv_buf, &buf_len);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 EC_KEY_get0_private_key
make: *** [<builtin>: ed25519.o] Error 1
thomasb9511 commented 4 years ago

Turns out my openssl libraries weren't 1.1.1

10gic commented 4 years ago

Yes, openssl 1.1.1 is requried for ED25519. https://www.openssl.org/news/cl111.txt