Cryptography and bitcoin
Bitcoin is a type of cryptocurrency because it is based on the cryptography. There has been a long history for the study of cryptography. In an ancient war, different troops of the same army relied on the messenger to send out the important military information. How could the message be sent out securely? How could the receiver ensure the message was not altered by the enemy? In the bitcoin system, we don’t need to address the first question as every transaction is put on the blockchain which can be checked by anyone. There is no need to encrypt the message. However, we do need to make sure a transaction is initiated by the true bitcoin owner, otherwise no one trusts the system. Before I reveal the solution, let’s think of the method to tackle this issue in the real world. How can the bank trust the owner really writes a check? The bank simply verifies the signature in the check to see if it looks similar to the signature of other documents.
Similarly, bitcoin introduces digital signature to fix this problem. I mentioned in the earlier article that you use the private key to spend your bitcoin. In fact, the mobile wallet uses your private key and the transaction message to generate the digital signature. The transaction with the public key is sent to the nearest node which uses your public key to verify whether the digital signature is signed by the private key owner. Public key is computed from private key but the other way around is not possible. Public and private key pair is a solution to the zero knowledge proof problem which is how you can prove you know a secret without revealing the secret itself. In short, cryptography is the foundation of bitcoin which consists of private key, public key and digital signature to ensure the ownership of bitcoin.