<?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 Insravat on Medium]]></title>
        <description><![CDATA[Stories by Insravat on Medium]]></description>
        <link>https://medium.com/@insravat?source=rss-99625c1c34b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*zHvqrpGKMahbyMDH</url>
            <title>Stories by Insravat on Medium</title>
            <link>https://medium.com/@insravat?source=rss-99625c1c34b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:09:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@insravat/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[Understanding React’s Event System]]></title>
            <link>https://medium.com/@insravat/understanding-reacts-event-system-4c52c14c5a95?source=rss-99625c1c34b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c52c14c5a95</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-event-handling]]></category>
            <category><![CDATA[event-delegation]]></category>
            <dc:creator><![CDATA[Insravat]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 18:16:21 GMT</pubDate>
            <atom:updated>2025-11-25T18:16:21.203Z</atom:updated>
            <content:encoded><![CDATA[<p>One random day, a colleague asked me a question that caught me completely off guard:<br>“Do you know how React handles all the events triggered by components?”<br>I realized I had never actually questioned how or when React attaches event listeners. Do listeners get attached to each DOM node? Are they created during hydration? or after rendering?</p><blockquote><strong>React does not attach event listeners to every element.</strong></blockquote><p>Instead of doing something inefficient like this:</p><pre>&lt;button onClick=…&gt; ➡️ individual listener<br>&lt;input onChange=…&gt; ➡️ individual listener</pre><blockquote><strong>React uses event delegation and attaches one listener per event type to root element.</strong></blockquote><p>During hydration, React scans your component tree and maps all your event handlers(onClick, onChange, etc.). It then attaches a single event for each event type to the root container.</p><h3><strong>Let’s understand how events are actually handled:</strong></h3><ol><li>A user interacts with some DOM element (say, clicks a button).</li><li>The event bubbles up naturally through the DOM.</li><li>The root-level React listener catches the event.</li><li>React determines which DOM element triggered the event.</li><li>React finds the corresponding fiber node.</li><li>The fiber node’s props include the event handlers.</li><li>React invokes the correct handler.</li></ol><h3><strong>Why React uses this system?</strong></h3><p>1. Better performance — No need for hundreds of listeners spread across the DOM.</p><p>2. Fewer listeners — less memory usage.</p><p>3. Easier cleanup — Listeners stay centralized.</p><p>4. Consistent cross-browser event behavior.</p><p>5. Faster updates — React doesn’t need to add/remove listeners every time the DOM changes.</p><p><em>This delegation mechanism is a huge reason why React apps stay fast even with thousands of UI elements.</em> <strong><em>React may look simple on the surface but under the hood, it’s brilliantly engineered.</em></strong></p><p>Happy learning!✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c52c14c5a95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Your First Web DApp with Blockchain — A Beginner-Friendly Guide]]></title>
            <link>https://medium.com/@insravat/build-your-first-web-dapp-with-blockchain-a-beginner-friendly-guide-8bbbdbe65d15?source=rss-99625c1c34b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bbbdbe65d15</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Insravat]]></dc:creator>
            <pubDate>Sun, 04 May 2025 18:08:49 GMT</pubDate>
            <atom:updated>2025-05-04T18:08:49.726Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build Your First Web DApp with Blockchain — A Beginner-Friendly Guide🚀</h3><p>Are you curious to know how to build an application using blockchain? You’re in the right place! In this article, I’ll walk you through the basic tools and steps to create your first decentralized application (DApp).</p><p>🧠 Why Blockchain?<br>Think of blockchain as a secure database — once data is saved, it cannot be changed easily. That’s what makes it great for things like digital payments, secure contracts, and more. Big companies like Microsoft, Amazon, and Morgan Stanley are already using blockchain in different ways. To know more about blockchain, you can refer this article: <a href="https://medium.com/@insravat/introduction-to-blockchain-1f2fb9b0f7bc">https://medium.com/@insravat/introduction-to-blockchain-1f2fb9b0f7bc</a></p><p>To build any blockchain app, you need a few tools 🛠️. Let’s understand why we need them.</p><p><strong>1. Solidity — The Programming Language.</strong><br>Smart contracts are like the brain of a blockchain application. They are small pieces of code that handles logic like storing values, making payments, etc.</p><p>These smart contracts are written in a language called Solidity, which is almost similar to JavaScript. Once deployed, the code becomes unchangeable and is stored on the blockchain network.</p><p><strong>2. Hardhat — Our Development Environment.</strong><br>To write, test, and deploy smart contracts easily, we use a tool called Hardhat. It makes compiling and deploying smart contracts simple and allows you to test contracts on local or test networks.</p><p>Let’s start setting up the project.</p><p>📁 <strong>Step 1: Set Up Your Project.</strong><br>Create a folder and open your terminal inside it and run the following commands.</p><pre><br>mkdir hello-world<br>cd hello-world<br>npm init -y<br>npm install — save-dev hardhat<br>npx hardhat<br>npm install web3 dotenv</pre><p><strong>3. Ganache — A Local Blockchain for Testing.</strong><br>When you write smart contracts, you don’t want to deploy them on the main Ethereum network directly — it is slow and costs real money.</p><p>Instead, we use Ganache, which simulates a blockchain on your computer. You get test ETH for testing, and it behaves just like the real thing.</p><p>You can download Ganache from <a href="https://trufflesuite.com/ganache">https://trufflesuite.com/ganache</a>. Once Ganache is installed and running, note down the RPC URL (<a href="http://127.0.0.1:7545/">http://127.0.0.1:7545</a>) and one of the account’s private key.</p><p>📄<strong> Step 2: Write Your First Smart Contract.</strong><br>In your project folder, create a file <strong>contracts/HelloWorld.sol</strong> and paste this code:</p><pre>// SPDX-License-Identifier: UNLICENSED<br>pragma solidity ^0.8.28;<br>contract HelloWorld {<br> string public message = &quot;Hello, Blockchain!&quot;;<br>function setMessage(string memory _message) public {<br> message = _message;<br> }<br>}</pre><p>⚙️ <strong>Step 3: Configure Hardhat to Use Ganache.</strong><br>In <strong>hardhat.config.js</strong>, update it like this:</p><pre><br>require(“@nomicfoundation/hardhat-toolbox”);<br>require(“dotenv”).config();<br>module.exports = {<br> solidity: &quot;0.8.28&quot;,<br> networks: {<br>   ganache: {<br>     url: &quot;http://127.0.0.1:7545&quot;, //from ganache GUI<br>     accounts: [process.env.GANACHE_PRIVATE_KEY]. //private key from any one of the 10 accounts listed once you run the ganache(you can click Quickstart Ethereum to start a local blockchain instantly).<br>   }<br> }<br>};</pre><p><strong>4. Deploy the Smart Contract.</strong><br>Create a file <strong>scripts/deploy.js</strong> with this code:</p><pre><br>const hre = require(“hardhat”);<br>async function main() {<br> const HelloWorld = await hre.ethers.getContractFactory(&quot;HelloWorld&quot;);<br> const hello = await HelloWorld.deploy();<br> await hello.waitForDeployment();<br>console.log(&quot;Contract deployed to:&quot;, await hello.getAddress());<br>}<br>main().catch((error) =&gt; {<br> console.error(error);<br> process.exitCode = 1;<br>});</pre><p>Run the deployment:</p><pre><br>npx hardhat run scripts/deploy.js — network ganache<br></pre><p>This will deploy the contract and give you the contract address.</p><p><strong>5. Create the Frontend.</strong><br>Now, let’s build a simple webpage where the user can see and change the message stored on the blockchain.</p><p>Create an <strong>index.html</strong> file:</p><pre><br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=”en”&gt;<br>&lt;head&gt;<br> &lt;meta charset=”UTF-8&quot; /&gt;<br> &lt;meta name=”viewport” content=”width=device-width, initial-scale=1.0&quot;/&gt;<br> &lt;title&gt;Hello World DApp&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br> &lt;h1 id=”message”&gt;Fetching form blockchain…&lt;/h1&gt;<br> &lt;input type=”text” id=”inputMsg” placeholder=”New message” /&gt;<br> &lt;button onclick=”updateMessage()”&gt;Set Message&lt;/button&gt;<br> &lt;script src=&quot;https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js&quot;&gt;&lt;/script&gt;<br> &lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Create<strong> app.js</strong> for web3 interactions:</p><pre><br>const contractAddress = “”;//replace the empty string with the contract address recieved after deploying the contract..<br>const abi = []; //replace the empty array with abi present in /artifacts/contracts/[contractName].json<br>let contract;<br>let accounts;<br>window.addEventListener(&quot;load&quot;, async () =&gt; {<br> if (window.ethereum) {<br>   window.web3 = new Web3(window.ethereum);<br>   await window.ethereum.enable();<br>   accounts = await web3.eth.getAccounts();<br>   contract = new web3.eth.Contract(abi, contractAddress);<br>   const msg = await contract.methods.message().call();<br>   document.getElementById(&quot;message&quot;).innerText = msg;<br> }<br>});<br>async function updateMessage() {<br> const newMsg = document.getElementById(&quot;inputMsg&quot;).value;<br> await contract.methods.setMessage(newMsg).send({ from: accounts[0] });<br> const updatedMsg = await contract.methods.message().call();<br> document.getElementById(&quot;message&quot;).innerText = updatedMsg;<br>}</pre><p><strong>6. Connect MetaMask.</strong><br>Even if your site is running, your browser doesn’t support Ethereum transactions directly. That’s where MetaMask comes in.</p><p>Steps:</p><p>a. Install MetaMask extension in your browser.</p><p>b. Click “Add Custom Network” and enter Ganache’s details.</p><p>c. Import one of Ganache’s account using its private key.</p><p>Now, your DApp can talk to the blockchain through MetaMask.</p><p><strong>7. Run the Frontend.</strong><br>Finally, host your frontend locally:</p><pre><br>npx serve .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*32BuZ1Okl8w8RsMmmSosJw.png" /><figcaption><a href="http://localhost:3000/view/">http://localhost:3000/</a></figcaption></figure><p>🎉 You Just Built a DApp!<br>Happy Learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bbbdbe65d15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INTRODUCTION TO BLOCKCHAIN ⚡]]></title>
            <link>https://medium.com/@insravat/introduction-to-blockchain-1f2fb9b0f7bc?source=rss-99625c1c34b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f2fb9b0f7bc</guid>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Insravat]]></dc:creator>
            <pubDate>Sat, 19 Aug 2023 17:46:06 GMT</pubDate>
            <atom:updated>2023-08-20T08:02:28.177Z</atom:updated>
            <content:encoded><![CDATA[<p>Blockchain is a decentralized digital ledger technology that allows multiple parties to have a shared, immutable record of transactions or data. It is designed to be transparent, secure, and resistant to modification or tampering. It plays a crucial role in today’s digital world and holds immense potential to revolutionize various industries.</p><p>Given the rising prevalence of cyber fraud in today’s digital landscape, the utility of blockchain technology becomes increasingly apparent. This is primarily attributed to its ability to provide heightened security and ensure the immutability of data, thereby mitigating the risks associated with unauthorized access and tampering.</p><p><strong>The concept of blockchain, explained in simpler terms:</strong></p><p>Imagine a blockchain as a digital ledger that acts like a special notebook. This notebook is not owned by a single authority or organization but by a whole network of people. Whenever someone wants to make a transaction, like buying or selling something, they write it down in a notebook. But the exciting part is instead of just one person keeping the notebook, everyone in the network has a copy of it. So, if someone tries to cheat or change what they wrote, all the other people with copies of the notebook will notice the difference. This makes it very hard for anyone to trick the system because all the copies have to agree on what’s written.</p><p>Now, the notebook is not just a simple list of transactions. It’s divided into blocks, like pages, and each block contains several transactions. Each block is connected to its previous block, forming a chain of blocks — hence the name blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l1I2QDqjwVTK7TlW" /></figure><p>This chain of blocks acts like a permanent record of all the transactions that have ever happened. Once a transaction is written in a block and added to the chain, it becomes very difficult to change, just like erasing a message carved on stones without leaving visible traces. This makes blockchain unique because it provides trust and security. Since everyone has a copy of the notebook and can see all the transactions, it’s harder for someone to cheat or tamper with the records.</p><p>So, in simple terms, blockchain is like a shared notebook that everyone can see and add to, forming an unchangeable chain of information. It helps ensure transparency, trust, and security in digital transactions, just like having a trustworthy group of detectives watching over our records.</p><p><strong>How does blockchain work?</strong></p><p>We now are aware that the blockchain is created using a chain of multiple blocks. Each block stores :</p><ol><li>Relevant information: This field stores the relevant data concerning the blockchain. For example, consider Bitcoin, it will store data related to the transaction between the two end users. It will store information like Bitcoin was sent to whom and is sent for whom. Similarly, different information will be stored for different use cases.</li><li>Hash: It is a unique code that is generated for each block. Consider it as a fingerprint, every individual has a unique fingerprint similarly, and every block in a blockchain has a unique hash.</li><li>Previous block hash: Each block stores the hash of its last block except for the first block in the blockchain.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/0*TQbmngk-yHSdn_iK" /></figure><p>The block that doesn’t store the hash of its previous block, i.e., the first block in the blockchain is called a genesis block. The formation of such a chain helps in tracking the transaction history, and maintaining unique information in a block, tampering with the data is nearly impossible, and this is why blockchain is this much secure.</p><p>Blockchain supports smart contracts, self-executing contracts with predefined rules. These contracts can automate various processes, from business agreements to real estate transactions, reducing the need for intermediaries and minimizing delays and disputes.</p><p><strong>Application of Blockchain and future scope:</strong></p><p>Blockchain’s original application was in the creation of cryptocurrencies like Bitcoin, and it has paved the way for the emergence of various other cryptocurrencies and digital assets. In supply chain management, blockchain enables real-time tracking of goods, verification of authenticity, and monitoring of each step in the supply chain, reducing fraud and improving efficiency. Blockchain technology has a wide range of applications and a promising future scope across various industries. Some notable applications include healthcare, financial services, voting systems, digital identity, the energy sector, real estate, the Internet of Things(IoT), art and intellectual property, government services etc.</p><p>The future scope of blockchain is vast. As the technology matures and various industries recognize its potential, blockchain is likely to find its application that we might not even foresee today.</p><p>In conclusion, blockchain technology has emerged as a transformative force with the potential to revolutionize how transactions, data, and trust are managed across industries. Its decentralized and secure nature, combined with its ability to enhance transparency and streamline processes, makes it a versatile solution for various challenges in our digital world. As blockchain continues to evolve and find new applications, its impact on sectors such as finance, supply chain, healthcare, and beyond is likely to reshape traditional systems and pave the way for innovative possibilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f2fb9b0f7bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>