-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
We are testing out the wallet component of bitcoinjs-lib, and fell upon a rather concerning error.
Sometimes when generating a new public-private key pair, the eckey.toWif function will returned a malformed private key that does not match its public key.
var wallet = new Wallet();
wallet.newMasterKey();
pub = wallet.generateAddress();
var priv = wallet.getPrivateKeyForAddress(pub);
priv = priv.toWif(); // This is randomly malformed
In pressure testing, we saw this occur approximately twice every 1000 keys generated. You can test this yourself with this GIST:
https://gist.github.com/moeadham/10217078
Unfortunately, we have not done a root cause analysis to see exactly what is causing the error (we will), but if anyone is using this in production to generate public-private key pairs, I would suggest double checking your Secret key matches the public key.
moe@bitaccess
Metadata
Metadata
Assignees
Labels
No labels