Understanding Digital Signatures in Blockchain and Cryptocurrency

How Digital Signatures ensure cryptographic proof of identity and data integrity in a Blockchain

Prashant Ram
Blockchain Bistro
2 min readJul 27, 2018

--

Digital Signatures in Blockchain networks

Digital Signatures in blockchain networks ensure user authenticity and transaction data integrity

User Authenticity: means ensuring that the transaction message was in fact originated by the person who claims to have originated the message.

Transaction Data Integrity: means ensuring the contents of the transaction message have not been modified in any way.

Let’s assume Alice sends Bob $10 in bitcoins, and this transaction is broadcast by Alice to the blockchain network. Here when the message is to be validated by a node, we need to ensure that,

  1. The message was indeed generated by Alice — user authentication
  2. The contents of the transaction were not modified in any way i.e. Alice is sending Bob $10, and not $50, or not sending Jim $10 or whatevertransaction data integrity.

How Digital Signatures work in blockchain networks

In blockchain networks, digital signatures work using hash and public/private key pairs. The Digital Signatures on blockchain networks work as follows,

SENDER:

Step 1: The sender of the transaction message(Alice) creates a hash of the message. This may be done using a SHA256 algorithm.

Step 2: This hash of the message is encrypted using the sender’s (Alice’s) private key. This is called Digitally Signing the message.

Step 3: This Digitally Signed message i.e. the private key encryted [data + SHA256 hash(data)] , along with the sender’s(Alice’s) public key, is now broadcast over the network.

RECEIVER:

Step 1: When a node wants to validate the transaction (i.e. check for user authenticity and transaction data integrity), they first use Alice’s public key to decrypt the message. Since only Alice’s public key can decrypt a message signed by Alice’s private key, the node is assured that the sender of the message is Alice, and user authentication is satisfied.

Step 2: After decrypting the message the validating node now has the transaction data + senders SHA256 hash(data). To ensure transaction integrity, the node runs the transaction data via the SHA256 algorithm on their end and compares it with the senders SHA256 hash(data). If they both match then data integrity is established.

If the two hashes do not match then the validating node knows that the transaction data that was received was modified in some way and can discard that transaction data.

Found this post useful? Hit the 👏 button below to show how much you liked it :)

Follow me on Medium for the latest updates and posts!

--

--

Prashant Ram
Blockchain Bistro

Technologist, Author, Speaker-with a passion for learning new things every day. Specializing in helping Startups and Enterprises move to the modern web!