Author

Topic: At what point does Electrum decipher a private key? (Read 107 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip- What I've noticed is that if I enter the private key in that window the Next button becomes ungreyed.
Sorry if noob question.
The "checksum" that was mentioned in the first post and had been mentioned repeatedly is the keyword.

Without going technical and disregarding the Base58 decode part:
It's basically the last few characters of the WIF private key, that was created by hashing the other parts of the prv key and it's inserted at the end as a the checksum.
So changing a character from the first few characters of the private key will produce a different hash that will mismatch with the checksum.
Or changing a character from the last few characters (checksum) will make the checksum different than the hash of the rest of the characters.
A mismatch means an invalid WIF (Wallet Import Format) private key.
legendary
Activity: 3472
Merit: 10611
Bitcoin private keys are strings that are encoded using a special encoding called Base58. This encoding uses a checksum in it which helps you quickly figure out if the input has any mistakes in it such as a typo. Because of this you can validate a bitcoin private key string easily by a simple decoding and a SHA256 (checksum) computation.
You can read about this encoding and the way private keys (aka WIFs) are encoded in the following two links:
https://en.bitcoin.it/wiki/Wallet_import_format
https://en.bitcoin.it/wiki/Base58Check_encoding
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
Thanks. What I am really trying to understand is is it possible for my to validate my private key using Electrum on an offline PC but without creating a new wallet or sweeping it? What I've noticed is that if I enter the private key in that window the Next button becomes ungreyed. However if I enter that private key with a single character deviation the Next button remains greyed out. In essence I have an old priavte key that I would like to test is still valid but without moving the funds from it.
It is possible.

Electrum will derive the address using the private key that you've provided. The reason why it becomes greyed after a small deviation is due to the fact that there is a checksum in the last few digits of the private key which checks whether the key is entered correctly. This helps the user to identify if they've mistyped their keys. If you're able to derive the correct address from the private key offline, then it would be valid. You don't have to be online to do so, Electrum doesn't interact with any server to generate an address.
newbie
Activity: 17
Merit: 6
Thanks. What I am really trying to understand is is it possible for my to validate my private key using Electrum on an offline PC but without creating a new wallet or sweeping it? What I've noticed is that if I enter the private key in that window the Next button becomes ungreyed. However if I enter that private key with a single character deviation the Next button remains greyed out. In essence I have an old priavte key that I would like to test is still valid but without moving the funds from it.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Any number is technically a valid private key (once the remained is taken of division of the limit to the function - p)..

What electrum is actually checking is that the checksum and private key match. In one format I remember this being 7 characters at the end of the key (im not sure what format that was though).

Electrum may also check the checksum is present too.
newbie
Activity: 17
Merit: 6
Hi there,

When you create a new wallet in Electrum and opt to 'Import Bitcoin addresses or private keys' as the next step, at what point does Electrum decipher the private key? I've noticed that on the 'Import Bitcoin Addresses' window if you do not enter a valid private key the 'Next' button is greyed out until you do. Does that mean that at the point of entering in a valid private key and the Next button becomes ungreyed that Electrum as deciphered the private key as valid?

Sorry if noob question.

 
Jump to: