Note
If you are new to the field of information technology, taking our Free Information Technology Course for Beginners and Cloud Technology Course for Free with Certification is highly recommended. Also, for a comprehensive coverage of blockchain concepts and its use cases, taking our Free Blockchain Course with Certification is highly recommended.
Recap
In our previous article (What Is a Cryptographic Hash Function), we learned how a cryptographic hash function is used to randomly convert a string of binary data into a condensed representation of a message.
In this article, we move on to the next topic which is how Digital Signatures work and what role they play in a blockchain system.
Digital signature
A digital signature is a set of algorithms for determining the authenticity and integrity of digital messages or documents. It assures the recipient that the message was indeed created by the expected sender and that the message was not altered during transmission. The sender cannot deny having sent the message.
When Alice sends a document to Bob, she will follow certain steps to digitally sign the document, as shown in the following diagram:
These steps are as follows:
- Calculate the message digest of the document Alice wants to send to Bob with a cryptographic hash function, usually MD5 or any SHA algorithm.
- Encrypt the message digest with Alice’s private key, append the encrypted message digest to the original document, and send the combined message out.
- Once Bob receives the combined message from Alice, he will separate the encrypted message digest from the document itself. Bob will use Alice’s public key to decrypt the encrypted message digest.
- At the same time, Bob will calculate the message digest of the received document and compare the resulting message digest with the decrypted message digest to see whether there is a match. If yes, Bob is assured that the document originated from Alice without any tampering.
One-to-One Live Blockchain Classes
Coding Bootcamps school offers One-to-One Live Blockchain Classes for Beginners.
In blockchain, a digital signature is a way to prove ownership of the underlying cryptocurrency or electronic coin. When Alice needs to pay Bob 10 BTC, she will digitally sign a hash of the previous transaction, which can prove that Alice has ownership of the 10 BTC.
In summary, cryptography is one of three foundational pillars in blockchain technology. Public key cryptography is the basis for blockchain wallets and transactions, and the cryptographic hash function is a key element underpinning the PoW consensus mechanism. A digital signature is used as proof of ownership of the underline electronic coins or cryptocurrency.
Next Article
In the next article (The role and types of consensus mechanism in blockchain), we learn about the role and types of consensus algorithms that are widely used in the blockchain applications. We also discuss how cryptography technologies are leveraged to reach consensus among decentralized parties.
This article is written in collaboration with Brian Wu who is a leading author of “Learn Ethereum: Build your own decentralized applications with Ethereum and smart contracts” book. He has written 7 books on blockchain development.
Resources
coming soon