What is Cryptography, Signed Transactions, and how do they get validated in Blockchain??
Blockchain picture

What is Cryptography, Signed Transactions, and how do they get validated in Blockchain??

So, today we are going to discuss the following things:

  • Cryptographic hashes in Blockchain.
  • How do that transactions get signed and Authenticated on ETHEREUM Network ??

But you should have a basic idea of what blockchain is? So, blockchain is a way of storing data in a distributed manner where each node is connected to the previous one and all the subsequent nodes have a cryptographic hash that is based on all the hashes of the previous nodes. Still, confused?

Let's Understand Cryptography and how it works in Blockchain?

Cryptography is a way of storing data in a manner that no one else can understand what this data is about and what it means. It is still decipherable but one has to do a lot of work to crack that data. So, how does blockchain is using cryptography?

Blockchain uses a hash to assign a unique address to each node. But, wait what does that hash function does ?? Let's discuss this first and try to understand it with an example.

So hash functions take input and based on that input they generate a fixed-length hex code. Code below for better understanding.

No alt text provided for this image

So How do that transactions get signed and Authenticated on ETHEREUM Network ??

So when you make a transaction on the Ethereum network, block explorer or any other tool will show your transaction somehow like below. The below snapshot is from https://ropsten.etherscan.io/tx/

No alt text provided for this image

There are too many properties of that transaction but to understand how transactions are being signed we are only interested in a few things like from and to addresses.

FROM: The Account Address of the user sending the ether

To: The account Address of the user receives the ether.

Each account on the crypto wallet has a private key that is used to sign that transaction. So let's say that I have an account address `0x968D9F4aD3213044f3BfbF9eD6aFfFB23aBF03B1` there will be a private key tied to this account may be like this `aslkdjasljdlkasjdlkajs1283098120938HGFGGAKSJHD`.When you do a transaction before being added to the blockchain it goes through the following steps.When someone makes a transaction for authentication following steps are being performed.

  • Transactions get signed with the account's private key using which is generated using ECDSA(Elliptic Curve Digital Signature Algorithm) algorithm.
  • Payload with the following data will be generated once the transaction is signed.

No alt text provided for this image

  • To validate that the transaction is actually from the account it pretends to be in the signed transaction payload. The validator will use the v and s fields of the signed transaction payload and using the ECRECOVER algorithm they will get the actual account from which the transaction is made if the from the field of the signed transaction and the account address we get after using the ECRECOVER algorithm are same then the transaction is said to be valid and will continue for further processing else wise it will be rejected.

To view or add a comment, sign in

More articles by Muhammad Monis

  • What are AWS ECS and ECR?

    Have you ever come across the terms ECS and ECR when reading or doing work on containerized-based applications that…

  • Time Complexity in Programming

    Have you ever come across the terms complexity and scale while reading a programming book or an article and didn't have…

    1 Comment
  • What is webpack and why we need it ??

    Why we need it? We need webpack to resolve the links between our JS files which otherwise would be cumbersome to…

    6 Comments

Others also viewed

Explore content categories