<?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: Lara Parvinsmith</title>
    <description>The latest articles on DEV Community by Lara Parvinsmith (@lparvinsmith).</description>
    <link>https://dev.to/lparvinsmith</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%2F213115%2F7d6f3240-f56e-493b-8939-26537af089f2.jpeg</url>
      <title>DEV Community: Lara Parvinsmith</title>
      <link>https://dev.to/lparvinsmith</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lparvinsmith"/>
    <language>en</language>
    <item>
      <title>Signatures as Authentication in Web3</title>
      <dc:creator>Lara Parvinsmith</dc:creator>
      <pubDate>Tue, 22 Mar 2022 01:42:08 +0000</pubDate>
      <link>https://dev.to/lparvinsmith/signatures-as-authentication-in-web3-3kod</link>
      <guid>https://dev.to/lparvinsmith/signatures-as-authentication-in-web3-3kod</guid>
      <description>&lt;p&gt;When interacting with web3 apps, you may have seen a signature request in your wallet that looks like this. This article explains what this signature is and how it's used as authentication.&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%2Ffzc9m17qsppvjafg735x.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%2Ffzc9m17qsppvjafg735x.png" alt="Screenshot of a signature request in MetaMask"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  What is a signature and what does it prove?
&lt;/h2&gt;

&lt;p&gt;A cryptographic signature proves that the signer has the &lt;strong&gt;private key&lt;/strong&gt; to a &lt;strong&gt;public address&lt;/strong&gt;. A &lt;strong&gt;public address&lt;/strong&gt; on the Ethereum blockchain is a 42-character hexadecimal address derived from the public key controlling the account with 0x appended in front. e.g., 0x88c78f158cac85f17ecfc063259543c5dc345ef3. Anyone can send money to an account using the public address, or look up the account activity and assets. However, to &lt;em&gt;control&lt;/em&gt; the assets in the account, you need to have the &lt;strong&gt;private key&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Ethereum wallets, such as MetaMask and Coinbase Wallet, store your public key and private key for you, and protect against apps directly accessing the private key. Instead, apps rely on a &lt;strong&gt;cryptographic signature&lt;/strong&gt; that proves ownership of the address through the &lt;a href="https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm" rel="noopener noreferrer"&gt;Elliptic Curve Digital Signature Algorithm&lt;/a&gt;, which &lt;strong&gt;allows any external party to verify the signature without knowing the private key&lt;/strong&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of using a signature for authentication
&lt;/h2&gt;

&lt;p&gt;In web3 apps, a user's Ethereum address is increasingly replacing a username or email to identify a user. And instead of a password to authenticate that a user controls the digital identity, a signature can be used.&lt;/p&gt;

&lt;p&gt;Leveraging an existing Ethereum account is a lightweight way to onboard web3 users. It's faster than traditional account creation flows, and doesn't require the user to create and store yet another password. It also allows the user more anonymity, since they don't have to reveal private details like their email.&lt;/p&gt;

&lt;p&gt;Unlike blockchain transactions, signature generation and verification can be done off-chain, and therefore requires no gas fees. And while it proves a user's control of an Ethereum address, future blockchain transactions will still require explicit approval through a separate wallet request.&lt;/p&gt;

&lt;h2&gt;
  
  
  How signatures are used in hybrid apps
&lt;/h2&gt;

&lt;p&gt;Some apps, such as &lt;a href="https://snapshot.org/" rel="noopener noreferrer"&gt;Snapshot&lt;/a&gt; and &lt;a href="https://opensea.io/" rel="noopener noreferrer"&gt;OpenSea&lt;/a&gt; use a hybrid of blockchain data and data from a private database. These apps will use a traditional database to store off-chain actions, such as voting (on Snapshot proposals) or favoriting NFTs (OpenSea stores users' favorited NFTs). Onboarding onto these apps is easy, because a user just has to allow it to connect to their Ethereum wallet. But to store the outcome of these actions, or any off-chain details about the user (such as profile name and photo), these apps must authenticate the user's digital identity.&lt;/p&gt;

&lt;p&gt;For example, to change an OpenSea profile's details, the user must authenticate to prove they control this address.&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%2F229u75wl9hy1iwcqi2xv.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%2F229u75wl9hy1iwcqi2xv.png" alt="Screenshot of signature request in MetaMask wallet to login to OpenSea"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;For apps using signature authentication, it's important not to allow the same signature to be used twice. This is why the messages vary, and often include a &lt;a href="https://en.wikipedia.org/wiki/Cryptographic_nonce" rel="noopener noreferrer"&gt;nonce&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  How to generate and verify signatures
&lt;/h2&gt;

&lt;h3&gt;
  
  
  On Etherscan
&lt;/h3&gt;

&lt;p&gt;To sign or verify a signature right now, you can use &lt;a href="https://etherscan.io/verifiedSignatures#" rel="noopener noreferrer"&gt;Etherscan's Verified Signature tool&lt;/a&gt;.&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%2Frgnpdcpexn8p7tlsn0tn.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%2Frgnpdcpexn8p7tlsn0tn.png" alt="Screenshot of signature tool with open MetaMask wallet requesting signature"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Connect a wallet and enter any message. Those two inputs, plus your private key, generate a unique hash.&lt;/em&gt;&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%2Fhtjjtpx4a8ra1lpr2rp3.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%2Fhtjjtpx4a8ra1lpr2rp3.png" alt="Screenshot of signature verification in etherscan"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;To verify this signature came from the wallet's owner, another party can input the signature hash, along with the address and message to validate.&lt;/em&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  In your frontend app
&lt;/h3&gt;

&lt;p&gt;To request a signature in your web3 app, you can use a library like &lt;a href="https://web3js.readthedocs.io/en/v1.7.1/web3-eth-personal.html#sign" rel="noopener noreferrer"&gt;web3.js&lt;/a&gt; on the frontend. The code snippet below shows how to generate a &lt;code&gt;signatureHash&lt;/code&gt; using a web3.js method, then an example of passing it to any signature verification API to your backend.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;const signatureHash = await web3.eth.personal.sign(message, address)&lt;br&gt;
someSignatureVerificationAPI(message, address, signatureHash)&lt;/p&gt;

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

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Conclusion&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;As the Ethereum address has replaced the account username, the signature has replaced the password. Because a cryptographic signature proves the user controls the private key to the public address, it is a secure method of authentication. Apps can use this gas-less primitive of Ethereum to verify a user has control over the digital identity provided by the address, and provide authentication to do arbitrary, non-web3 actions.&lt;/p&gt;

</description>
      <category>ethereum</category>
      <category>blockchain</category>
      <category>web3</category>
      <category>cryptography</category>
    </item>
    <item>
      <title>web3.js vs ethers.js: a Comparison of Web3 Libraries</title>
      <dc:creator>Lara Parvinsmith</dc:creator>
      <pubDate>Thu, 03 Mar 2022 01:13:13 +0000</pubDate>
      <link>https://dev.to/lparvinsmith/web3js-vs-ethersjs-a-comparison-of-web3-libraries-2ap5</link>
      <guid>https://dev.to/lparvinsmith/web3js-vs-ethersjs-a-comparison-of-web3-libraries-2ap5</guid>
      <description>&lt;p&gt;Both &lt;a href="https://web3js.readthedocs.io/"&gt;web3.js&lt;/a&gt; and &lt;a href="https://docs.ethers.io"&gt;ethers.js&lt;/a&gt; are JavaScript libraries that enable frontend apps to interact with the Ethereum blockchain, including smart contracts. If you're building an app that reads or writes to the blockchain from the client, you'll need to use one of these libraries. They have similar functionality, but an important question is how they will be maintained and grow with the emerging dapp ecosystem. &lt;/p&gt;

&lt;h2&gt;
  
  
  Quantitative comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;web3.js&lt;/th&gt;
&lt;th&gt;ethers.js&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Date of first release&lt;/td&gt;
&lt;td&gt;Feb 2015&lt;/td&gt;
&lt;td&gt;Jul 2016&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GitHub stars&lt;/td&gt;
&lt;td&gt;13.4k&lt;/td&gt;
&lt;td&gt;4k&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GitHub contributors*&lt;/td&gt;
&lt;td&gt;16**&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bundle size***&lt;/td&gt;
&lt;td&gt;590.6kB&lt;/td&gt;
&lt;td&gt;116.5kB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;*GitHub contributors from March 1, 2021 to March 1, 2022&lt;/em&gt;&lt;br&gt;
&lt;em&gt;**16 contributors, but only 2 had more than 10 commits in the one year period&lt;/em&gt;&lt;br&gt;
&lt;em&gt;***Bundle size from &lt;a href="https://bundlephobia.com"&gt;bundlephobia&lt;/a&gt;, value of minified and gzipped package.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  API differences
&lt;/h2&gt;

&lt;p&gt;While web3.js provides a single instantiated web3 object with methods for interacting with the blockchain, ethers.js separates the API into two separate roles. The &lt;code&gt;provider&lt;/code&gt;, which is an anonymous connection to the ethereum network, and the &lt;code&gt;signer&lt;/code&gt;, which can access the private key and sign the transactions. The ethers team &lt;a href="https://medium.com/l4-media/announcing-ethers-js-a-web3-alternative-6f134fdd06f3"&gt;intended&lt;/a&gt; this separation of concerns to provide more flexibility to developers. &lt;/p&gt;

&lt;h3&gt;
  
  
  Side-by-side examples
&lt;/h3&gt;

&lt;p&gt;Below are some examples of common functions a developer would include in their dapp. You'll see they offer the same functionality, with some slight differences of API.&lt;/p&gt;

&lt;h4&gt;
  
  
  Instantiating provider with MetaMask wallet
&lt;/h4&gt;

&lt;p&gt;web3&lt;br&gt;
&lt;code&gt;const web3 = new Web3(Web3.givenProvider);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ethers&lt;br&gt;
&lt;code&gt;const provider = new ethers.providers.Web3Provider(window.ethereum)&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Getting balance of account
&lt;/h4&gt;

&lt;p&gt;web3&lt;br&gt;
&lt;code&gt;const balance = await web3.eth.getBalance("0x0")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ethers (supports ENS!)&lt;br&gt;
&lt;code&gt;const balance = await provider.getBalance("ethers.eth")&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Instantiating contract
&lt;/h4&gt;

&lt;p&gt;web3&lt;br&gt;
&lt;code&gt;const myContract = new web3.eth.Contract(ABI, contractAddress);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ethers&lt;br&gt;
&lt;code&gt;const myContract = new ethers.Contract(contractAddress, ABI, provider.getSigner());&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Calling contract method
&lt;/h4&gt;

&lt;p&gt;web3&lt;br&gt;
&lt;code&gt;const balance = await myContract.methods.balanceOf("0x0").call()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ethers&lt;br&gt;
&lt;code&gt;const balance = await myContract.balanceOf("ethers.eth")&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So which should I pick for my project?
&lt;/h2&gt;

&lt;p&gt;Given the details above, web3.js looks like the go-to choice, with a longer history and more maintainers. However, ethers.js seems just as reliable and includes some differentiating perks such as size and additional features. Most other articles on this subject conclude that you could easily pick either, depending on what you're looking for. &lt;/p&gt;

&lt;p&gt;I too hesitate to recommend one over the other. But as the ecosystem evolves, it is important to me to pick the library that will be most flexible and supported by other libraries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ecosystem factors
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Which will be the most supported by open source libraries?
&lt;/h4&gt;

&lt;p&gt;As the dapp ecosystem grows, which of the two libraries will be the most compatible with other open source libraries you want to bring into your app? &lt;/p&gt;

&lt;p&gt;In my limited experience, as this is still an emerging area for development, there are a couple libraries that require ethers.js to use the framework. Examples include &lt;a href="https://www.npmjs.com/package/web3-react"&gt;web3-react&lt;/a&gt; and &lt;a href="https://docs.swapsdk.xyz"&gt;NFT Swap SDK&lt;/a&gt;. I have not yet seen libraries that require web3.js.&lt;/p&gt;

&lt;h4&gt;
  
  
  Which will have a solution for mocking for end-to-end testing?
&lt;/h4&gt;

&lt;p&gt;Implementing end-to-end testing for web3 features is a challenge. This is partly because most tools, like &lt;a href="https://www.cypress.io"&gt;Cypress&lt;/a&gt;, run your tests in a Chromium browser that does not support browser extensions. Developers need an easy way to mock Ethereum providers or the web3/ethers instance to use inside their test environments. So far, I haven't seen any libraries that help solve this. But if there were a tool that helped mock providers for testing, and only worked with ethers for example, that would be enough for me to choose ethers over web3.  &lt;/p&gt;

&lt;p&gt;Which library do you prefer, web3.js or ethers.js? Are there any tools in the ecosystem I'm overlooking? Let me know in the comments! &lt;/p&gt;

</description>
      <category>web3</category>
      <category>ethereum</category>
      <category>javascript</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Web3: the unique technology and challenges behind the hype</title>
      <dc:creator>Lara Parvinsmith</dc:creator>
      <pubDate>Mon, 17 Jan 2022 20:17:11 +0000</pubDate>
      <link>https://dev.to/lparvinsmith/web3-the-unique-technology-and-challenges-behind-the-hype-kgn</link>
      <guid>https://dev.to/lparvinsmith/web3-the-unique-technology-and-challenges-behind-the-hype-kgn</guid>
      <description>&lt;p&gt;If you follow tech news, you've probably seen crypto evangelists say that Web3 will change the world. But what is Web3?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Web3 describes applications that can interact directly with the blockchain as its database.&lt;/strong&gt; At the time of writing, most apps, (also called 'dapps,' for 'decentralized apps') are built on the Ethereum blockchain. The reason a user would want to store their transactions on a public blockchain rather than a private, company-managed database is that it enables ownership and portability of their data and assets. The reason a developer would build an app on the blockchain is to tap into an advanced, transparent ecosystem with decentralized control.&lt;/p&gt;

&lt;p&gt;I write from the perspective of both a Web3 developer and a crypto user to highlight key technologies and remaining user experience challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Stack of a Web3 app
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Smart Contract
&lt;/h3&gt;

&lt;p&gt;The database of a Web3 app is a blockchain like Ethereum. While an app could be written to simply send Ethereum from one account to another, most apps require a more complex API. &lt;strong&gt;The APIs for complex interaction with the blockchain come from smart contracts.&lt;/strong&gt; A smart contract is code that is stored and runs on the blockchain. It contains functions that allow a user to update the state of accounts on the blockchain. Examples of common functions include minting a non-fungible token (NFT), adding liquidity to a decentralized finance (defi) protocol, and voting in a decentralized autonomous organization (DAO).&lt;/p&gt;

&lt;p&gt;One advantage of smart contracts is that all code is transparent and available on a blockchain explorer like &lt;a href="https://etherscan.io"&gt;Etherscan&lt;/a&gt;. This allows a user to audit contract code, the contract owner, and all transactions in a convenient web UI.  However, not all users are technical or patient enough to be able to perform this type of due diligence, and scams and hacks are rampant in the community.&lt;/p&gt;

&lt;p&gt;Another key advantage is that anyone can build another a front end app or even another smart contract that interacts with the smart contract. In this way, a decentralized ecosystem of builders can thrive, and users can have more choice. An example of this is NFTs, which are stored on the blockchain and accessible from any NFT client. At the time of writing, &lt;a href="https://opensea.io"&gt;OpenSea&lt;/a&gt; is the largest NFT marketplace, but a user who buys an NFT on OpenSea is not locked into their app. Their transaction is stored on the blockchain, so they can access and sell the NFT from any other Web3 NFT app.&lt;/p&gt;

&lt;p&gt;But how does a Web3 frontend access the blockchain data and use a smart contract's API?&lt;/p&gt;

&lt;h3&gt;
  
  
  The Wallet
&lt;/h3&gt;

&lt;p&gt;The crypto wallet is another key technology that makes Web3 unique. &lt;strong&gt;Every Web3 app must connect to a crypto wallet to allow the frontend to interact with the blockchain.&lt;/strong&gt; Some of the most popular wallets include &lt;a href="https://metamask.io"&gt;MetaMask&lt;/a&gt; and &lt;a href="https://www.coinbase.com/wallet"&gt;Coinbase Wallet&lt;/a&gt;, which a user can install as a browser extension and as a mobile app.&lt;/p&gt;

&lt;p&gt;A wallet allows users to create and manage accounts while isolating private keys from the Web3 app. The wallet exposes an API to interact with the blockchain and a user interface for confirming transactions. This allows a user to safely connect their account to a Web3 app and gives them control so that the Web3 app cannot write to the blockchain without the user's explicit permission.&lt;/p&gt;

&lt;p&gt;Relying on a third party wallet has the advantage of allowing the user to have consistent, controlled interaction across all Web3 apps, from allowing the app to read the user's public account details to confirming transactions before they're sent. From the developer perspective, this allows us to focus on building what's unique about our Web3 app, and not rebuild accounts and authentication every time. However, it does require some user setup the first time they want to interact with a Web3 app, as they have to install a wallet, set up an account, and add funds. &lt;/p&gt;

&lt;h3&gt;
  
  
  The Client
&lt;/h3&gt;

&lt;p&gt;The client is the frontend app that a user interacts with in the web browser. You can build a Web3 app with any frontend framework, or even vanilla JS and HTML, but you will need an Ethereum Javascript library to interact with smart contracts. &lt;/p&gt;

&lt;p&gt;The two most commonly used libraries at the time of writing are &lt;a href="https://web3js.readthedocs.io/en/v1.5.2/index.html"&gt;web3.js&lt;/a&gt; and &lt;a href="https://docs.ethers.io/v5/"&gt;ethers.js&lt;/a&gt;. Both of these libraries provide utilities for interacting with the Ethereum blockchain, including accounts, contracts, and transactions.&lt;/p&gt;

&lt;p&gt;While the crypto wallet, such as MetaMask, provides an API to read and update the state of the Ethereum network, the JS library can find and abstract the smart contract so that its functions can be called asynchronously by the Web3 app. &lt;/p&gt;

&lt;p&gt;Other than that, the usual frontend libraries are often used to build more complex apps, with React as the most popular choice. There are even some libraries that combine React with Web3 functionality, such as &lt;a href="https://github.com/NoahZinsmeister/web3-react"&gt;web3-react&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key UX Challenges of Web3 apps
&lt;/h2&gt;

&lt;p&gt;Some of the challenges I have mentioned above include requiring the user to install a wallet and fund an account before being able to interact with a Web3 app. Here are some other major user-facing challenges, that if not addressed in the ecosystem, could make Web3 unappealing to many users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gas
&lt;/h3&gt;

&lt;p&gt;"Gas" refers to the transaction fee users pay miners with every transaction to keep the Ethereum blockchain running. It's a key part of the ecosystem, to incentivize miners to run nodes and to incentivize users not to overuse computing power. The amount the user pays is a function of the complexity of the transaction and the current demand. However, with the increased popularity of Ethereum, gas fees can rocket up to $200+ for some smart contract transactions at peak usage. &lt;strong&gt;What are the current solutions for high gas fees?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As a user, you can check gas fees with apps like &lt;a href="https://ethgas.watch"&gt;ETH Gas.watch&lt;/a&gt; before you make a transaction, or sign up to be notified when gas prices drop. In general, gas prices tend to drop during U.S. sleeping hours (see &lt;a href="https://ethereumprice.org/gas/"&gt;Gas Price by Time of Day&lt;/a&gt;) so users could wait until low traffic times to make non-urgent transactions. But this is not an ideal solution for most users, and it disqualifies the use case of using it for everyday transactions such as buying a cup of coffee.&lt;/p&gt;

&lt;p&gt;As a developer, there are some ways to optimize your smart contract code to avoid exorbitant gas fees for your users. These strategies range from storing variables as preferred data types to using third party libraries. Since this is a complex topic on its own, I won't dive into it here, but will instead refer interested readers to &lt;a href="https://shiny.mirror.xyz/OUampBbIz9ebEicfGnQf5At_ReMHlZy0tB4glb9xQ0E"&gt;this article&lt;/a&gt; on cutting gas costs for minting NFTs. However, this optimization is still not enough for many prospective users. Going from a gas fee of $200 to a gas fee of $30 is a huge achievement, but $30 is still a big enough deterrent for new users trying to make their first transaction. Because it's not just the gas fees, but other uncertainty and complexity that could make a user even more risk adverse. &lt;/p&gt;

&lt;h3&gt;
  
  
  Complexity
&lt;/h3&gt;

&lt;p&gt;Current blockchain transactions are still very complex for users, requiring multiple steps and new concepts. This causes a lot of uncertainty, and &lt;strong&gt;the user may often wonder: "am I doing this right?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I covered some of the complexity of the crypto wallet and account setup above, but we must remember a new crypto user will have to create and fund a crypto wallet. This step alone could take days, depending on how fast their fiat can be converted to crypto and transferred to their wallet. When this is complete, they can interact with Web3 apps. However, the Web3 apps themselves are often just as complex. Decentralized apps involve new concepts, including over-collateralized lending and minting non-fungible tokens. They also often involve multiple steps, and rely on a user to already know what they are doing. &lt;/p&gt;

&lt;p&gt;There are many elements of a Web3 app that can make a user feel uncertainty. From the 42-character hexadecimal Ethereum address ("am I sending this to the right place?") to the transactions themselves ("why is gas so expensive?" "how do I know if it worked or not?") the user can be intimidated and fear losing their money from a small mistake. &lt;/p&gt;

&lt;h3&gt;
  
  
  Successes, errors, and loading states
&lt;/h3&gt;

&lt;p&gt;More transparency around what different transaction outcomes look like, and more UI to fill in the gaps, would be helpful to guide a user through complex Web3 flows. For example, if all goes well, how do you know if your transaction is successful? &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A successful transaction is defined by being added to the blockchain, but it can take up to a few minutes for the app to be confident the transaction has been included in a block.&lt;/strong&gt; So the developer must decide how to communicate the difference between ‘your transaction was successfully sent to the pool of pending transactions,’ and ‘your transaction was successfully added to the blockchain.’&lt;/p&gt;

&lt;p&gt;There are a few different tools to track the outcome of your transaction. One is on Etherscan: as a developer, you can have the "successfully initiated transaction" state provide a link to the transaction on Etherscan, so the user can check the status of their transaction there. You can also use client code to check whether a transaction has been mined, and indicate true "success" after 5 confirmations, or blocks created after the transaction. The latter may be a better user experience, since the user won't have to navigate away or reload the page. If the user expects their wallet balance to change as a result, or an NFT to arrive, that could be another signal of success, but on many platforms this requires waiting and refreshing.&lt;/p&gt;

&lt;p&gt;If a transaction fails, the user will often lose some of their gas fee, and maybe their confidence in Web3. To avoid this, we need proactive measures to make sure their transactions don't error. We can achieve this by making smart contract state more transparent to the client, and by validating requirements on the client before allowing transactions to be initiated. Web3 developers should also focus on clearly communicating any errors to the user. All of these strategies will lead to more user confidence in Web3 technology.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Web3 hype is grounded in revolutionary technologies that have a thriving ecosystem of builders, and users of all levels of expertise.&lt;/strong&gt; These technologies: the blockchain, smart contracts, and crypto wallets are key tools for building the Web3 ecosystem. Web3 already provides users and developers more freedom and transparency, but there are still some major drawbacks that could prevent mainstream adoption if unaddressed.&lt;/p&gt;

</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>ux</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>Easiest way to deploy your Ethereum Smart Contract</title>
      <dc:creator>Lara Parvinsmith</dc:creator>
      <pubDate>Sun, 09 Jan 2022 19:29:08 +0000</pubDate>
      <link>https://dev.to/lparvinsmith/easiest-way-to-deploy-your-ethereum-smart-contract-2825</link>
      <guid>https://dev.to/lparvinsmith/easiest-way-to-deploy-your-ethereum-smart-contract-2825</guid>
      <description>&lt;p&gt;So you've written your Ethereum smart contract, and now you may be wondering how to deploy it. I recommend first deploying the contract to a Test Network (testnet), such as Rinkeby, before deploying it to Ethereum Main Network (mainnet). You can deploy to both testnet and mainnet by using the Remix web app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why deploy to a testnet
&lt;/h2&gt;

&lt;p&gt;Testnets behave similarly to the Ethereum Main Network, but the ETH required to transact with them is free to get from a "faucet." Faucets are apps where you can input your testnet wallet address and receive testnet assets like ETH. (I like &lt;a href="https://faucets.chain.link" rel="noopener noreferrer"&gt;Chainlink's Faucet&lt;/a&gt; and refer to it in the instructions below.) Testnet ETH enables you to pay the gas to deploy your smart contract to testnet and make test transactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy the easiest way
&lt;/h2&gt;

&lt;p&gt;Paste your contract code into the &lt;a href="http://remix.ethereum.org" rel="noopener noreferrer"&gt;Remix IDE&lt;/a&gt; and deploy it from the Remix web app. Step by step instructions below:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set up a test account on your crypto wallet&lt;/strong&gt;, such as MetaMask. Make sure to select the Testnet of your choice from the Networks dropdown.&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%2Fawerukuaeq90dtuw6sxi.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%2Fawerukuaeq90dtuw6sxi.png" alt="MetaMask test account with Rinkeby network selected"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get ETH on Testnet from a &lt;a href="https://faucets.chain.link/rinkeby" rel="noopener noreferrer"&gt;faucet&lt;/a&gt;&lt;/strong&gt; by entering the address from your test account above. You will need this in the next step to pay the gas fee for deploying your contract.&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%2Fji7jf7kvqei9acdugx0p.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%2Fji7jf7kvqei9acdugx0p.png" alt="Chainlink Faucet with Rinkeby network and 0.1 ETH selected"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Load &lt;a href="http://remix.ethereum.org" rel="noopener noreferrer"&gt;Remix&lt;/a&gt;&lt;/strong&gt; with http rather than https to allow interaction with the wallet. Create a file in the &lt;code&gt;contracts&lt;/code&gt; folder and paste in your smart contract.&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%2Fki7ttlygex5i2jhqgpa8.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%2Fki7ttlygex5i2jhqgpa8.png" alt="Ballot contract file in Remix IDE"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Then compile the contract in the Compile tab.&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%2Fbcatmv7ytartlpilgxm4.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%2Fbcatmv7ytartlpilgxm4.png" alt="Compile Ballot contract in Remix"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: for more information on the Compiler configuration options, please read the &lt;a href="https://remix-ide.readthedocs.io/en/latest/compile.html" rel="noopener noreferrer"&gt;Remix documentation&lt;/a&gt;. The default configuration is fine for testing.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Then go to the Deploy tab when it's compiled. In the Deploy tab, use the Environment selector to select "Injected Web3." Confirm the correct Network, account and contract are selected.&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%2Fo209r8rvxnrdqcencolx.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%2Fo209r8rvxnrdqcencolx.png" alt="Deploy Ballot contract on Rinkeby Network in Remix"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: if your &lt;code&gt;constructor&lt;/code&gt; function requires any parameters, specify them in the input next to the "Deploy" button. For more on deploy configuration, see the &lt;a href="https://remix-ide.readthedocs.io/en/latest/run.html" rel="noopener noreferrer"&gt;Remix documentation&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Your wallet will confirm the transaction in a pop-up window, including a gas fee. You should still have plenty left for testing transactions.&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%2Fp39kyy26nmtiobokqn1q.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%2Fp39kyy26nmtiobokqn1q.png" alt="MetaMask transaction"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: if you load Remix with https, you may get this message "You are using an &lt;code&gt;https&lt;/code&gt; connection. Please switch to &lt;code&gt;http&lt;/code&gt; if you are using Remix against an &lt;code&gt;http Web3 provider&lt;/code&gt; or allow Mixed Content in your browser." This will prevent you from connecting to your wallet, so make sure to use "http" in the URL.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optionally deploy to mainnet in the same Deploy tab&lt;/strong&gt; by selecting "Ethereum Mainnet" from the MetaMask Network selector. This will also prompt the wallet to confirm the transaction, including a gas fee.&lt;/p&gt;

&lt;p&gt;Congrats, you've deployed your contract! Now you can interact with it on Etherscan (on &lt;a href="https://rinkeby.etherscan.io" rel="noopener noreferrer"&gt;Rinkeby&lt;/a&gt; or &lt;a href="https://etherscan.io" rel="noopener noreferrer"&gt;Mainnet&lt;/a&gt;) or in your very own Web3 app.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>solidity</category>
      <category>ethereum</category>
      <category>smartcontract</category>
    </item>
  </channel>
</rss>
