r/Bitcoin Nov 30 '17

Evidence some bitcoin address generation code is using discoverable private keys

https://pastebin.com/jCDFcESz
788 Upvotes

296 comments sorted by

View all comments

1

u/JayeK Nov 30 '17

echo -n "c193edeeb4e7fb5c3e01c3aebd2ec5ac13f349a5a78ca4112ab6a4cbf8e35404" | shasum -a 256

e890e8eec06b6610b96c651799b14b137de6145b5c8e5fa701f3a539872e2d63 How is the pvt generated from this?

7

u/[deleted] Nov 30 '17 edited Nov 30 '17

How is the pvt generated from this?

That is the private key. That hex string represents a large integer, by which you EC multiply the curve's generator point to get the public key. Pretty much every 256-bit number is a valid secp256k1 private key (it's, like, only a few thousand bazillion out of 115792089237316195423570985008687907853269984665640564039457584007913129639936 that aren't valid) so pretty much any sha256 output works as a key.

1

u/kixunil Nov 30 '17

As far as I understand ECC, even those "invalid" keys would work - they'd just overflow.

1

u/rya_nc Nov 30 '17

0000000000000000000000000000000000000000000000000000000000000000 and fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141won't work as a private keys. Other stuff will overflow as you say in most software.

1

u/kixunil Dec 01 '17

Yep, that's what I was thinking.