Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Double-check key generation by signing and verifying using the keypair #276

Open
chris-belcher opened this issue Oct 15, 2015 · 0 comments

Comments

@chris-belcher
Copy link
Collaborator

When a keypair is created, sign and verify something to check the key generation has worked. The hash can be anything, random data or even a constant.

Put this in get_new_address() probably.
Will slow it down slightly (not by much) and it will only be noticeable for wallet-tool.py, but its worth it.

It's not just a hypothetical concern, in the bitcoin ecosystem it's happened several times that a wallet incorrectly generated the pubkey and send user's funds into space.

in bitcoin core we always use a newly generated key to sign and verify the signature to double check the generation. (in case the users computer glitches or the software screws up)

If it fails, then crash and create a file "DO_NOT_REMOVE_THIS_FILE_UNTIL_YOU_HAVE_VERIFIED_YOUR_HARDWARE_IS_NOT_BROKEN", and then refuse to start again with a polite message.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant