Course: Blockchain & Bitcoin 101
Section: Functions, Hash Functions, Cryptography
08 Public and Private Key Cryptography
Notes from the Video:
Each wallet is built on a public and private key pair.
Use 1:
Encryption
Purpose: Hides the contents of a message or transaction by turning it to gibberish. Only the recipient can decrypt the contents, and only by using her/his private key,
Bob generates a random number private key.
He generates a public key from it via a special formula.
The public key is derived from the private key.
The public key is for the world to see.
No one can derive the private key from the public key.
You can go from the private key to the public, but not vice versa.
Alice encrypts her message with Bob’s public key.
The message becomes unreadable.
Bob’s private key can open up the message.
Not really used in cryptocurrency.
Use 2
Digital Signatures
Purpose: Verifies who sent a message.
How can Bob verify that Alice sent a msg?
Alice generates a random private key.
From that, she generates a public key.
Next, she uses the private key to sign the message.
It doesn’t encrypt it, but encryption is possible.
Bob uses Alice’s public key to verify that the message is from Alice’s private key.
Bitcoin transactions are signed with private keys.
When you start your bitcoin wallet, your computer will generate a private key.
Example: the number of different ways a shuffled card deck can be is 52!, a very large number.
From the private key, you create a public key.
From the public key, you generate a Bitcoin address.
When you use bitcoin, you sign with your private key.
If you lose your private key, you are out of luck.
You receive money at your bitcoin address.
Homework:
1. Describe the concept of public and private key with your own words.
A private key is a computer generated random number. From the private key and a special process, a public key is generated. No one can derive the private key from the public key. The world can see the public key. It is up to each owner of a private key to keep it private. If someone obtains it, that person can steal the money in that account. If one loses his private key, there is no recourse. His money is gone.
The public and private keys make a unique pair. Bitcoin also adds another layer; it uses an address that is generated from the public key.
To encrypt a message, the sender uses the recipient’s public key to encrypt the message. Only the holder of the matching private key can decipher the message. (Sending to a group of people would not work unless there was a group private / public key pair.)
A digital signature is sending a message or transaction with your private key. The receiver can use the sender’s public key to verify that it was indeed the sender who sent the message or transaction.
Goal: Verify that the public key and the digital signature were made using the same private key. This verifies the sender.
One receives Bitcoin at her/his digital address.
…
2, What 2 use-cases can public key cryptography be used for?
Two uses of public and private key cryptography are encryption and digital signatures.