Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: canton on April 24, 2013, 07:50:28 PM



Title: Why does blockchain.info let me import an invalid WIF private key?
Post by: canton on April 24, 2013, 07:50:28 PM
Because here's the thing, if I click to import a private wallet, and then type in a valid wallet import key, but then intentionally mess up five or six of the characters, blockchain.info still reassures me that it imported the wallet.

Isn't there supposed to be a WIF wallet import format checksum or something that would alert you if you'd made a typo?

http://f.cl.ly/items/0o342I2r2R1d39201k2N/Screen%20Shot%202013-04-24%20at%201.50.41%20PM.png


Title: Re: Why does blockchain.info let me import an invalid WIF private key?
Post by: piuk on April 24, 2013, 07:54:56 PM
It's a bug with the pk format detection. The Key is no longer a valid WIF key however it is still a valid base 58 key so the key is imported as base 58 instead.


Title: Re: Why does blockchain.info let me import an invalid WIF private key?
Post by: canton on May 28, 2013, 07:36:45 PM
It's a bug with the pk format detection. The Key is no longer a valid WIF key however it is still a valid base 58 key so the key is imported as base 58 instead.

But if I was randomly futzing around with the digits, shouldn't this fail as a valid base 58 of any kind, since the checksums won't add up?


Title: Re: Why does blockchain.info let me import an invalid WIF private key?
Post by: DannyHamilton on May 29, 2013, 12:16:32 AM
It's a bug with the pk format detection. The Key is no longer a valid WIF key however it is still a valid base 58 key so the key is imported as base 58 instead.
But if I was randomly futzing around with the digits, shouldn't this fail as a valid base 58 of any kind, since the checksums won't add up?

WIF has a checksum, Base 58 does not.


Title: Re: Why does blockchain.info let me import an invalid WIF private key?
Post by: canton on May 29, 2013, 02:44:22 PM
WIF has a checksum, Base 58 does not.

Can anyone point me to the spec on this? I just keep finding Base58 specs that *do* include 4 byte checksums e.g.

https://en.bitcoin.it/wiki/Base58Check_encoding (https://en.bitcoin.it/wiki/Base58Check_encoding)

Are there such things as Base58 checkless keys?


Title: Re: Why does blockchain.info let me import an invalid WIF private key?
Post by: DannyHamilton on May 29, 2013, 02:50:54 PM
WIF has a checksum, Base 58 does not.

Can anyone point me to the spec on this? I just keep finding Base58 specs that *do* include 4 byte checksums e.g.

https://en.bitcoin.it/wiki/Base58Check_encoding (https://en.bitcoin.it/wiki/Base58Check_encoding)

That is Base58Check encoding.  That is Wallet Import Format (WIF).

Base 58 itself (not base58check) is just a numbering system with a radix of 58 (like binary has a radix of 2, octal a radix of 8, hexadecimal a radix of 16, decimal a radix of 10, etc.)

Are there such things as Base58 checkless keys?

Yes.  When it is not in WIF, a private key is just a very big number.  Any number between 0x1 and 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4141 is a valid private key.  Using base 58 simply allows you to represent that number with fewer digits (making it easier to type/write).