<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Pitambar's Blog]]></title><description><![CDATA[Passionate Nepali software engineer dedicated to innovation and problem-solving.]]></description><link>https://blog.pitambarmahato.com.np</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 05:13:23 GMT</lastBuildDate><atom:link href="https://blog.pitambarmahato.com.np/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Consensus Mechanism in Blockchain]]></title><description><![CDATA[Nowadays blockchain and web3 are creating hype every day all over the world.  Everyone is talking about blockchain technologies, mining, cryptocurrency, etc.
In this article, I am going to talk about one of the most important mechanisms of every bloc...]]></description><link>https://blog.pitambarmahato.com.np/consensus-mechanism-in-blockchain</link><guid isPermaLink="true">https://blog.pitambarmahato.com.np/consensus-mechanism-in-blockchain</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[crypto]]></category><dc:creator><![CDATA[Pitambar Mahato]]></dc:creator><pubDate>Tue, 08 Mar 2022 13:03:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1646030970030/6IbJvcLs6.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Nowadays</strong> blockchain and web3 are creating hype every day all over the world.  Everyone is talking about blockchain technologies, mining, cryptocurrency, etc.
In this article, I am going to talk about one of the most important mechanisms of every blockchain protocol which plays a huge role in preventing the blockchain network from hackers and malicious attacks i.e Consensus Mechanism.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646744768475/l0lMbKw-9.jpeg" alt="consensus (1).jpeg" />
So by using the consensus mechanism the blockchain network gets prevention from external malicious attacks i.e. adding a random block in the blockchain. If any miner or validator of the blockchain network tries to add the malicious block(collection of invalid transactions) in the blockchain then the consensus protocol used in the blockchain network didn't allow such activities in the blockchain. Let's talk about the algorithms about consensus mechanism. Mostly there are 2 consensus protocols used these days:</p>
<p><strong>- Proof of work
</strong></p>
<p><strong>- Proof of stake
</strong></p>
<h2 id="heading-proof-of-work">Proof of Work</h2>
<p>Proof of work is first applied in Bitcoin to validate the transactions in the blockchain which is also used in the Ethereum and other blockchain networks for transaction validation purposes. In this method, the miners have to solve complex mathematical problems to get the hash(Tha hash should include the values inside the target value which is defined by the algorithm in the blockchain. The target values changes in a certain period of time.) of the block with the valid set of transactions. After calculating the valid hash and adding the block in the blockchain the miners get the rewards.
In proof of work, the miners should have a rich set of resources for calculating the mathematical problem which costs a large amount of money.</p>
<h2 id="heading-proof-of-stake">Proof of Stake</h2>
<p>Proof of stake is first introduced by the Cardano blockchain network in which the validation process of a block is done by staking. In proof of stake, there are validators instead of miners the validators should deposit certain amount of crypto to take part in the validation process and the system selects the validators based on the deposited value of crypto. The more crypto validator deposits  the more chances of him/her to get selected to validate the blocks and earn rewards. 
In this method, the validation can be done with any kind of device. The only thing that is needed to take part in validation is the stake(money or coins or tokens).</p>
]]></content:encoded></item><item><title><![CDATA[What is Double Spending and How Blockchain Solve it?]]></title><description><![CDATA[Double spending is a situation where the user can spend his/her coin multiple time. If someone has one Bitcoin then he sent this coin to the different users at the same time then such a situation is known as the Double Spending Problem. 
How does Blo...]]></description><link>https://blog.pitambarmahato.com.np/what-is-double-spending-and-how-blockchain-solve-it</link><guid isPermaLink="true">https://blog.pitambarmahato.com.np/what-is-double-spending-and-how-blockchain-solve-it</guid><category><![CDATA[Blockchain]]></category><category><![CDATA[Cryptocurrency]]></category><dc:creator><![CDATA[Pitambar Mahato]]></dc:creator><pubDate>Sun, 06 Mar 2022 17:14:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1646586800289/4ZMolaY6i.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Double spending is a situation where the user can spend his/her coin multiple time. If someone has one Bitcoin then he sent this coin to the different users at the same time then such a situation is known as the Double Spending Problem. </p>
<h2 id="heading-how-does-blockchain-prevent-double-spending">How does Blockchain Prevent Double Spending?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1646586823050/W8Y4DZtnb.jpg" alt="DoubleSpending.jpg" />
To understand more about double spending we need to know about the working of block creation in Blockchain. In the blockchain, the coin will only be deducted from the sender's account only after the transaction is verified and included in the Block by using a consensus mechanism i.e proof of work till then the user can send that coin to multiple addresses. Because In blockchain transactions aren't directly included in the block initially transactions are placed in the memory pool which is also known as unconfirmed transactions, Once the miner picks one of the transactions initiated by the user and adds it to the blockchain then the user's wallet will be updated with the balance 0. 
After that, every other transaction initiated by that user is rejected because he has 0 balance in his wallet.</p>
]]></content:encoded></item></channel></rss>