Bit-Wasp / bitcoin-lib-php

PHP libraries implementing bitcoin key functions, as well as BIP32 and electrum.
The Unlicense
136 stars 86 forks source link

fixed using >= when generating privatekey #75

Closed rubensayshi closed 9 years ago

rubensayshi commented 9 years ago

for w/e reason this was actually working though xD ...

afk11 commented 9 years ago

Yeah, hard to say what happened there.. Least the odds of landing on an invalid key are minute - an invalid key means you are within ~000000000000000000000000000000004fffffffffffffffffffffffffffffff of 2^256 which in itself is a miracle :package:

I'm tempted to leave a message during the BIP32 deriv, there's the same 1:2^128 odds-of-occuring edge case that means you can't use the key you just derived, you must use the next number in the sequence. If it actually happened I'd love for the person to know the odds of it happening are astronomically high!