<?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: Mai Luong</title>
    <description>The latest articles on DEV Community by Mai Luong (@maithanhluong).</description>
    <link>https://dev.to/maithanhluong</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%2F364609%2F58c7ae12-6975-4160-8076-f7b9ad15d9cc.jpeg</url>
      <title>DEV Community: Mai Luong</title>
      <link>https://dev.to/maithanhluong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maithanhluong"/>
    <language>en</language>
    <item>
      <title>Merkle Metric to measure the reliability of blockchains for production use</title>
      <dc:creator>Mai Luong</dc:creator>
      <pubDate>Fri, 04 Dec 2020 10:32:09 +0000</pubDate>
      <link>https://dev.to/maithanhluong/merkle-metric-to-measure-the-reliability-of-blockchains-for-production-use-2kc6</link>
      <guid>https://dev.to/maithanhluong/merkle-metric-to-measure-the-reliability-of-blockchains-for-production-use-2kc6</guid>
      <description>&lt;p&gt;&lt;em&gt;Merkle Metric, a methodological approach to measuring the reliability of blockchains for production use.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.decentology.com/dappstarter" rel="noopener noreferrer"&gt;DappStarter&lt;/a&gt; is a blockchain-agnostic platform that generates customized, full-stack project source code for decentralized applications. In our quest to create the best and most accessible developer tooling for smart contracts creation, we often need to decide whether a blockchain warrants being added to the platform. &lt;/p&gt;

&lt;p&gt;While some metrics we use in our process are easy to quantify, such as the ease of use for developers, &lt;em&gt;one remarkably hard-to-pinpoint factor is that of trust.&lt;/em&gt; What we call the trustless nature of blockchain is the operational independence from any single authoritative actor, eliminating any single points of failure and allowing the network to operate in a permissionless fashion. One aspect of trust still remains, however, and it’s the users’ hope that the blockchain will keep operating in a predictable and reliable way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Introducing Merkle Metric, our answer to the problem of measuring production use reliability.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;“Can I trust this blockchain?” is one of the most overarching and essential questions for blockchain developers, companies looking to leverage blockchain technology, and lastly end-users. For any production use, an affirmative answer provides the necessary confidence that a decentralized application won’t encounter problems caused by the underlying technology. For the consumer, the question itself may never be asked, but what’s still there is the implicit expectation of being able to trust the network with their finances, the same way end users trust a smartphone app without being aware of the technology running in the background.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So what makes a blockchain trustworthy?&lt;/strong&gt; We’ve identified three main areas relevant to this question, each with a number of quantifiable factors:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Network resilience&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Economic resilience&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adoption&lt;/strong&gt;
‍&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Network resilience&lt;/strong&gt; refers to the trust put in the blockchain’s reliable functioning on the protocol-level. In most blockchains, trust in this category is generated on the basis of two factors: protocol openness and the decentralization of decision-making.&lt;/p&gt;

&lt;p&gt;Firstly, there’s no guarantee of a blockchain being truly permissionless and thus authority-independent unless the complete code is open-sourced and verifiable by the networks’ participants.&lt;/p&gt;

&lt;p&gt;Secondly, we need to look at the decentralization of decision-making processes. Namely, changes in decentralized blockchains can only happen through verifiers of the network expressing their views by directing the computational power (for proof-of-work algorithms) and stakes (for proof-of-stake). If one entity were able to single-handedly influence the protocol-level decisions (e.g., a double-spend attack for Ethereum), this would greatly endanger the network’s resilience and highly influence the Merkle Metric.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Economic resilience&lt;/strong&gt; is the economically-related stability of a blockchain. On the most basic level, we want to see whether money involved in the economy around a given blockchain makes it safer or potentially harms it. While a blockchain may be cryptographically sound, one shouldn’t forget that the markets both ensure and serve as a litmus test of how trustworthy a network is. Therefore, the economic resilience against price manipulation serves as the main metric in this area, with development-related metric, i.e., reasonable funding for the team to develop the blockchain, being of secondary importance. The more specific factors we use to measure economic resilience include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Percentage of the token supply in possession of the top 10 accounts (exchanges and some smart contracts excluded) in relation to the total supply&lt;/li&gt;
&lt;li&gt;Presence of mechanisms (or lack thereof) aimed at countering sideloading and/or other economically-harmful technical means&lt;/li&gt;
&lt;li&gt;Token supply-related characteristics that directly influence future financial resilience, such as inflation or the relation between tokens circulating and the maximum supply
‍&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Adoption&lt;/strong&gt; is the third and last area of interest in the Merkle Metric methodology and serves as the expression of trust in the network measured through developer and user engagement. The following are factored in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The blockchain has trustworthy partners and customers, shows production use by successful startups and mid-to-large companies, and is listed on high-quality exchanges&lt;/li&gt;
&lt;li&gt;An established developer ecosystem is present, i.e., the number of GitHub repositories and maintainers with active input is measured&lt;/li&gt;
&lt;li&gt;Conversations happen around the blockchain, i.e., there’s an active community (in any medium, e.g., forums, Discord, Telegram, Reddit, hackathons/meetups) and/or social media presence&lt;/li&gt;
&lt;li&gt;The blockchain is supported on &lt;a href="https://www.decentology.com/dappstarter" rel="noopener noreferrer"&gt;DappStarter&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Trust the Merkle Metric
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Developers and enterprises need to know which blockchain is trustworthy.&lt;/strong&gt; It is our belief that Merkle Metric can serve as a useful tool for anyone looking to get involved with blockchain technology. Our methodology isn’t limited to a single area where trust is involved, and instead takes a comprehensive look at all relevant areas, quantifies them, and presents them in an easy-to-consume and informative form.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;To see a detailed example of how the Merkle Metric is applied to evaluating the reliability of blockchains for decentralized application projects, check out the &lt;a href="https://bit.ly/3kNzVSb" rel="noopener noreferrer"&gt;Decentology Ethereum Report&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>programming</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Development tools: An analogy between Web 2.0 and Web 3.0</title>
      <dc:creator>Mai Luong</dc:creator>
      <pubDate>Tue, 27 Oct 2020 13:45:45 +0000</pubDate>
      <link>https://dev.to/maithanhluong/development-tools-an-analogy-between-web-2-0-and-web-3-0-1a6b</link>
      <guid>https://dev.to/maithanhluong/development-tools-an-analogy-between-web-2-0-and-web-3-0-1a6b</guid>
      <description>&lt;p&gt;If you're looking to get into blockchain development, there are a few tools you'll need to get started. We've drawn some analogies between the blockchain world and the rest of the web development world to make blockchain development easier to understand.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note: From the Ethereum Perspective&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;This blog is written from the perspective of a developer building on the &lt;a href="https://ethereum.org/en/" rel="noopener noreferrer"&gt;Ethereum&lt;/a&gt; blockchain.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At &lt;a href="https://www.decentology.com/" rel="noopener noreferrer"&gt;Decentology&lt;/a&gt;, we make blockchain development simple starting with &lt;a href="https://www.decentology.com/dappstarter" rel="noopener noreferrer"&gt;DappStarter&lt;/a&gt;, a blockchain-agnostic platform that generates customized, full-stack project source code for decentralized applications. But after you've generated a dapp with DappStarter, you'll need a few tools to get you started with blockchain development.&lt;/p&gt;

&lt;p&gt;In order to develop and build your decentralized application, the following software pre-requisites must be installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt; (or any IDE for editing Javascript)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en/download/" rel="noopener noreferrer"&gt;NodeJS v10.x&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/solc" rel="noopener noreferrer"&gt;Solidity v0.5.11&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.trufflesuite.com/truffle" rel="noopener noreferrer"&gt;Truffle v5.0.7&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.trufflesuite.com/ganache" rel="noopener noreferrer"&gt;Ganache v2.0.0&lt;/a&gt; (for Ethereum)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you haven’t, follow the instructions at the above links to get the software you need installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Solidity, Truffle, &amp;amp; Ganache&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;‍If you have a development background, you are likely familiar with Visual Studio Code and NodeJs. The last 3 items in the list above may have been new, so let’s briefly detail those. Solidity is the JavaScript-like language for coding smart contracts. Truffle is the most popular development framework for Ethereum and Ganache is a blockchain simulator for Ethereum that runs on your local machine. While this info accurately defines the software, it may be helpful to compare them with a context web 2.0 developers are already familiar with. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Web 2.0 to Web 3.0 - Mentally Connecting the Dots‍&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Let’s draw some rough parallels from a web 2.0 developer’s perspective… If you’ve ever used Apache, nginx, IIS, or GWS you can think of Ethereum, EOS,  Harmony, Neo, Stellar, and Hyperledger in the same context. They are similar to web servers that host specific platforms. Keep in mind that everything in web 3.0 is decentralized.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Languages&lt;/strong&gt;&lt;br&gt;
If you’ve developed with Typescript, Go, JavaScript, or C++ you can view Solidity, Vyper, and others from the same lens, they are languages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frameworks&lt;/strong&gt;&lt;br&gt;
If you’ve ever developed on Express, Django, Rails, Spring, or .NET then you can consider Truffle, Fabric, Quorum, Burrow, Sawtooth, Enterprise Ethereum as similar technologies, they are frameworks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The End Result&lt;/strong&gt;&lt;br&gt;
And at the end of the day, web 2.0 developers build web applications. You can view a web application as being similar to a Smart Contract, which is what web 3.0 developers build.&lt;/p&gt;

&lt;p&gt;Ultimately, web applications target specific web platforms. Developers code applications in languages that are supported by their chosen web platform. Said differently, a compiler or interpreter exists to transform code so it can run on the respective web platform. Developers use web frameworks to not have to do a lot of grunt-work. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Scenario‍&lt;/strong&gt;&lt;br&gt;
Let’s bring it all home with an example from the .NET world. Web 2.0 developers build web applications programming in C# for IIS using .NET. In contrast, web 3.0 developers build decentralized web applications programming in Solidity for Ethereum using Truffle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep Rocking Out!&lt;/strong&gt;&lt;br&gt;
We hope these analogies help you understand the blockchain development stack a little better. Once you’ve got all of these tools installed you’re ready to rock. And if you want to increase efficiency and reduce coding effort by 80%, try to build your dapp with Decentology &lt;a href="https://www.decentology.com/dappstarter" rel="noopener noreferrer"&gt;DappStarter&lt;/a&gt; in three steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the blockchain and features you want to implement in your dapp&lt;/li&gt;
&lt;li&gt;Download your full-stack custom source code for your blockchain app&lt;/li&gt;
&lt;li&gt;Customize the code and deploy!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>blockchain</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Best practices to avoid costly or irreversible mistakes in blockchain app development</title>
      <dc:creator>Mai Luong</dc:creator>
      <pubDate>Sat, 15 Aug 2020 15:56:10 +0000</pubDate>
      <link>https://dev.to/maithanhluong/best-practices-to-avoid-costly-or-irreversible-mistakes-in-blockchain-app-development-1lf6</link>
      <guid>https://dev.to/maithanhluong/best-practices-to-avoid-costly-or-irreversible-mistakes-in-blockchain-app-development-1lf6</guid>
      <description>&lt;p&gt;Blockchain app development can be tricky. We've put together 5 tips and best practices to avoid costly or irreversible mistakes when it comes to blockchain development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcghgddqrqtv6elehsxj2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcghgddqrqtv6elehsxj2.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Item Collections
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do:&lt;/strong&gt; Have the client call the smart contract function for each item&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't:&lt;/strong&gt; Loop through each item in your smart contract function&lt;/p&gt;

&lt;p&gt;Every line of code executed on a smart contract costs money! To save money and improve efficiency, have the client call the smart contract function for each item, rather than looping through each item in your smart contract.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft1ysp8w9i4dhwqaxv5a7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft1ysp8w9i4dhwqaxv5a7.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Transferring Funds
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do:&lt;/strong&gt; Have the user "pull" funds&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't:&lt;/strong&gt; Send funds to the user by using "push"&lt;/p&gt;

&lt;p&gt;Transferring funds can be a high-stakes process. Having the user pull funds, rather than pushing funds to the user can avoid mistakes and immutable errors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0ca87a8u47wxkljukq8t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0ca87a8u47wxkljukq8t.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Reducing Gas Fees
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do:&lt;/strong&gt; Validate all inputs before using them in code&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't:&lt;/strong&gt; Intersperse input validation within code&lt;/p&gt;

&lt;p&gt;Again, smart contract execution is costly. Be sure to validate all inputs before using them in code to avoid expensive errors before it's too late.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwp4rp42gtl2oy5he8i0l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwp4rp42gtl2oy5he8i0l.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Arithmetic Errors
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do:&lt;/strong&gt; Use a library that checks for numeric overflow/underflow&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't:&lt;/strong&gt; Perform arithmetic in smart contracts without bounds-checking&lt;/p&gt;

&lt;p&gt;Arithmetic errors are never good, but in smart contracts ‒ they're irreversible. Use a library that checks for numeric overflow/underflow to ensure arithmetic errors don't become an expensive headache.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flf30ovlbwn3z91qs39ie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flf30ovlbwn3z91qs39ie.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Minimizing On-chain Data
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do:&lt;/strong&gt; Hash data on-chain and store actual values off-chain&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't:&lt;/strong&gt; Store large amounts of data on-chain&lt;/p&gt;

&lt;p&gt;Storing data on-chain is incredibly expensive. Using a decentralized storage solution such as IPFS or Sia is a best-practice to maintain the decentralized nature of an app without racking up cost.&lt;/p&gt;

&lt;h1&gt;
  
  
  6. (Extra tip!) Using Great Tools
&lt;/h1&gt;

&lt;p&gt;Blockchain app development can be confusing, using great tools can make it easier. These best practices (and more!) are built into &lt;a href="https://www.decentology.com/dappstarter" rel="noopener noreferrer"&gt;DappStarter&lt;/a&gt;, &lt;a href="https://www.decentology.com/" rel="noopener noreferrer"&gt;Decentology&lt;/a&gt;'s full-stack blockchain application generator.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;More best practices for blockchain app development (3 part series):&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/smart-contract-dos-and-donts" rel="noopener noreferrer"&gt;Smart Contract Best Practices&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/blockchain-app-ux-best-practices" rel="noopener noreferrer"&gt;Blockchain App UX Best Practices&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/5-tips-for-blockchain-app-development" rel="noopener noreferrer"&gt;Tips to Avoid Costly Mistakes in Blockchain App Development&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>blockchain</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Best Practices in Blockchain App UX Design</title>
      <dc:creator>Mai Luong</dc:creator>
      <pubDate>Mon, 03 Aug 2020 12:39:54 +0000</pubDate>
      <link>https://dev.to/maithanhluong/best-practices-in-blockchain-app-ux-design-3dk0</link>
      <guid>https://dev.to/maithanhluong/best-practices-in-blockchain-app-ux-design-3dk0</guid>
      <description>&lt;p&gt;Communication, communication, communication. Blockchain introduces new challenges that can either make users feel empowered and educated or defeated and alienated. The difference between empowerment and defeat can be boiled down to two main factors: communicating with users and hiding unnecessary blockchain jargon. We've compiled a list of best practices to help craft great user experiences to leave users feeling educated and empowered.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftzk9tszujpvwkluqszhq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftzk9tszujpvwkluqszhq.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Don't make users pay transaction fees
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Have the app pay gas fees for transactions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not only are gas fees difficult for users to understand, but paying for transactions also requires users to have cryptocurrency such as ETH, which is not realistic for most mainstream users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Clutter the UI with gas fee-related warts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In most applications, gas fees should be tucked away, but still accessible. An example of this might be providing gas fee-related information under an "Advanced" tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F01y9x7j5yqgo079swbky.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F01y9x7j5yqgo079swbky.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Set user expectations
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Set user expectations that their transaction could fail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On a blockchain, transactions can be valid and allowed, but still fail. Setting expectations and communicating to users that their desired action is "Being Submitted" rather than "Successful" is an important distinction that can hep avoid frustration in the case that the transaction does fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Assume that every submitted transaction will complete&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Assuming every transaction will complete can lead to frustration. No one likes to be told "Success!" just to be told "Failed" moments later. Communicate accurately and don't assume that every transaction is going to be a success.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2tskq0xx7jdym6myeev5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2tskq0xx7jdym6myeev5.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Simplify the UI
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Make the interface super simple&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For applications targeting mainstream users, try to keep new controls, information, and options to a minimum. Oftentimes blockchain applications will include information that, while technical can be provided, is absolutely unnecessary. Unnecessary information in blockchain can alienate users and make them feel uncomfortable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Make the user think about how to use the interface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create intuitive applications that model existing paradigms that users are already accustomed to. Just because you can include the Ethereum address of a user doesn't mean you should! New is good, but consider introducing only one or two new elements ‒ too many can create confusion and frustration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgh61z3plw9pyq2tishc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgh61z3plw9pyq2tishc6.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Show clear transaction results
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Provide a clear interface for reporting transaction results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;People want to feel informed. Providing a clear interface where users can see the progress of a transaction helps ease the mind and make the user feel comfortable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Intersperse transaction results where the user might miss them&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hiding transaction results or placing them in unsuspecting parts of the UI not only feels frustrating, it also introduces a level of ambiguity that is particularly frustrating, given that transactions are immutable. When there's no "Undo" button, the stakes for knowing the progress of a given transaction are much higher ‒ make it easy for users to find the details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F76aus52c5hr0zf7vbsjc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F76aus52c5hr0zf7vbsjc.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Warn users about context changes
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Warn the user if the app context or account has changed&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Context changes can be difficult to communicate, especially when so much happens on the client-side with blockchain apps. Make sure that you have alerts and other ways of communicating to users when the context changes. Again, this goes back to keeping the user informed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Continue a workflow if the app context or account changes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Navigating blockchain can be difficult in-and-of itself. Communicate context changes and make sure to confirm that users want to continue with a given workflow in the instance of a context or account change.&lt;/p&gt;




&lt;p&gt;Blockchain can be confusing for mainstream users. Following best practices to simplify the user experience boils down to effective communication with users and hiding unnecessary blockchain jargon.&lt;/p&gt;

&lt;p&gt;‍&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Blockchain app development can be confusing, using great tools can make it easier. These best practices (and more!) are built into &lt;a href="https://www.decentology.com/dappstarter" rel="noopener noreferrer"&gt;DappStarter&lt;/a&gt;, &lt;a href="https://www.decentology.com/" rel="noopener noreferrer"&gt;Decentology&lt;/a&gt;'s full-stack blockchain application generator.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;More best practices for blockchain app development (3 part series):&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/smart-contract-dos-and-donts" rel="noopener noreferrer"&gt;Smart Contract Best Practices&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/blockchain-app-ux-best-practices" rel="noopener noreferrer"&gt;Blockchain App UX Best Practices&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/5-tips-for-blockchain-app-development" rel="noopener noreferrer"&gt;Tips to Avoid Costly Mistakes in Blockchain App Development&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

</description>
      <category>blockchain</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Best Practices in Blockchain Smart Contract Development</title>
      <dc:creator>Mai Luong</dc:creator>
      <pubDate>Thu, 23 Jul 2020 13:39:11 +0000</pubDate>
      <link>https://dev.to/maithanhluong/best-practices-for-blockchain-smart-contract-development-43ki</link>
      <guid>https://dev.to/maithanhluong/best-practices-for-blockchain-smart-contract-development-43ki</guid>
      <description>&lt;p&gt;Smart contracts can be intimidating. Whether you're just getting into the world of blockchain or you're a seasoned blockchain app developer, these 5 principles cover some basic Do's and Don'ts of smart contract development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcfzql75zg1pdytfeliir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcfzql75zg1pdytfeliir.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Add Circuit Breakers
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Add a circuit breaker to your smart contract&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Smart contracts can't be changed after deployment. Always include a circuit breaker in your contract to reduce unnecessary (and expensive) bugs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Let contracts run without oversight&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Allowing contracts to run without oversight is high-risk because contracts are irreversible and immutable (and discovering a vulnerability after deployment can be risky and expensive).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgumpqhr228a3hr2vbtg3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgumpqhr228a3hr2vbtg3.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Encrypt Data
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Encrypt all sensitive data in contract storage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data on public blockchains can be read by anybody, so encrypting sensitive data is an absolute must to preserve security and privacy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Assume private variables will hide your data (they won’t)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Private variables within a smart contract are not actually private. "Private" means within the execution scope of the contract, but the data is public and can be read by anyone.&lt;br&gt;
‍&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn7oyyohqquiw6uv2skfo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn7oyyohqquiw6uv2skfo.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Add Limits
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Enforce per transaction and rate limits&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Smart contracts are immutable and bugs or errors can have significant unintended consequences. Enforcing rate limits helps mitigate risk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Permit uncontrolled loops, transfers and rates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Uncontrolled loops, transfers, and rates increase risk and potential for damage, including unintentionally depleting funds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp5v1pgro21ac5okqh9cf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fp5v1pgro21ac5okqh9cf.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Check Inputs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Check all inputs before using them in code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because smart contracts are immutable, fixing errors is incredibly expensive and checking inputs before using them in code mitigates errors. “Fail Fast” is a good tenet for your code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Make any assumptions about input values&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Making assumptions can leave room for errors and cause smart contracts to execute code in a way that was not initially intended.&lt;/p&gt;

&lt;p&gt;‍&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fml081lzeqqy5eh36mva8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fml081lzeqqy5eh36mva8.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Minimize On-chain Data
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Do ‒ Keep smart contracts small and modular&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every line of code in a smart contract costs money to execute and storing data is incredibly expensive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't ‒ Store unnecessary data on-chain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A best practice is to store a pointer to data in a smart contract, rather than storing the data itself. For example, data can be stored using decentralized data storage providers such as Sia or IPFS.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Smart contract development can be confusing, using great tools can make it easier. These best practices (and more!) are built into &lt;a href="https://www.decentology.com/dappstarter" rel="noopener noreferrer"&gt;DappStarter&lt;/a&gt;, &lt;a href="https://www.decentology.com/" rel="noopener noreferrer"&gt;Decentology&lt;/a&gt;'s full-stack blockchain application generator.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;More best practices for blockchain app development (3 part series):&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/smart-contract-dos-and-donts" rel="noopener noreferrer"&gt;Smart Contract Best Practices&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/blockchain-app-ux-best-practices" rel="noopener noreferrer"&gt;Blockchain App UX Best Practices&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.decentology.com/guides-and-tutorials/5-tips-for-blockchain-app-development" rel="noopener noreferrer"&gt;Tips to Avoid Costly Mistakes in Blockchain App Development&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

</description>
      <category>blockchain</category>
      <category>javascript</category>
      <category>codequality</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Block COVID global virtual innovation camp with blockchain and tech experts</title>
      <dc:creator>Mai Luong</dc:creator>
      <pubDate>Sat, 11 Apr 2020 09:14:19 +0000</pubDate>
      <link>https://dev.to/maithanhluong/block-covid-global-virtual-innovation-camp-with-blockchain-and-tech-experts-5f6j</link>
      <guid>https://dev.to/maithanhluong/block-covid-global-virtual-innovation-camp-with-blockchain-and-tech-experts-5f6j</guid>
      <description>&lt;p&gt;The dramatic spread of the COVID-19 pandemic has disrupted lives, communities and businesses worldwide. If you wondered what you could do to help, consider joining the &lt;a href="https://www.blockcovid.org/" rel="noopener noreferrer"&gt;Block COVID&lt;/a&gt; global virtual innovation camp where you could contribute ideas and work on innovative solutions that solve problems for “the new normal”, while learning from thought leaders in blockchain and across diverse industries. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Block COVID is a month-long virtual open innovation camp to activate anyone anywhere to build COVID-19 solutions on the blockchain and more. By providing a collaboration platform, mentorship, subject-matter expertise, and technical support, the program aims to inspire and catalyze implementable products to address societal challenges arising from the COVID-19 pandemic by the end of the month.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Organized by &lt;a href="https://trycrypto.com/" rel="noopener noreferrer"&gt;TryCrypto&lt;/a&gt; and &lt;a href="https://www.globalshapers.org/hubs/san-francisco-hub" rel="noopener noreferrer"&gt;WEF Global Shapers&lt;/a&gt;, the innovation camp will be joined by some of the best and brightest in the technology, design, and social impact community. Leading blockchain projects such as  &lt;a href="https://www.trufflesuite.com/" rel="noopener noreferrer"&gt;Truffle&lt;/a&gt; and &lt;a href="https://sia.tech/" rel="noopener noreferrer"&gt;Sia&lt;/a&gt; will also be part of the program.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PpxbS5le--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://pbs.twimg.com/media/EVFmYvsU8AEuQxH%3Fformat%3Dpng%26name%3D900x900" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PpxbS5le--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://pbs.twimg.com/media/EVFmYvsU8AEuQxH%3Fformat%3Dpng%26name%3D900x900" alt="Alt text of image" width="800" height="760"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Block COVID will provide an opportunity for participants to:&lt;/p&gt;

&lt;p&gt;•   Learn new tools to ideate, design, build, and implement innovative solutions, such as creating service design frameworks and shipping blockchain applications&lt;/p&gt;

&lt;p&gt;•   Hear from thought leaders across diverse industries and put their top tips into practice&lt;/p&gt;

&lt;p&gt;•   Connect with other developers, designers, entrepreneurs, students, industry experts, and more!&lt;/p&gt;

&lt;p&gt;•   Make a difference in the world!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Details:&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://blockcovid.org" rel="noopener noreferrer"&gt;https://blockcovid.org&lt;/a&gt;&lt;br&gt;
Join the &lt;a href="https://join.slack.com/t/blockcovid/shared_invite/zt-d66uozjr-xQ_bWSy2Up4vfacaRhmS_w" rel="noopener noreferrer"&gt;Block COVID Slack channel&lt;/a&gt; to connect with other participants and stay updated with the program. &lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>programming</category>
      <category>techtalks</category>
      <category>news</category>
    </item>
  </channel>
</rss>
