Closed Overtorment closed 4 years ago
The whole point of EC multiply is to allow you to oursource vanity address generation.
So similar to the way a passphrase added to a BIP39 phrase works, every passphrase generates a valid private key.
Only YOUR password will generate YOUR private key.
If you'd like an error, do not use EC multiply.
Question tho: how are they doing it?
https://bitcoinpaperwallet.com/bitcoinpaperwallet/generate-wallet.html#
ahhh, sorry I forgot about the salt.
In BIP38 the 4 byte salt (which you can get by doing the following)
const salt = bs58check.decode('6PfQu....').slice(3, 7);
Is the result of hash256(address).slice(0, 4)
so you should generate the address from your result wif and hash to see if the salt matches.
hmm, it looks like we do it for non-EC but we don't do it for EC...:
// verify salt matches address
var d = BigInteger.fromBuffer(privateKey)
var address = getAddress(d, compressed)
var checksum = hash256(address).slice(0, 4)
assert.deepStrictEqual(salt, checksum)
I'm not super versed in this... maybe there's a good reason we don't do this...
So for now at least you know how you can check.
Im using
6PfQu77ygVyJLZjfvMLyhLMQbYnu5uguoJJ4kMCLqWwPEdfpwANVS76gTX
from https://en.bitcoin.it/wiki/BIP_0038minimal example with incorrect password
aaa
produces
5JdGEnZHRWpGRijtAeZ1pUcgKQhn7bSQcBqjcMZUN3pxKjHPYR6
without throwing exception or returning false or anything.correct password
TestingOneTwoThree
produces correct outputThis might be
EC multiply, no compression, no lot/sequence numbers
specific, as on other examples lib does throws an exception.