What the hack is a “Private & Public Key Pairs” in blockchain?

Andy Fung
3 min readNov 10, 2021

Last time, we talked about the mechanism behind Blockchain. If you have no idea what is happening under the hood, you can watch my article Visual Approach to Understand Blockchain here. We will move on to another interesting topic: Private & Public Key Pairs

What the hack is a “Private & Public Key Pairs”?

Private & Public Key
  1. What Problems Do Private & Public Key Pairs Solve?
    In blockchain world, how do we prevent someone from altering the transaction that spends all of someone else’s money to them? Private & Public Key Pairs come to rescue.
  2. Definition
    Public & Private Key:
    The generation of Public and Private key pairs depends on cryptographic algorithms
    Private Key:
    Private Key is the digital signature of yourself and you should keep it secretly.
    Public Key: Public Key and Private Key are mathematically linked. You can show your Public Key to someone else. Even though the keys are linked together, they can not be derived from each other. In other words, if you know someone’s public key, you can not derive his/ her private key
  3. How Does It Work in Blockchain

a) To let others know that you are the one who send the data (i.e. make the transaction in real world scenario), we use the private key to e-sign the data and generate a message signature.

b) Given the message, public key and message signature, we can verifying the authenticity of digital messages or documents using the a signature verifying algorithm.

Verified

If someone try to alter the data, the message’s claim to authenticity is rejected

Digital signature

We can apply the same logic in real world scenario.

We can use private key to e-sign the transaction and generate a message signature

Verified transaction

Given the message, message signature and the public key (crypto wallet address), we can verify the authenticity of the transaction and the transaction is not altered in transit.

If someone try to alter the transaction, the transaction’s claim to authenticity is rejected.

--

--

Andy Fung

Self taught grow marketer with experience in Python and Javascript