bitshares1-core
bitshares1-core copied to clipboard
valid WIF private key does not validate
https://bitsharestalk.org/index.php?topic=13340.0;topicseen
I think this is the problem:
>>> PrivateKey.fromWif("5H2m3sfuRM51FwxeMURLto7sqZ58mgQYi7jrRxGAFKrK")
AssertionError: Expected version 128, instead got 63
The version is the 1st unsigned byte in the decoded private key.
Actually, there is more to this.. the checksum does not match how we are calculating it. If we support this, the private key import could be enhanced to check the version and then verify the checksum a little differently.
Here is my comment: # BTS checksum includes the version
So not all WIF keys are created equal? Is there any info about what all the different variations are?
https://en.bitcoin.it/wiki/List_of_address_prefixes
Bitcoin-js is ignoring the version byte: https://github.com/bitcoinjs/bitcoinjs-lib/blob/e42c497a3c9afe67c86ba0a602b5a0e9bd66e604/src/eckey.js#L32-L33
Wait what does the network byte have to do with this? I thought private keys had no network byte and they are only added when creating the address?
From my understanding it is safe to use the same private key over and over .. i.e. in BTS, MUSIC, PLAY .. but also in Bitcoin .. or am I missing something here?
It is about as secure as using the same password on every website where you're registered. IOW: don't do that.