<?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>Forem: yashdewasthale</title>
    <description>The latest articles on Forem by yashdewasthale (@yashdev9274).</description>
    <link>https://forem.com/yashdev9274</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%2F900638%2F55e2fc3b-dcd1-42b7-b691-4a93af6d78fc.jpg</url>
      <title>Forem: yashdewasthale</title>
      <link>https://forem.com/yashdev9274</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/yashdev9274"/>
    <language>en</language>
    <item>
      <title>Exploring the Ethereum Network: Fetching Account Balance with ethers.js</title>
      <dc:creator>yashdewasthale</dc:creator>
      <pubDate>Mon, 05 Jun 2023 11:30:00 +0000</pubDate>
      <link>https://forem.com/yashdev9274/exploring-the-ethereum-network-fetching-account-balance-with-ethersjs-1eo0</link>
      <guid>https://forem.com/yashdev9274/exploring-the-ethereum-network-fetching-account-balance-with-ethersjs-1eo0</guid>
      <description>&lt;p&gt;In the rapidly evolving landscape of blockchain technology, Ethereum has emerged as a leading platform for decentralized applications(dApps) and smart contracts. As a web3 developer, your expertise in building decentralized application on Ethereum is in high demand. So in this article, we will dive deep into the process of fetching the balance of a specific Ethereum account using the powerful ether.js library and the Infura service. By understanding the code snippets presented here, you will gain valuable insight into working with the Ethereum network and mastering the art of web3 development. &lt;/p&gt;

&lt;h4&gt;
  
  
  Why Ethereum?
&lt;/h4&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F159qjrgfvp0o5iupx9j0.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F159qjrgfvp0o5iupx9j0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ethereum stands out as a prominent blockchain platform due to its robustness flexibility, and extensive developer community. It provides a decentralized virtual machine, known as the Ethereum Virtual Machine(EVM), where smart contracts are executed. This unique feature allows developers to build decentralized applications that can interact with each other and leverage the security and transparency offered by the blockchain.&lt;/p&gt;




&lt;h3&gt;
  
  
  Prerequisites:
&lt;/h3&gt;

&lt;p&gt;Before diving into web3 development with Ehter.js and Infura, it is essential to have a basic understanding of the following concepts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;JavaScript: Familiarity with JavaScript programming language is necessary as Ehter.js is a JavaScript library. Understanding core JavaScript concepts like variables, functions, objects, and asynchronous programming(Promises, async/await) will greatly assist in working with Ether.js.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ethereum Basics: A fundamental understanding of Ethereum and its key components is essential. This includes knowledge of Ethereum accounts (address, private keys, and public keys), transactions, gas fees, smart contracts, and the Ethereum Virtual Machine(EVM).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To know more about Ethereum Virtual Machine(EVM) check out this blog &lt;a href="https://yashdev9274.github.io/Web3-Developer-Path/#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Solidity (Optional): Solidity is the programming language used for developing smart contracts on the Ethereum platform. Although not mandatory, having a basic understanding of Solidity can help in interacting with and deploying smart contracts using Ethers.js.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To learn Solidity basics check this out &lt;a href="https://yashdev9274.github.io/Web3-Developer-Path/#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;JSON-RPC: Understanding the basics of the JSON-RPC protocol will be helpful in grasping how Ether.js communicates with the Ethereum network through Infura. JSON-RPC is a remote procedure call protocol encoded in JSON, which allows clients to interact with Ethereum nodes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To know more about JSON-RPC check out this blog &lt;a href="https://yashdev9274.github.io/Web3-Developer-Path/#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Infura Project ID: &lt;br&gt;
To use Infura, you will need to sign up for an account on the Infura platform and obtain a Project ID. This Project ID is essential for connecting to the Ethereum network through Infura's JSON-RPC API.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To know more about Infura check out this blog &lt;a href="https://yashdev9274.github.io/Web3-Developer-Path/#/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  The Significance of Ether.js and Infura in Ethereum Development
&lt;/h2&gt;

&lt;p&gt;In the realm of Ethereum development, two key components play a crucial role in facilitating seamless interaction with the Ethereum network: Ether.js and Infura. These tools serve as instrumental elements for developers, empowering them to build robust decentralized applications while streamlining the development process.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4360u25hm9kmc3t0xkba.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4360u25hm9kmc3t0xkba.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ether.js stands out as a highly popular JavaScript library that acts as a vital bridge, connecting developers' applications with the Ethereum network. By providing a user-friendly and intuitive interface, Ether.js simplifies the complex task of working with Ethereum accounts, contracts, and various blockchain operations. This powerful library empowers developers by granting access to the full spectrum of Ethereum functionalities, thus enabling them to create sophisticated decentralized applications efficiently.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd8r7yw8rre0ndhc5b59.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd8r7yw8rre0ndhc5b59.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To effectively connect with the Ethereum network, developers typically rely on service providers known as node providers. Infura, in particular, emerges as a leading player in this domain, offering developers a convenient gateway to the Ethereum network through its reliable and scalable infrastructure. By leveraging Infura, developers can effortlessly interact with the Ethereum network without the need to set up and maintain their own Ethereum node. This not only saves valuable time and resources but also allows developers to focus on their core application logic and development tasks.&lt;/p&gt;

&lt;p&gt;By combining the capabilities of Ether.js and Infura, developers can harness the full potential of Ethereum, capitalizing on its decentralized features while minimizing the complexities associated with infrastructure management. As a result, developers can concentrate on creating innovative and groundbreaking decentralized applications, propelling the advancement of the Ethereum ecosystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fetching Account Balance:
&lt;/h2&gt;

&lt;p&gt;Now lets dive right into the code explanation part which demonstrate how to fetch the balance of an Ethereum account using ether.js and Infura:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplj3gqfc4s1ol7hvnz5w.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fplj3gqfc4s1ol7hvnz5w.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const { ethers } = require("ethers");

const INFURA_ID = 'YOUR_INFURA_PROJECT_ID';
const provider = new ethers.providers.JsonRpcProvider(`https://mainnet.infura.io/v3/${INFURA_ID}`);
const address = '0x5c6f90e52284726a7276d6a20a3df94a4532a8fa';

const main = async () =&amp;gt; {
  const balance = await provider.getBalance(address);
  console.log(`ETH Balance of ${address}: ${ethers.utils.formatEther(balance)} ETH`);
}

main();


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding the Code:
&lt;/h3&gt;

&lt;p&gt;Let's break down the code snippet step by step to gain a comprehensive understanding of each component and its significance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Importing the Required Modules:&lt;br&gt;
The code begins by importing the ethers object from the ethers library. This library acts as a bridge between your application and the Ethereum network, providing a high-level interface to interact with accounts, contracts, and various Ethereum functionalities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setting the Infura Project ID:&lt;br&gt;
To connect to the Ethereum network, we require an endpoint. In this case, we utilize the popular Infura service, which acts as a gateway to the Ethereum network. The INFURA_ID constant stores your unique Infura project ID, ensuring secure and authenticated access to the network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creating a Provider:&lt;br&gt;
The provider object is crucial for establishing a connection to the Ethereum network. Here, we initialize an instance of the JsonRpcProvider class from the ethers.providers module. It allows us to communicate with the Ethereum network by specifying the Infura endpoint URL, along with the INFURA_ID for authentication.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Defining the Ethereum Address:&lt;br&gt;
The address constant represents the Ethereum account address for which we want to retrieve the balance. It is essential to replace this placeholder with the actual Ethereum address of interest. This flexibility allows you to fetch the balance of any Ethereum account as per your requirements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The main Function:&lt;br&gt;
The main function serves as the entry point of our code. It is marked as asynchronous, enabling the use of the await keyword for handling asynchronous operations. Within this function, we make an asynchronous call to provider.getBalance(address), which retrieves the balance of the specified Ethereum address from the network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logging the Balance:&lt;br&gt;
The retrieved balance, expressed in wei (the smallest unit of ether), is stored in the balance variable. To make it more readable, we utilize the ethers.utils.formatEther(balance) function to convert it from wei to ether. The formatted balance is then displayed using console.log for convenient visualization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Invoking the main Function:&lt;br&gt;
The final line of code invokes the main function, triggering the execution of our code and initiating the process of fetching the Ethereum account balance.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;In this blog post, we have explored a code snippet that demonstrates how to fetch the balance of a specific Ethereum account using the ethers.js library and the Infura service. By harnessing the power of web3 development, you gain the ability to interact with the Ethereum blockchain, enabling the creation of decentralized applications and the execution of smart contracts. Understanding the presented code provides you with a solid foundation for further exploration and development in the web3 ecosystem.&lt;/p&gt;

&lt;p&gt;Remember to customize the code to fit your specific needs, such as utilizing your own Ethereum address or extending the functionality to perform additional operations on the blockchain. As a web3 developer, continuous learning and adaptation are key to staying ahead in this rapidly evolving landscape. Embrace the opportunities that Ethereum and web3 development offer, and embark on your journey to building innovative and decentralized solutions. Happy coding!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>web3</category>
      <category>etherjs</category>
      <category>opensource</category>
    </item>
    <item>
      <title>My new blog post</title>
      <dc:creator>yashdewasthale</dc:creator>
      <pubDate>Mon, 06 Mar 2023 05:15:33 +0000</pubDate>
      <link>https://forem.com/yashdev9274/my-new-blog-post-2fn1</link>
      <guid>https://forem.com/yashdev9274/my-new-blog-post-2fn1</guid>
      <description>&lt;p&gt;&lt;strong&gt;Exciting news📢!&lt;/strong&gt;&lt;br&gt;
I'm releasing a brand new blog today. Can you guess the topic? Comment them👇 and stay tuned for the big reveal.&lt;/p&gt;

&lt;p&gt;In the meantime, check out my other blogs on #Hashnode and make sure to follow me for more tech goodness. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://hashnode.com/@yashdev9274"&gt;https://hashnode.com/@yashdev9274&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  blogging #tech
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>What are Ethereum Testnets?</title>
      <dc:creator>yashdewasthale</dc:creator>
      <pubDate>Sun, 11 Dec 2022 07:31:36 +0000</pubDate>
      <link>https://forem.com/yashdev9274/what-are-ethereum-testnets-14mc</link>
      <guid>https://forem.com/yashdev9274/what-are-ethereum-testnets-14mc</guid>
      <description>&lt;p&gt;These are networks used by protocol developers or smart contract developers to test both protocol upgrades as well as potential smart contracts in a production-like environment before deployment to Mainnet. Think of this as an analog to production versus staging servers.&lt;/p&gt;

&lt;p&gt;ETH on testnets has no real value; therefore, there are no markets for testnet ETH. Since you need ETH to actually interact with Ethereum, most people get testnet ETH from faucets. Most faucets are webapps where you can input an address which you request ETH to be sent to.&lt;/p&gt;

&lt;p&gt;Which Testnet should I use?&lt;br&gt;
The two public proof-of-stake testnets (which client developers are maintaining post-merge) are Goerli and Sepolia. The Goerli network was merged with the Prater Beacon Chain testnet. The Sepolia network was created to test the transition to proof-of-stake.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sepolia
&lt;/h2&gt;

&lt;p&gt;It is the recommended default testnet for application development. The Sepolia network uses a permissioned validator set. It's fairly new, meaning its state and history are both quite small. This means the network is quick to sync to and that running a node on it requires less storage. This is useful for users who want to quickly spin up a node and interact with the network directly.&lt;/p&gt;

&lt;p&gt;It's features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Closed validator set, controlled by client &amp;amp; testing teams.&lt;/li&gt;
&lt;li&gt;New testnet, less applications deployed than other testnets.&lt;/li&gt;
&lt;li&gt;Fast to sync and running a node requires minimal disk space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Goerli
&lt;/h2&gt;

&lt;p&gt;It is the recommended default testnet for testing of validating and staking. The Goerli network is open for users wanting to run a testnet validator. Stakers wanting to test protocol upgrades before they are deployed to mainnet should therefore use Goerli.&lt;/p&gt;

&lt;p&gt;It's features: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open validator set, stakers can test network upgrades.&lt;/li&gt;
&lt;li&gt;Large state, useful for testing complex smart contract interactions.&lt;/li&gt;
&lt;li&gt;Longer to sync and requires more storage to run a node.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
    </item>
    <item>
      <title>WHAT ARE BLOCKCHAIN BRIDGES?</title>
      <dc:creator>yashdewasthale</dc:creator>
      <pubDate>Wed, 16 Nov 2022 16:09:43 +0000</pubDate>
      <link>https://forem.com/yashdev9274/what-are-blockchain-bridges-3ej5</link>
      <guid>https://forem.com/yashdev9274/what-are-blockchain-bridges-3ej5</guid>
      <description>&lt;p&gt;Bridges allow isolated #blockchain environments to communicate with one another. They create a pathway for tokens, messages, arbitrary data, and even #SmartContract  calls to be transferred from one blockchain to another.&lt;/p&gt;

&lt;p&gt;BENEFITS OF BRIDGES:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;the transfer of any data, information, and assets across chains.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;unlocking new features and use cases for protocols as bridges expand the design space for what protocols can offer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;the opportunity to leverage the strengths of different blockchains. For example, developers can benefit from the lower fees offered by the different L2 solutions by deploying their dapps across rollups, and sidechains and users can bridge across them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;collaboration among developers from various blockchain ecosystems to build new products.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;attracting users and communities from various ecosystems to their Dapps.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HOW DO BRIDGES WORK?&lt;/p&gt;

&lt;p&gt;While there are many types of bridge designs, three ways to facilitate the cross-chain transfer of assets stand out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Lock assets on the source chain and mint assets on the destination chain.&lt;/li&gt;
&lt;li&gt;Burn assets on the source chain and mint assets on the destination chain.&lt;/li&gt;
&lt;li&gt;Swap assets on the source chain for assets on the destination chain with another party.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;TYPES OF BRIDGES&lt;/p&gt;

&lt;p&gt;Bridges can usually be classified into one of the following buckets:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Native bridges – These bridges are typically built to bootstrap liquidity on a particular blockchain, making it easier for users to move funds to the ecosystem. For example, the Arbitrum Bridge is built to make it convenient for users to bridge from Ethereum Mainnet to Arbitrum. Other such bridges include Polygon PoS Bridge, Optimism Gateway, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Validator or oracle based bridges – These bridges rely on an external validator set or oracles to validate cross-chain transfers. Examples: Multichain and Across.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generalized message passing bridges – These bridges can transfer assets, along with messages and arbitrary data across chains. Examples: Nomad and LayerZero.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Liquidity networks – These bridges primarily focus on transferring assets from one chain to another via atomic swaps. Generally, they don’t support cross-chain message passing. Examples: Connext and Hop&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>How does #blockchain technology work for business?</title>
      <dc:creator>yashdewasthale</dc:creator>
      <pubDate>Tue, 15 Nov 2022 14:02:05 +0000</pubDate>
      <link>https://forem.com/yashdev9274/how-does-blockchain-technology-work-for-business-10bk</link>
      <guid>https://forem.com/yashdev9274/how-does-blockchain-technology-work-for-business-10bk</guid>
      <description>&lt;p&gt;Blockchain for business is useful for entities that conduct transactions with one another. Blockchain also allows a solution to rapidly size and scale. Blockchain for business provides these advantages based on four distinct characteristics of the technology:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Consensus: Shared ledgers are only updated after the transaction has been validated by all relevant participants.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replication: When a block — the record of an event — is accepted, it is automatically imitated across all ledgers for all channel participants. Each network partner sees and shares the same "trusted reality" of the transactions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Immutability: More blocks can be added but not removed, ensuring a permanent record of every transaction and increasing stakeholder trust.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Security: Only approved entities are permitted to create and access blocks. Only trusted partners are granted access.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
