What is Private Key and Public Key in Bitcoin?
In this article, Room-House would like to introduce to you what are the two concepts of Private Key and Public Key of Bitcoin and the comparison between Private Key and Public Key.
What is an e-wallet?
Cryptocurrency wallet is software that allows you to store and receive cryptocurrencies like Bitcoin, Ethereum, etc. Wallets can store multiple coins and tokens at the same time but most wallets will only support a few currencies. certain encoding.
These crypto wallets will be protected by a private key or Private Key. This is a long hexadecimal code that links from your device to your crypto wallet, and in order to use the funds in the wallet, the code must match the public key or Public Key.
Similar to traditional banking applications, you can access your balance on many different devices and the risk only occurs when you forget your password or lose your phone.
If we ignore the internal processing of wallet software and ask what is indispensable and make a wallet, it is the pair of Private Key and Public Key, they define the uniqueness of a wallet.
Here we will go to find out what the Private Key is, what is the Public Key, and compare the difference between Private Key and Public Key.
What is Private Key?
A Private Key, also known as a Private Key, is a sophisticated form of encryption that allows users to access their cryptocurrency. Private keys are an integral aspect of bitcoin and altcoins, and its security helps protect users from theft and unauthorized access to funds.
A Private Key always starts with the number 5 and it is a sequence of numbers like this: 5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF.
3 main features of Private Key:
First: Private Key is a number represented by 256 Bit: Theoretically, we should have 2256 (~1077) Private Key, but in reality, Bitcoin uses a standard called secp256k1 ECDSA and makes the sequence less than 1 slightly but not significantly, it is still a large number that falls within that range and makes it impossible to guess. Second: Losing the Private Key, your account will be lost forever: From the Private Key you can generate a Public Key, and from the Public Key you generate an address (Bitcoin address). However, the reverse process is not possible. Third: How to generate Private Key?: For a Private Key to be valid, it needs to be a number represented in 256-bit format and satisfy the secp256k1 standard. Combining those two factors, we can write a script that randomly generates a 256-bit number between 0x1 and 0x1 to 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140.
At this point, we can understand how the security of Bitcoin is related to the number of Private Keys. Private is extremely important and needs to be kept secret.
How does Private Key work?
When dealing with cryptocurrencies, users are usually provided with a public address and a private key to send and receive coins or tokens. The public address is where money is sent and received. But even if a user has tokens deposited to his address, he can withdraw them without a private key. The public key is generated from the private key through a complex mathematical algorithm. However, it is nearly impossible to reverse the process by generating the private key from the public key.
The private key can take a few different forms, often described as a series of alphanumeric characters, making it difficult for hackers to crack. Most users represent their wallet key in wallet input format, which has 51 characters. Think of a public address as a mailbox, and the private key is the key to the box. Postmen, and anyone really, can insert letters and small packages through the opening in the mailbox. However, the only person who can retrieve the contents of the mailbox is the person with the unique key. Therefore, it is important to keep the key safe because if it is stolen or received without authorization, the mailbox can be compromised.
A digital wallet that stores a user's private key. Once a transaction is initiated, the wallet software generates a digital signature by processing the transaction with the private key. This maintains a secure system as the only way to generate a valid signature for any given transaction is to use a private key. The signature is used to confirm that a transaction has come from a particular user and ensures that the transaction cannot be changed once it is broadcast. If the transaction is changed, even slightly, the signature will change.
If a user loses their private key, they cannot access the wallet to spend, withdraw or transfer funds. Therefore, it is imperative to store the private key in a secure location. There are several ways that digital wallets containing private keys can be stored. The private key can be stored on a paper wallet which is a document that has been printed with the private key and a QR code on it so that it can be easily scanned when a transaction is needed.
The private key can also be stored with a hardware wallet that uses a smart card or USB device to generate and secure the private key offline. An offline software wallet can also be used to store private keys. This wallet has an offline partition for private keys and an online partition where public keys are stored. With an offline software wallet, a new transaction is transferred offline to be digitally signed and then moved back online to be broadcast to the crypto network.
What is Public Key?
A Public Key, also known as a public key, is a cryptographic code that allows a user to receive cryptocurrency into his or her account. Public keys along with private keys are important tools required to ensure the security of the crypto economy.
The formula for calculating Public Key is simplified as follows: Public_key = Private_key * G. Public_key is the geometrically multiplying G times Private_key.
How does Public Key work?
When a user initiates his or her first transaction in bitcoin or altcoins, a public and private key pair is generated. Each key is a long string of alphanumeric characters that keep the user safe in the digital ecosystem. The private key is known to the user alone and serves as the user's digital ID. The private key allows the user to spend, withdraw, transfer or make any other transaction from his account. A sophisticated algorithm is applied to the private key to generate the public key, and both keys are stored in a digital wallet.
When a transaction is initiated by a user to send, for example, bitcoins, to another, the transaction must be broadcast to the network where distributed nodes (i.e. those behind computers) validate the validity of the transaction. transaction before it is completed and recorded on the blockchain. Before the transaction is broadcast, it is digitally signed with a private key. The signature proves ownership of the private key, although it does not reveal the details of the private key to anyone. Since the public key is styled from the private key, the user's public key is used to prove that the digital signature comes from his private key. Once the transaction has been verified as valid, the funds will be sent to the recipient's public address.
The public address is the hashed version of the public key. Because the public key is made up of an extremely long string of numbers, it is compressed and shortened to form a public address. In effect, the private key generates the public key, which in turn generates the public address. When two people enter into an agreement in which one sends other tokens or coins, they reveal their public addresses to each other. A public address is like a bank account number. The sender needs the number to be able to send money to the recipient, who will then be able to spend or withdraw using his private key. The receiver can also verify the sender's coin batch using the sender's public address which will be displayed on the sender's screen.
Although the public key and the address are processed from the private key, the reverse is almost impossible. The cryptocurrency network is secured using complex mathematical functions to ensure that the private key cannot be processed from the public key, especially since everyone on the network sees its public key and its hash. . Since it is not possible to regenerate a private key from a public key or an address, if a user loses his private key, any bitcoins or altcoins at his public address will be inaccessible forever. Otherwise, a user who loses his public key can be regenerated with a private key.
Example so you can better understand Public Key/Address and Private Key Let's look at how a Bitcoin transaction works.
If Tom transfers 1 amount of Bitcoin to Jenny. To transfer Bitcoin, you need 2 things: a Bitcoin address and a Private Key. A Bitcoin address is randomly generated, it is simply a sequence of letters and numbers. A Private Key is another alphanumeric string, but unlike a Bitcoin address, it is kept secret.
Imagine your Bitcoin wallet as a safe deposit box with a front glass. Everyone can tell what's inside, but only the Private Key can open it and take everything away or put everything in.
When Tom wants to transfer Bitcoins to Jenny, he will use his Private Key to sign a message with the Incoming Source (the transaction source of the Bitcoin amount), the Amount, and the Output Source (Jenny's Bitcoin address).
He then transfers from his Bitcoin wallet to the vast Bitcoin network. From this network, Bitcoin miners confirm the transaction, place it in a transaction block, and finally the transaction is settled.
Simply put:
The Public Key is the equivalent of your email address. The Private Key is the equivalent of the password you use to log into your email account. Bitcoin in particular and virtual money in general is becoming a hot trend and field in recent times, knowledge about them and Blockchain can open up a lot of new opportunities.
Hopefully my article can give you a clearer view from a technical perspective.