<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhammad Vakili on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Vakili on Medium]]></description>
        <link>https://medium.com/@m.vakili95?source=rss-6ea6af39a82b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*niKfripZi5KTtsxl.</url>
            <title>Stories by Muhammad Vakili on Medium</title>
            <link>https://medium.com/@m.vakili95?source=rss-6ea6af39a82b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:32:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@m.vakili95/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Simple Blockchain using Javascript]]></title>
            <link>https://medium.com/@m.vakili95/simple-blockchain-using-javascript-c01f1a822c45?source=rss-6ea6af39a82b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c01f1a822c45</guid>
            <dc:creator><![CDATA[Muhammad Vakili]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 14:38:47 GMT</pubDate>
            <atom:updated>2023-07-27T14:38:47.863Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Blockchain?</h3><p>A blockchain is a decentralized, distributed ledger that records transactions on multiple computers. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data. Once a block is added to the blockchain, it cannot be altered or deleted, ensuring the integrity of the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iAHCAGr3dRl-OZyE.jpg" /></figure><h3>What is a Block?</h3><p>A block is a collection of data that is added to the blockchain. Each block contains a hash of the previous block, a timestamp, and a set of transactions. The hash of the block is generated using a hashing algorithm that takes the data in the block as input. Once a block is added to the blockchain, it cannot be modified, ensuring the integrity of the data.</p><h3><strong>What is Mining?</strong></h3><p>Mining is the process of adding new blocks to the blockchain. In a Proof of Work blockchain network, mining involves solving a complex mathematical puzzle that requires a significant amount of computational power. Miners compete to solve the puzzle, and the first miner to solve it is rewarded with cryptocurrency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nptvKG3aahGmys_r.jpg" /></figure><p>The mining process involves validating transactions and adding them to a new block. Once the block is complete, the miner broadcasts it to the network, and other nodes in the network verify the block and add it to their copy of the blockchain. Once a block is added to the blockchain, it is considered to be immutable and cannot be modified, ensuring the integrity of the data.</p><h3>How other nodes verify the found blocks?</h3><p>A consensus mechanism is a way of achieving agreement on the contents of the blockchain among multiple nodes. There are several consensus mechanisms used in different blockchain networks. The most common consensus mechanisms are Proof of Work and Proof of Stake.</p><h3>Consensus Mechanism — Proof of Work</h3><p>Proof of Work (PoW) is a consensus mechanism used in some blockchain networks. In a PoW system, miners compete to solve a cryptographic puzzle to validate transactions and add new blocks to the blockchain. The first miner to solve the puzzle is rewarded with cryptocurrency. PoW is resource-intensive and requires a significant amount of computing power, making it a costly and time-consuming process.</p><h3>Consensus Mechanism — Proof of Stake</h3><p>Proof of Stake (PoS) is a consensus mechanism used in some blockchain networks. In a PoS system, validators are chosen to create and validate blocks based on the amount of cryptocurrency they hold. Validators are incentivized to maintain the integrity of the blockchain because they stand to lose their cryptocurrency if they validate fraudulent transactions. PoS is considered to be more energy-efficient and less resource-intensive than PoW.</p><h3>Rewarding the miner by increasing difficulty</h3><p>In a Proof of Work blockchain network, the difficulty is a measure of how hard it is to solve the mathematical puzzle required to add a new block to the blockchain. The difficulty is adjusted dynamically to ensure that blocks are added to the blockchain at a consistent rate, regardless of changes in the computational power of the network.</p><p>The difficulty is set by the blockchain protocol and is typically adjusted every few blocks based on the amount of time it took to mine the previous blocks. If blocks are being added too quickly, the difficulty will be increased to make it harder to solve the puzzle, and if blocks are being added too slowly, the difficulty will be decreased to make it easier.</p><p>The difficulty is measured in terms of the number of leading zeros required in the hash of the block to be considered valid. For example, if the difficulty is set to 4, then the hash of the block must start with 4 zeros. As the difficulty increases, the amount of computational power required to solve the puzzle increases as well, making it more difficult for miners to add new blocks to the blockchain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c01f1a822c45" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>