Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add secp256k1_ec_grind to grind keypairs #507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sipa
Copy link
Contributor

@sipa sipa commented Feb 9, 2018

Unsure if this should be in upstream, but it may be useful for things like shaving off a few bytes from signatures.

nym-zone added a commit to nym-zone/secp256k1 that referenced this pull request Feb 13, 2018
nym-zone added a commit to nym-zone/segvan that referenced this pull request Feb 13, 2018
This is an early, experimental implementation of vanity search using the
secp256k1_ec_grind() patch by Pieter Wuille (sipa).  Initial tests find
that for appropriate (not-too-short) patterns, vanity generation by this
means runs 5x faster than the code currently on master.  (This means a
total of about a 25x speedup over the OpenSSL-based version I made in
December.)  Thanks to Greg Maxwell for the tip.

References:

 - bitcoin-core/secp256k1#507
 - https://bitcointalk.org/index.php?topic=2934774.msg30174356#msg30174356

My own code here code is unoptimized, and UNTESTED for correctness
of outputs.  I usually do not check code into a public repo unless I
have at least verified that it produces correct privkey/pubkey/addr
tuples.  In this case, I am committing this while exhausted after many
hours wrestling with a GNU autoconf problem (worked around by a one-line
Makefile change in this commit), and then fixing a subtle stupid mistake
I made.  I may have made other dumb mistakes.  Do not rely on this yet.
THIS CODE MAY EAT YOUR COINS.  I will test and clean it up later.

Apologies for the non-atomic commit.  There are a few reasons it had to
be that way.
@kallewoof
Copy link
Contributor

kallewoof commented Jul 2, 2018

Tested ACK 885ea63

This PR is used as is in https://github.com/kallewoof/btcdeb/tree/vanitygen -- I verified that the keypair is valid.

I grinded bc1qkallealmkdwwyuc2tmf5c6hzmlaujq6jl38hpe using this, and sent myself 10k goodly satoshi, which a wallet with the imported private key saw in its balance, and could sign transactions for. "ismine": true also appeared in getaddressinfo output. As Nicolas Dorier would put it, I ate my own (@sipa's, rather) dog food.

@sipa sipa force-pushed the 201802_grind branch 3 times, most recently from 37a2bdd to 8c4df23 Compare September 20, 2021 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants