<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ShivaSunny9</title>
    <description>The latest articles on DEV Community by ShivaSunny9 (@shivasunny9).</description>
    <link>https://dev.to/shivasunny9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F295527%2Ff28c0999-12bb-4785-b459-51f297867848.jpeg</url>
      <title>DEV Community: ShivaSunny9</title>
      <link>https://dev.to/shivasunny9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shivasunny9"/>
    <language>en</language>
    <item>
      <title>Consensus Mechanism in Blockchain</title>
      <dc:creator>ShivaSunny9</dc:creator>
      <pubDate>Tue, 21 Jan 2020 07:29:49 +0000</pubDate>
      <link>https://dev.to/shivasunny9/consensus-mechanism-in-blockchain-46c4</link>
      <guid>https://dev.to/shivasunny9/consensus-mechanism-in-blockchain-46c4</guid>
      <description>&lt;p&gt;Did you ever got a question, Without any central authority how does Blockchain works and how a decision made in Blockchain? Normally in central authority, there will be an elected leader, to make a decision.&lt;/p&gt;

&lt;p&gt;But in the blockchain, it is not possible to have a leader. For the blockchain to make decisions, they need to come to consensus called “consensus mechanism”&lt;/p&gt;

&lt;p&gt;Let’s see how decisions are made in Blockchain,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. What is Consensus?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In simple terms, the Consensus is a dynamic way of reaching an agreement in a group. While voting just settles for a majority rule without any thought for the feelings and well-being of the minority, a consensus, on the other hand, makes sure that an agreement is reached which could benefit the entire group as a whole.&lt;/p&gt;

&lt;p&gt;“From a more idealistic point-of-view, Consensus can be used by a group of people scattered around the world to create a more equal and fair society.”&lt;br&gt;
A method by which consensus decision-making is achieved is called “consensus mechanism”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. How does the Consensus work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Consensus is a group of people coming to an agreement. &lt;br&gt;
Let’s take an example, A node suggests one agreement and another node suggests another agreement and now the majority of people will choose the better consensus which could benefit the entire group. &lt;/p&gt;

&lt;p&gt;To make it more clear, a group of people create fair and equal rights to all nodes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Characteristics of consensus decision-making include(Wikipedia)&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Collaborative&lt;/em&gt;&lt;/strong&gt;: Participants contribute to a shared proposal and shape it into a decision that meets the concerns of all group members as much as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Cooperative&lt;/em&gt;&lt;/strong&gt;: Participants in an effective consensus process should strive to reach the best possible decision for the group and all of its members, rather than competing for personal preferences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Egalitarian&lt;/em&gt;&lt;/strong&gt;: All members of a consensus decision-making body should be afforded, as much as possible, equal input into the process. All members have the opportunity to present and amend proposals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Inclusive&lt;/em&gt;&lt;/strong&gt;: As many stakeholders as possible should be involved in the consensus decision-making process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Participatory&lt;/em&gt;&lt;/strong&gt;: The consensus process should actively solicit the input and participation of all decision-makers.&lt;/p&gt;

&lt;p&gt;Now we know about the Consensus mechanism, let see the most used consensus mechanism right now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Proof of Work&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before going to that, I want to tell you a small story. When I was in 1st grade my teacher used to ask us to solve a maths problem and reward for that would be a bar of chocolate:&lt;br&gt;
For eg: 10 + ? = 12, who solves the first, the reward is given to them.&lt;br&gt;
10 + 1 = 11&lt;br&gt;
10 + 2 = 12&lt;/p&gt;

&lt;p&gt;After getting the answer, I use to rush to my teacher and showed my answer but Unfortunately, some other kid has solved it before me and he walked away with that chocolate bar.&lt;/p&gt;

&lt;p&gt;The teacher also realised that the problem was too easy for the kids. For the next chocolate, she increased the difficulty level. This time the class is asked to solve:&lt;/p&gt;

&lt;p&gt;345+?=379&lt;/p&gt;

&lt;p&gt;Now taking the same scenario in the Blockchain:&lt;/p&gt;

&lt;p&gt;Miners are like Students, competing with each other to solve the puzzle to earn rewards. Here “2” is the nonce - a number which can be used only once to solve the puzzle.“12” is the difficulty level, which ensures the teacher has control over the number of chocolates distributed. &lt;/p&gt;

&lt;p&gt;Blockchain uses the difficulty level to control the generation of 1 block/~ 10 minutes. The person who solves the cryptographic puzzle will win the rewards and places the block in the blockchain.&lt;/p&gt;

&lt;p&gt;The main drawback of POW is an extremely inefficient process because of the sheer amount of power and energy that it eats up.&lt;/p&gt;

&lt;p&gt;You can see all the details of the block here: &lt;a href="https://www.blockchain.com/explorer"&gt;https://www.blockchain.com/explorer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Proof of Stake&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is one of the best Consensus mechanism and Ethereum is soon planning to move from Proof of Work to Proof of Stake.&lt;/p&gt;

&lt;p&gt;To keep it simple, there will be no miners in the Proof of Stake. Yes, you heard it right. There will be only Validators who will validate the transaction in the Blocks.&lt;/p&gt;

&lt;p&gt;To Validate the transaction the validator has to place a certain amount of bet,&lt;br&gt;
The size of the stake determines the chances of a validator to be chosen to validate the next block. Now, you may have a question, a person with more stake will always choose to validate, but in reality, it’s much fairer. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Eg&lt;/strong&gt;: A Node has been chosen to validate the next block, he’ll check if all the transactions within it and adds it to the blockchain. After the block is on the blockchain, the node receives a fee for each transaction. After some time the validator will receive his deposited money.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if Validators approve fraudulently transaction?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Validators will lose a part of their stake if they approve fraudulent transactions. The amount stake is much more than the fee which they receive from the transactions. So we can trust the validators to their job correctly. If not, they will lose more money then the gain.&lt;/p&gt;

&lt;p&gt;The person with more stake will validate that transaction and receives the transaction fee and after that, he will receive the deposit money&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KKtPKBgx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/m9kbcyz6he6eswrzlw21.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KKtPKBgx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/m9kbcyz6he6eswrzlw21.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other Consensus Mechanism&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Delegated Proof Of Stake (DPOS)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DPOS is implemented in EOS and its works on Stake-weighting voting system. Where the Stake of the person determines the weight of their vote.&lt;/p&gt;

&lt;p&gt;Delegated Proof of Stake is like an election, where people need to vote for the delegates. Delegates are a person or an organisation used to produce the blocks on the network and the delegates will receive the reward for creating the block. The reward will be like in Proof of Stake, transaction fee or fixed amount of Coins. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How delegates are chosen to produce the Block?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For Eg: Nodes will vote for the delegates with their stake and the person with the highest votes will get chance to produce the block on the network. It is same as an election where we need to choose the delegate of our choice and need to do our voting. The weight of their vote depends on their stake. &lt;/p&gt;

&lt;p&gt;For Eg: If “A” stakes 50 coins for the delegate and “B” stakes 10 coins for a delegate, then A’s vote is 5 times more weight then the B vote. &lt;/p&gt;

&lt;p&gt;Since delegates want to receive as many votes as possible, they are constantly incentivized to create things valuable to the community, as they are likely to receive extra votes for doing so.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Proof Of Capacity (POC)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Proof of Capacity is a consensus mechanism, uses a process called Plotting, In Proof of Work, miners use a lot of computational to solve the puzzle to create a block, however in Proof of Capacity all the solutions are pre-stored in Storages like Hard Disks. After storage has filled with solutions he can take part in the block creation process. This process is called Plotting.&lt;/p&gt;

&lt;p&gt;The person who solves the puzzle fast will get to create a new block. This mechanism is like, Storage capacity is directionally proportional to the higher chances of creating the new block.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;"All the consensus mechanism approach is different but the intentions and goals are the same for all the consensus, yet perfect consensus mechanism doesn’t exist. Still, there are many and yet to come and hope there will be an efficient consensus mechanism over a period of time".&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>blockchain</category>
      <category>career</category>
    </item>
    <item>
      <title>A Complete Guide on How Public-Key Cryptography works.</title>
      <dc:creator>ShivaSunny9</dc:creator>
      <pubDate>Thu, 26 Dec 2019 08:38:46 +0000</pubDate>
      <link>https://dev.to/shivasunny9/a-complete-guide-on-how-public-key-cryptography-works-1cmf</link>
      <guid>https://dev.to/shivasunny9/a-complete-guide-on-how-public-key-cryptography-works-1cmf</guid>
      <description>&lt;p&gt;Cryptography makes Blockchain more robust and stands out from other technology. Cryptography which uses advance mathematical principles method in transmitting and storing the data, it stores in a way that only the person for whom the data is intended can read and process it.&lt;/p&gt;

&lt;p&gt;"Encryption is the core concept in cryptography- It encodes the message in a way that no one can decrypt it except the receiver, it keeps the data safe from an eavesdropper, where they cannot read and understand the format".&lt;/p&gt;

&lt;p&gt;Quick intro of this technique, this was first used by Caesar to encrypt his messages using Caesar cipher, where a plain text is encrypted to cipher text and then send through the communication channel and no eavesdropper can read and understand the text. When it receives at the receiver end it decrypted to plain text from the cipher text.&lt;br&gt;
There are two types of Cryptography&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Symmetric cryptography&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Asymmetric cryptography&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Symmetric cryptography&lt;/strong&gt;&lt;br&gt;
Symmetric cryptography is same as the Caesar Cipher Technique, where uses a single key to encrypt and decrypt the data. I have created a visualization of this process for a better idea.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F31bf1spvxeokkp0x7m5a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F31bf1spvxeokkp0x7m5a.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But Symmetric Cryptography has some drawbacks&lt;/p&gt;

&lt;p&gt;Both persons should have to use the same key, there is no problem of using the same key but the problem comes, when we want to share the key from an eavesdropper, this is the difficult task.&lt;/p&gt;

&lt;p&gt;We are using the Symmetric Cryptography for the safe transfer of the data from eavesdroppers, but we have to share the key to the receiver person. If the receiver is living by we can give it to him directly in an envelope or other sources, what if the person is from a different state or country. It becomes difficult, so to overcome this problem there is one more technique called Asymmetric Cryptography.&lt;/p&gt;

&lt;p&gt;This Asymmetric Cryptography, we use in Blockchain Technology.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Asymmetric Cryptography&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asymmetric Cryptography makes the Blockchain technology more Robust mechanism and solves the drawback of Symmetric Cryptography.&lt;/p&gt;

&lt;p&gt;"Asymmetric Cryptography is a bit more complex than the Symmetric Cryptograph and the main difference between these both his, Symmetric uses the shared key to decrypt the data and Asymmetric uses Key-pairs to decrypt the data".&lt;/p&gt;

&lt;p&gt;Key pairs consists of 2 parts, a public key and a private key.&lt;/p&gt;

&lt;p&gt;Let’s take an example of Gmail If we need to send a mail to the person or company.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every user in Gmail has specially allocated username and a password.&lt;/li&gt;
&lt;li&gt;They use the Receiver’s username to send the data to them.
The receiver receives the message from the sender and reads the data.&lt;/li&gt;
&lt;li&gt;The same process applies with Asymmetric Cryptography,&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;"Every user has Public key which is same as your username, Every person can see this but don’t have access to the data and Private key is same as your password, which helps you to send the data to another person".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To the send the data first we will use the private key (i.e password) and receivers public key(i.e username) this makes the cryptography technique more complex.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now receiver uses his private key (i.e password) and senders public key (i.e username) to decrypt the data. This makes the system safe from eavesdropper and more robust.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There is no need to have an intermediate and we can send to any person in this world.&lt;/p&gt;

&lt;p&gt;I have created a visualization of this process for a better idea.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fczlg0antgbk9x87y0o39.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fczlg0antgbk9x87y0o39.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Digital Signatures&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now when we send a mail through my mail id the receiver knows that I have sent to him by seeing the username. I cannot send the data without password i.e if any mail you’re sending through your username, you’re responsible for that. No once can access your account without the password.&lt;/p&gt;

&lt;p&gt;In the same way without the private key, no one can send a message through your public key, if any message you have sent through it your responsibility for that because without private key no one can send the message through your address. We have to be more careful because for Gmail we have a central database to retrieve your password but Blockchain is decentralized, you need to keep your private key more safely.&lt;/p&gt;

&lt;p&gt;When we send data using our privet key, it is signed by our Digital Signature and it allows non-repudiation as it means the person who sent the message had to be in possession of the private key.&lt;/p&gt;

&lt;p&gt;"If you encrypt (“lock”) something with your private key, anyone can decrypt it (“unlock”), but this serves as a proof you encrypted it: it’s “digitally signed” by you. — PanayotisVryonis"&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>blockchain</category>
      <category>career</category>
    </item>
    <item>
      <title>What is Hashing in Blockchain? Explained.</title>
      <dc:creator>ShivaSunny9</dc:creator>
      <pubDate>Wed, 18 Dec 2019 06:44:11 +0000</pubDate>
      <link>https://dev.to/shivasunny9/what-is-hashing-in-blockchain-explained-4bmn</link>
      <guid>https://dev.to/shivasunny9/what-is-hashing-in-blockchain-explained-4bmn</guid>
      <description>&lt;p&gt;In this article, we will see,&lt;/p&gt;

&lt;p&gt;●     What is Hashing?&lt;/p&gt;

&lt;p&gt;●     How Hashing is used in Blockchain?&lt;/p&gt;

&lt;p&gt;●     What is a Merkle Tree?&lt;/p&gt;

&lt;p&gt;●     How we can secure the data with Hashing?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;What is Hashing?&lt;br&gt;
Hashing is the process of taking the input string of any length and turning it into cryptographic fixed output. Hashing is not an “encryption” we cant retrieve the original data by decrypting the hash, it’s a one-way cryptographic function. Do you know we can keep the whole data which is present on the internet in the fixed string length with the help of Hashing Algorithm. We use a mathematical algorithm called SHA-256 (Secure Hashing Algorithm -256 bits). SHA 256 is the successor of the SHA-1 which is of 160 bits.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How Hashing is used in Blockchain?&lt;br&gt;
In Blockchain, every block has a hash of the previous block, the previous block is called as parent block for the present block and now consider a parent block has a present block and it will have a hash of previous block i.e parent block. In the blockchain, every block has a hash of the previous block. When we change any data in the present block the hash of the block will be changed, this will effect the previous block because it has the address of the previous block.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example, If we have only two blocks, one will be present block and one will be the parent block. The present block will be having the address of the parent block. If we need to change the data in the present block, we also need to change the parent block. It will be easy it change the data but now in blockchain, there are 595399 blocks have been mined by 2019–09–18 05:56:02, with a hash&lt;/p&gt;

&lt;p&gt;0000000000000000000ba3777a14be42e979700f401b34f6d02c807d07b4eb98. You can see how many blocks are mined until now at Blockchain. It is not possible to change the hash of 595399, so this is how blockchain is called immutable and trustworthy of the data. The first block of a blockchain, known as a Genesis block.&lt;/p&gt;

&lt;p&gt;I have created a Visualization of this process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8wCCILCh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/e18hadtwsnlnp1cy6wgy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8wCCILCh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/e18hadtwsnlnp1cy6wgy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we do a small change to any part of the input there will be a huge change to the output, see the examples below for more understanding.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PBVqRxVT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ltkfya1b77nfbcgj1rwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PBVqRxVT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ltkfya1b77nfbcgj1rwi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hashing is of the core fundamentals and foremost aspects of the immutable and defining potential of blockchain technology. It preserves the authenticity of the data that is recorded and viewed, and as such, the integrity of a blockchain as a whole. It is one of the more technical aspects of the technology, however, understanding it is a solid step in understanding how blockchain functions and the immeasurable potential and value that it has.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How do Merkle trees work?
When there is a large body of data it will be hard to verify it and takes a lot of memory to store and secure it but with the help of Merkle tree, we can easily overcome all these problems.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Merkle tree is a fundamental part of the Blockchain Technology, it is in a structure where we can easily find out any change happens to a large amount of data and verifications of the data can be done efficiently. These are used by both Bitcoin and Ethereum.&lt;/p&gt;

&lt;p&gt;Even Merkle tree&lt;br&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bx_YV0du--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/wx27g8m00s1phr2sblhb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bx_YV0du--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/wx27g8m00s1phr2sblhb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see in the above image, all the transactions are at the bottom and the top single hash is called Root hash or Merkle root.&lt;/p&gt;

&lt;p&gt;Let us consider one example, there are 4 transactions with A, B, C, D. Now A and B hash will combine to form one hash and C and D another hash, AB hash and CD hash now combine to form one single hash called Root hash or Merkle Root ABCD. The Root hash will have all the information of all the transactions. Merkle tree will repeatedly hash, pair of nodes till there is only one hash left called Root Hash.&lt;/p&gt;

&lt;p&gt;Merkle tree is a binary tree, so need to have even number of leaf nodes, if the number of transactions is odd, the last hash will be duplicated once to create an even number of leaf nodes...&lt;/p&gt;

&lt;p&gt;Odd Merkle Tree&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SYh0Xx5o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/fgi5pumb0x65gcs0xqqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SYh0Xx5o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/fgi5pumb0x65gcs0xqqw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image we can see the duplicate transaction hashing when their is an odd number of transactions, this is how merkle tree will duplicate for odd number of leafs.&lt;/p&gt;

&lt;p&gt;All the data of the Transactions are summarised into single Root hash and that is stored in the block header, As we now any change in the data the whole hash function we will changes, if hash changes, so do Merkle root changes. Merkle tree helps us to maintain the integrity of the data.&lt;/p&gt;

&lt;p&gt;Another advantage of Merkle tree is if you want to know the status of one particular transcation, we don’t need to download the entire blockchain, we just need to ask for vertical proof and ask for a certain branch of a tree and verify one particular transaction branch. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;How can we Secure Data with Hashing?&lt;br&gt;
Hashing drastically increases the security of the data. There is no way to decrypting the data because we are not encrypting it. As I mentioned already it’s a one-way cryptographic function. A cryptographic hash function needs to have several crucial qualities to be considered useful, these include:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Every hash is different from another.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Same Hash value will be always produced for the same message.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Impossible to decide input based on the hash value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Even a small change to the input whole hash will be changed.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hashing helps us to see if the data has tampered or not.&lt;/p&gt;

&lt;p&gt;For example, you have downloaded a piece of important information, to see if the data is changed or not, you can run the data through the hashing algorithm and compare the hash of the data and hash of the received data. If both the hashes are same the data is not changed and if the hash doesn’t match, the data is altered before you received it.&lt;br&gt;
This is how Hashing is used it Blockchain Technology.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>showdev</category>
      <category>career</category>
      <category>ethereum</category>
    </item>
  </channel>
</rss>
