Bitcoin Forum
June 08, 2024, 11:17:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How Electrum knows to validate BTC private key?  (Read 175 times)
Unsaint32 (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 7


View Profile
August 15, 2019, 01:41:12 PM
 #1

So I am learning Electrum wallet on my windows 10 desktop.  To sweep my BTC from paper to the Electrum wallet, I type in my private key in the Electrum.  I type one letter wrong, and the Electrum's "next" button remains grayed out.  As soon as I type in the correct letter, the "next" button is now ready.  My question is...  How does Electrum know whether it is a valid key?   
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3500
Merit: 6154



View Profile
August 15, 2019, 01:48:50 PM
 #2

Whether the private keys is valid or not is totally based on what you entered and whether it follows the proper format or not.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
August 15, 2019, 06:43:56 PM
Merited by HCP (2), hugeblack (1)
 #3

A private key - basically - is just a random 256 bit number.
But what you import into electrum is most likely the private key in the WIF (= Wallet Import Format).

And the WIF key contains a checksum. So each wallet can easily check whether it is a valid private key or not by looking at the checksum (last 4 byte).

You can read more about the wallet import format here.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!