Blockchain Semantics Insights
Business Case | Deep Tech | Announcements | Blockchain Glossary |
What are address, public key and private key on a blockchain and how are they generated?June 29, 2018, 9:52 a.m. GMT
An address is just like an account number in bank. It denotes your unique identity on the blockchain from which you can transfer out cryptocurrency and to which you can receive cryptocurrency. In blockchain a standard address has something like 34 signs and starts with a 1. It may look something like 1K31KXZjcochXpRhjH9g5MxFFTHPi2zEXb.
Every address on the bitcoin blockchain comes attached with a Private key and a Public key. These together form the pillars of security in the Blockchain network. Private and Public keys always work in a pair. The private key is a string that looks the way the address does and is unique to the owner of a particular Bitcoin address. The owner of this Bitcoin address uses his private key to digitally sign any transaction that he makes. The public key is a long alphanumeric string that is generated by the private key to an account and this can be publicly shared so that miners can verify digitally signed transactions. As the name suggests, a user’s private key is private to the user and the public key is known to everyone. Think of it like a mailbox. Everyone can drop a message to your mailbox but only you can open it using a key to the mailbox. Here, the mailbox is the public key and the key to the mailbox is the private key.
First, any wallet collects entropy and uses it to generate an ECDSA private key. ECDSA is the cryptographic algorithm in the core of Bitcoin addresses. It is an asymmetric signature algorithm, which means that you can sign messages with the PRIVATE key and verify the signature with the PUBLIC key. With ECDSA you can give the world easily the information to prove that you – and only you – are the author of a message by signing it. It’s very similar to physically signing a letter. As described, private and public keys are asymmetrical. This means that anyone can generate the corresponding public key if they know the private key. But, it is impossible to generate the private key from the public key.The cryptographic algorithm used to generate the public key from the private key is known as ECDSA or Elliptic Curve Digital Signature Algorithm. Apply the ECDSA on the private key to get the public key. But it is a one-way function, there is no way to derive the private key from the public key.
As discussed, there is another key entity apart from the private and public key- the address. As the name suggests the transactions are directed towards a address. For example if A wants to send some money to B then he will use B’s address to send money.
Now let’s see how this address is generated. It is a derivative of the public key. Multiple cryptographic algorithms run on the public key to generate the address. The software hashes the public key with SHA 256 and the result with RIPEMD-160. Then it adds the bytes 00 as a prefix in the beginning of the resulting string. Note that these techniques are pertinent to the bitcoin blockchain.
To learn more about Blockchain, Bitcoin and how addresses, public keys and private keys interact together to create a safe environment on Blockchain, please visitBlockchain and Bitcoin Certification by Blockchain Semantics.