<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[noop’s Newsletter]]></title><description><![CDATA[noop's journey through blockchain technology]]></description><link>https://www.noopmood.com</link><image><url>https://substackcdn.com/image/fetch/$s_!1ArP!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9402cd55-0c22-4615-9a4b-2e52fae7128a_649x649.png</url><title>noop’s Newsletter</title><link>https://www.noopmood.com</link></image><generator>Substack</generator><lastBuildDate>Sun, 17 May 2026 04:29:13 GMT</lastBuildDate><atom:link href="https://www.noopmood.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[noop]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[noopmood@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[noopmood@substack.com]]></itunes:email><itunes:name><![CDATA[noop]]></itunes:name></itunes:owner><itunes:author><![CDATA[noop]]></itunes:author><googleplay:owner><![CDATA[noopmood@substack.com]]></googleplay:owner><googleplay:email><![CDATA[noopmood@substack.com]]></googleplay:email><googleplay:author><![CDATA[noop]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Exploring the possibilities of a DeFi credit platform]]></title><description><![CDATA[The world is built on credit. How about Web3?]]></description><link>https://www.noopmood.com/p/exploring-the-possibilities-of-a</link><guid isPermaLink="false">https://www.noopmood.com/p/exploring-the-possibilities-of-a</guid><dc:creator><![CDATA[noop]]></dc:creator><pubDate>Sun, 04 Feb 2024 23:05:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_1W3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_1W3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_1W3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_1W3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_1W3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_1W3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_1W3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg" width="894" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:894,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:38785,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_1W3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_1W3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_1W3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_1W3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56cf584-225f-4546-8ec9-b0342796fdff_894x480.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">&#8220;Don't worry. You've got Daddy here. He's got credit cards and cash.&#8221;</figcaption></figure></div><p>Credit makes the world go &#8216;round. For most individuals, financing major expenses like a home or car is a necessity, and credit cards are used over cash due to their reward programs, financial protections, and the opportunity to build credit lines.</p><p>However, in the crypto space, there is yet to be a comprehensive credit system. Current decentralized lending offerings are often too simple&#8212;once a user&#8217;s assets dip below a threshold, their collateral is immediately liquidated. This is equivalent to a bank instantly foreclosing your house when the stock market dips or there is a late mortgage payment. Though there have been <a href="https://medium.com/@sigrunsephia/redefining-defi-borrowing-thestandard-ios-0-interest-loans-and-collateral-management-tools-46068459d7d6">improvements</a> with user and collateral management and protection, decentralized lending is still largely unforgiving.</p><p>As for credit cards, existing crypto credit cards are tethered to traditional banking systems and do not solely operate off-chain. At most, they provide <a href="https://help.coinbase.com/en/coinbase/trading-and-funding/coinbase-card/cb-card-rewards">points and rewards via tokens</a>. Currently, airdrops and whitelists, usually managed by individual projects, serve as the primary means of rewarding on-chain transactions. There isn&#8217;t a dedicated system to track points and build credit on-chain, despite the number of crypto users worldwide surging to 420 million in 2023, with 54 million in the US <a href="https://www.imf.org/-/media/Files/Publications/WP/2023/English/wpiea2023144-print-pdf.ashx">as reported by IMF</a>. In addition, countries like Venezuela are experiencing widespread adoption of crypto for both salaries and everyday transactions.</p><p><em><strong>What if we could establish an DeFi credit system that offers smart contract-backed credit cards for borrowing funds and earning rewards, akin to traditional credit cards?</strong></em> </p><p>By operating on the blockchain, this system would not only provide rewards for on-chain transactions, but also enhance credit scoring. Unlike traditional credit score formulas and criteria, an on-chain score calculation increases transparency. Moreover, while traditional credit scoring systems lack global standardization (e.g. FICO in the US, CIBIL in India, etc.), the blockchain operates on a global scale, allowing for a universal credit system.</p><div><hr></div><p>The basic workflow of the on-chain credit platform can look like the following:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bO9Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bO9Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png 424w, https://substackcdn.com/image/fetch/$s_!bO9Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png 848w, https://substackcdn.com/image/fetch/$s_!bO9Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png 1272w, https://substackcdn.com/image/fetch/$s_!bO9Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bO9Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png" width="721" height="214" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:214,&quot;width&quot;:721,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41307,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bO9Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png 424w, https://substackcdn.com/image/fetch/$s_!bO9Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png 848w, https://substackcdn.com/image/fetch/$s_!bO9Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png 1272w, https://substackcdn.com/image/fetch/$s_!bO9Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8961db-0fc3-4388-9078-f5bf72c77684_721x214.png 1456w" sizes="100vw"></picture><div></div></div></a><figcaption class="image-caption">Fig. 1: Basic workflow of the on-chain credit platform</figcaption></figure></div><p>Here, the DeFi credit platform has its own token pool, which can have a variety of tokens such as USDC for better hedging. Like a classic DeFi protocol, customers (Fig. 1: User 1) can stake their tokens in the token pool to receive interest payments. The DeFi credit platform can provide interest payments by performing on-chain and off-chain investments.</p><p>On top of this, the DeFi credit platform will provide an on-chain credit card. Customers (Fig. 1: User 2) can borrow money and make payments with the on-chain credit card, along with interest payments if the user cannot pay their full  outstanding balance. Here, <em>all</em> the components of the credit card borrowing solely exists on-chain.</p><p>Users can build an on-chain credit score through borrowing or staking history, and establish custom credit limits, interest rates, and late payment rules.</p><p></p><p>Of course, it wouldn&#8217;t be a true credit card without a solid rewards system. A potential rewards system, perhaps with Aave, may look like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zlz8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zlz8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png 424w, https://substackcdn.com/image/fetch/$s_!zlz8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png 848w, https://substackcdn.com/image/fetch/$s_!zlz8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png 1272w, https://substackcdn.com/image/fetch/$s_!zlz8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zlz8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png" width="532" height="284" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:284,&quot;width&quot;:532,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:31902,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zlz8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png 424w, https://substackcdn.com/image/fetch/$s_!zlz8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png 848w, https://substackcdn.com/image/fetch/$s_!zlz8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png 1272w, https://substackcdn.com/image/fetch/$s_!zlz8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf12dd20-c28c-4ec6-9f09-3ce13c890592_532x284.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Fig. 2: Potential credit rewards system with Aave</figcaption></figure></div><p>Here, Aave contributes significantly to the token pool through staking, allowing the DeFi credit platform to invest in diverse projects across blockchain and traditional domains. To benefit Aave as well, the DeFi credit platform will allow users who interact with Aave through the credit card to gain heightened yields. Aave in turn gains customer expansion and passive interest earnings from the token pool.</p><p>Another potential rewards system can be with Yuga Labs:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!J05X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!J05X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png 424w, https://substackcdn.com/image/fetch/$s_!J05X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png 848w, https://substackcdn.com/image/fetch/$s_!J05X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png 1272w, https://substackcdn.com/image/fetch/$s_!J05X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!J05X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png" width="543" height="308" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2898b37c-b500-446d-8e84-fa5857340ace_543x308.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:308,&quot;width&quot;:543,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:172848,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!J05X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png 424w, https://substackcdn.com/image/fetch/$s_!J05X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png 848w, https://substackcdn.com/image/fetch/$s_!J05X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png 1272w, https://substackcdn.com/image/fetch/$s_!J05X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2898b37c-b500-446d-8e84-fa5857340ace_543x308.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Fig. 3: Potential credit rewards system with Yuga Labs</figcaption></figure></div><p>In this scenario, by taking a percentage of the credit card fees, Yuga Labs will send airdrops to customers that purchased a Yuga Lab NFT with the on-chain credit card. In return, the DeFi credit platform will see increased usage and adoption of credit cards.</p><div><hr></div><p>To measure how feasible this is, I&#8217;ve implemented a small proof of concept for the DeFi credit platform and the credit card. In this implementation, we utilize the ERC20 <code>approve</code> function, which allows a user to spend a specified amount of the caller&#8217;s tokens. For our use case, the credit platform will call <code>approve</code> for a credit card user to spend up to their credit limit.</p><pre><code>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract CreditPlatform is ERC20, Ownable {
    uint256 public constant DEFAULT_CREDIT_LIMIT = 1000;
    uint256 public constant DEFAULT_CREDIT_SCORE = 400;

    mapping(address =&gt; uint256) public creditLimits;
    mapping(address =&gt; uint256) public creditScores;

    constructor(string memory name, string memory symbol, uint256 supply) ERC20(name, symbol) Ownable(msg.sender) {
        _mint(msg.sender, supply);
    }

    function addCreditWallet(address creditWalletAddr) external onlyOwner {
        setCreditLimit(creditWalletAddr, DEFAULT_CREDIT_LIMIT);
        setCreditScore(creditWalletAddr, DEFAULT_CREDIT_SCORE);
        approve(creditWalletAddr, DEFAULT_CREDIT_LIMIT);
    }

    function setCreditLimit(address user, uint256 limit) public onlyOwner {
        creditLimits[user] = limit;
    }

    function creditLimit(address user) public view returns (uint256) {
        return creditLimits[user];
    }

    function setCreditScore(address user, uint256 limit) public {
        creditScores[user] = limit;
    }

    function creditScore(address user) public view returns (uint256) {
        return creditScores[user];
    }

    function approve(address user, uint256 value) public override onlyOwner returns (bool) {
        require(value &lt;= creditLimits[user], "Allowance exceeds the credit limit for user");
        return super.approve(user, value);
    }
}

contract CreditCard is AccessControl {
    CreditPlatform public creditPlatform;

    bytes32 public constant AUTHORIZED_USER_ROLE = keccak256("AUTHORIZED_USER_ROLE");

    address private creditPlatformAdmin;
    uint256 private _balance;
    uint256 private _point;

    constructor(address creditPlatformAddr, address user) {
        creditPlatform = CreditPlatform(creditPlatformAddr);
        creditPlatformAdmin = msg.sender;

        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(AUTHORIZED_USER_ROLE, user);
        _grantRole(AUTHORIZED_USER_ROLE, msg.sender);
    }

    function balance() public view onlyRole(AUTHORIZED_USER_ROLE) returns (uint256) {
        return _balance;
    }

    function point() public view onlyRole(AUTHORIZED_USER_ROLE) returns (uint256) {
        return _point;
    }

    function setBalance(uint256 newBalance) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _balance = newBalance;
    }

    function setPoint(uint256 newPoint) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _point = newPoint;
    }

    function transfer(address to, uint256 value) external onlyRole(AUTHORIZED_USER_ROLE) {
        creditPlatform.transferFrom(creditPlatformAdmin, to, value);
        creditPlatform.setCreditScore(address(this), creditPlatform.creditScore(address(this)) - 100);
        _setBalance(_balance + value);
    }

    function payBalance(uint256 value) external onlyRole(AUTHORIZED_USER_ROLE) {
        creditPlatform.transfer(creditPlatformAdmin, value);
        creditPlatform.setCreditScore(address(this), creditPlatform.creditScore(address(this)) + 100);
        _setBalance(_balance - value);
    }

    function _setBalance(uint256 newBalance) internal virtual onlyRole(AUTHORIZED_USER_ROLE) {
        _balance = newBalance;
    }
}</code></pre><p>The smart contract workflow will look like the following:</p><ol><li><p>With the <code>CreditPlatform</code> admin wallet, deploy the <code>CreditPlatform</code> contract.</p></li><li><p>With the <code>CreditPlatform</code> admin wallet, deploy the <code>CreditCard</code> contract, and pass in the address of the credit card&#8217;s authorized user.</p></li><li><p>To borrow funds, the credit card user will call the <code>CreditCard</code> contract&#8217;s <code>transfer</code> function.</p></li><li><p>To payback the balance, the credit card user will first send funds to the <code>CreditCard</code> contract, and then call the <code>CreditCard</code> contract&#8217;s <code>payBalance</code> function. The code can be changed so that the credit card user can directly pay the balance with his/her address.</p></li></ol><p>Such a DeFi credit platform seems quite feasible!</p><div><hr></div><p>As a parting thought, I&#8217;ve outlined a few potentials of the DeFi credit platform below&#8212;personally, I&#8217;m excited about the prospect of using such a product:</p><ul><li><p>The DeFi credit platform&#8217;s success will largely rely on the backing institution. If established institutions such as Amazon or JP Morgan created a DeFi credit platform, it could usher a new era of crypto utilization.</p><ul><li><p>If an established institution backed the DeFi credit platform, an implicit KYC can be formed with the credit card.</p></li></ul></li><li><p>On-chain credit scoring systems can expand to off-chain borrowing, which is especially useful for immigrants and travelers.</p></li><li><p>Customer can select credit cards and lenders based on its credit score calculation, as the formula is on-chain</p></li><li><p>Establishing tier-based on-chain credit cards (similar to Amex Platinum card vs Amex Blue Cash Everyday card) can provide further benefits</p></li><li><p>Confidentiality of transactions and credit scores may be achieved with ZK proofs or technologies such as <a href="https://dusk.network/technology">Dusk</a></p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.noopmood.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading noop&#8217;s Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Proxy Contracts: Creating mutable services on an immutable platform]]></title><description><![CDATA[Upgrade and structure your service using proxy contracts]]></description><link>https://www.noopmood.com/p/proxy-contracts-creating-mutable</link><guid isPermaLink="false">https://www.noopmood.com/p/proxy-contracts-creating-mutable</guid><dc:creator><![CDATA[noop]]></dc:creator><pubDate>Mon, 24 Jul 2023 02:28:23 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5dfd6743-c69b-4f78-ad33-f46067fb0293_580x456.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!frIx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!frIx!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif 424w, https://substackcdn.com/image/fetch/$s_!frIx!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif 848w, https://substackcdn.com/image/fetch/$s_!frIx!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif 1272w, https://substackcdn.com/image/fetch/$s_!frIx!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!frIx!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif" width="540" height="280" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:280,&quot;width&quot;:540,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:5362437,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!frIx!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif 424w, https://substackcdn.com/image/fetch/$s_!frIx!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif 848w, https://substackcdn.com/image/fetch/$s_!frIx!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif 1272w, https://substackcdn.com/image/fetch/$s_!frIx!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76efdda7-6254-4b9b-9ef8-4acbbb4e7c44_540x280.gif 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Create a one-stop portal for your customers</figcaption></figure></div><p>In the blockchain world where &#8220;code is law,&#8221; irreversible losses can easily occur with smart contract exploits. At the same time, code on the blockchain is immutable. So what do you do?</p><p>Auditing contracts can provide high confidence, but if you want to change code logic in the future, consider creating a proxy contract.</p><h3>What are proxy contracts?</h3><p>Proxy contracts are contracts that reroute calls to other contracts. Similar to an API gateway, a proxy contract can serve as a single endpoint for callers and redirect calls to other resources. As shown in the diagram below, the proxy contract can forward calls to logic (aka implementation) contracts, contracts that contain the logic of the service.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zdU7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zdU7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png 424w, https://substackcdn.com/image/fetch/$s_!zdU7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png 848w, https://substackcdn.com/image/fetch/$s_!zdU7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png 1272w, https://substackcdn.com/image/fetch/$s_!zdU7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zdU7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png" width="694" height="137.3253652058433" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:149,&quot;width&quot;:753,&quot;resizeWidth&quot;:694,&quot;bytes&quot;:21745,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zdU7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png 424w, https://substackcdn.com/image/fetch/$s_!zdU7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png 848w, https://substackcdn.com/image/fetch/$s_!zdU7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png 1272w, https://substackcdn.com/image/fetch/$s_!zdU7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe09fa402-11f4-4261-be79-d4dfbc57446e_753x149.png 1456w" sizes="100vw"></picture><div></div></div></a><figcaption class="image-caption">A request is made to the proxy contract, which is then rerouted to the logic contract</figcaption></figure></div><p>If a bug is found or a feature upgrade is needed in the logic contract, the smart contract owner can simply deploy a new logic contract and submit a transaction to the proxy contract to update its logic contract address. By doing so, the proxy contract will start rerouting calls to the new logic contract, thereby &#8220;upgrading&#8221; the service.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!c3gP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!c3gP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png 424w, https://substackcdn.com/image/fetch/$s_!c3gP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png 848w, https://substackcdn.com/image/fetch/$s_!c3gP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png 1272w, https://substackcdn.com/image/fetch/$s_!c3gP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!c3gP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png" width="694" height="250.6879150066401" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:272,&quot;width&quot;:753,&quot;resizeWidth&quot;:694,&quot;bytes&quot;:32008,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!c3gP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png 424w, https://substackcdn.com/image/fetch/$s_!c3gP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png 848w, https://substackcdn.com/image/fetch/$s_!c3gP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png 1272w, https://substackcdn.com/image/fetch/$s_!c3gP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8161b53d-f955-4416-9f19-b012f6d24acb_753x272.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The proxy contract reroutes calls to logic contract v2 and no longer reroutes to v1</figcaption></figure></div><h3>I&#8217;m interested&#8230; how do proxy contracts work?</h3><p>At a low level, proxy contracts reroute data by using the EVM&#8217;s <code>delegatecall</code> opcode, which allows a contract to execute code of another contract. Here, it is important to note that <code>delegatecall</code> executes the callee&#8217;s code in the context of the caller&#8217;s state. This information makes upgrades possible, since the proxy contract maintains the service data (aka state). Therefore if our service is an NFT collection, the token balances and URIs will be stored in the proxy contract, while the logic on how to mint and transfer tokens will be stored in the logic contract. Upgrading the service may change who can mint tokens, but the token balances will remain the same since the proxy contract remains constant.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SCXb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SCXb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png 424w, https://substackcdn.com/image/fetch/$s_!SCXb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png 848w, https://substackcdn.com/image/fetch/$s_!SCXb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png 1272w, https://substackcdn.com/image/fetch/$s_!SCXb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SCXb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png" width="823" height="272" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:272,&quot;width&quot;:823,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36025,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SCXb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png 424w, https://substackcdn.com/image/fetch/$s_!SCXb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png 848w, https://substackcdn.com/image/fetch/$s_!SCXb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png 1272w, https://substackcdn.com/image/fetch/$s_!SCXb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff39dd820-a564-4c0e-a1c8-921c412e3690_823x272.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Proxy contracts maintain state, which allows the service to be upgraded</figcaption></figure></div><p>Though writing everything in the proxy&#8217;s data prevents data loss during upgrades, we now have to worry about the logic contract overwriting existing proxy contract data. The proxy contract maintains important data such as the logic contract address, and so it is crucial that the logic contract does not write token metadata in the same data storage slot. The most common and simplest way to solve this is through the &#8220;Unstructured Storage&#8221; proxy pattern, where a random storage slot is chosen for variables in a proxy contract. This slot is sufficiently random so the probability of a logic contract declaring a variable at the same slot is negligible. An Ethereum standard for this exists as <a href="https://eips.ethereum.org/EIPS/eip-1967">EIP-1967: Standard Proxy Storage Slots</a>, and OpenZeppelin provides <a href="https://docs.openzeppelin.com/contracts/4.x/api/proxy">implementation</a> for this standard.</p><h3>Got it! What are the different types of proxies I can use?</h3><p>The two main proxy patterns to look at are the UUPS proxy pattern and beacon proxy pattern. OpenZeppelin implementations for both <a href="https://docs.openzeppelin.com/contracts/4.x/api/proxy">exist</a>. In essence, both proxy contracts re-route calls to logic contracts. However, they each have its own merits:</p><ul><li><p><strong>UUPS (Universal Upgradeable Proxy Standard) proxy pattern</strong></p><ul><li><p>A UUPS proxy inherits the logic contract address location, and holds the upgrade logic in the logic contract.</p></li><li><p>The UUPS proxy was created as an improvement to the transparent proxy, which holds the upgrade logic in the proxy contract. This makes UUPS proxies cheaper than transparent proxies to deploy and send transactions with.</p></li><li><p>Since the upgrade logic exists in the logic contract, the service has the option to freeze logic changes by removing the upgrade logic in the final logic contract version.</p></li></ul></li><li><p><strong>Beacon proxy pattern</strong></p><ul><li><p>In the beacon proxy pattern, three main components exist: the beacon contract, beacon proxy contract, and logic contract(s). The beacon contract holds the address of the logic contract, and the beacon proxy contract retrieves the address from the beacon contract to reroute calls to. While this may seen redundant at first, if more than one beacon proxy points to a single beacon, batch proxy upgrades can happen by updating the logic contract address stored in the beacon.</p></li><li><p>For <em>n</em> NFT collections spread across <em>k</em> beacon contracts, only a total of <em>k</em> blockchain calls need to be made for an upgrade.</p></li></ul></li></ul><p>The gas costs of the different types of proxies are nicely summarized <a href="https://github.com/frangio/cacheable-beacon-proxy#comparison">here</a>.</p><h3>Great, how do I implement my proxy?</h3><p>OpenZeppelin provides <a href="https://docs.openzeppelin.com/upgrades-plugins/1.x/hardhat-upgrades">Upgrades Hardhat plugins</a> for proxy contract implementation. The step-by-step tutorial for Hardhat can be found in <a href="https://forum.openzeppelin.com/t/uups-proxies-tutorial-solidity-javascript/7786">this post</a>.</p><p>Alternatively, using the <a href="https://docs.openzeppelin.com/contracts/4.x/api/proxy">OpenZeppelin APIs and libraries for upgrades</a>, we can deploy our contract directly. Here are some contract examples:</p><p><strong>Beacon.sol</strong> - Beacon contract</p><pre><code>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";

contract BeaconContract is UpgradeableBeacon {
    constructor(address _logicAddr) UpgradeableBeacon(_logicAddr) {}
}</code></pre><p><strong>BeaconProxy.sol</strong> - Beacon proxy contract</p><pre><code>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";

contract BeaconProxyContract is BeaconProxy {
    constructor(address _beacon) BeaconProxy(_beacon, "") payable {}

    function setBeacon(address _beacon) public {
        _setBeacon(_beacon, "");
    }

    function beacon() public view virtual returns (address) {
        return _beacon();
    }
}</code></pre><p><strong>BeaconLogicContract.sol</strong> - Beacon logic contract</p><pre><code>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";

contract BeaconLogicContract is ERC1155Upgradeable {
    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        // Automatically lock the implementation contract during deployment:
        // https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract
        _disableInitializers();
    }

    event ContractBalance(address indexed account, uint256 indexed id, uint256 balance);
    event ContractVersion(string indexed version);

    function initialize() public initializer {
        __ERC1155_init("ipfs://baseUriPath");
    }

    function mint(address _to, uint256 _id, uint256 _amount) external {
        _mint(_to, _id, _amount, "");
    }

    function balances(address _account, uint256 _id) public virtual {
        uint256 _balance = balanceOf(_account, _id);
        emit ContractBalance(_account, _id, _balance);
        emit ContractVersion("V1");
    }
}</code></pre><p><strong>UUPSProxy.sol </strong>- UUPS proxy contract</p><pre><code>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

contract UUPSProxy is ERC1967Proxy {
    constructor(address _logic) ERC1967Proxy(_logic, "") payable {}
}</code></pre><p><strong>UUPSCompatibleLogicContract.sol </strong>- UUPS compatible logic contract</p><pre><code><code>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

contract UUPSCompatibleLogicContract is ERC1155Upgradeable, UUPSUpgradeable {
    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        // Automatically lock the implementation contract during deployment:
        // https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract
        _disableInitializers();
    }

    event ContractBalance(address indexed account, uint256 indexed id, uint256 balance);
    event ContractVersion(string indexed version);

    function initialize() public initializer {
        __ERC1155_init("ipfs://baseUriPath");
    }

    function mint(address _to, uint256 _id, uint256 _amount) external {
        _mint(_to, _id, _amount, "");
    }

    function balances(address _account, uint256 _id) public virtual {
        uint256 _balance = balanceOf(_account, _id);
        emit ContractBalance(_account, _id, _balance);
        emit ContractVersion("V2");
    }

    /**
     * @dev See {UUPSUpgradeable-_authorizeUpgrade}.
     *      This function is called internally when upgrading contracts by the proxy.
     *      The modifier `onlyOwner` makes sure that only the owner of the contract can upgrade the contract.
     */
    function _authorizeUpgrade(address) internal override {}
}</code></code></pre><h3>I&#8217;m ready to create my service using proxy contracts!</h3><p>I hope that&#8217;s all the things you need to know about proxy contracts!</p><p>Blockchains are immutable, but your service doesn&#8217;t have to be.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.noopmood.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading noop&#8217;s Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h3>Appendix</h3><h4>[1] Notable proxy storage patterns</h4><p>Apart from Unstructured Storage, notable proxy storage patterns are:</p><ul><li><p><a href="https://github.com/OpenZeppelin/openzeppelin-labs/tree/master/upgradeability_using_inherited_storage">Inherited Storage</a>: Both the proxy and logic contract inherit the same storage structure to ensure that both adhere to storing the necessary proxy state variables. An in-depth explanation is provided by OpenZeppelin <a href="https://blog.openzeppelin.com/proxy-patterns/">here</a>.</p></li><li><p><a href="https://github.com/OpenZeppelin/openzeppelin-labs/tree/master/upgradeability_using_eternal_storage">Eternal Storage</a>: Storage schemas are defined in a separate contract that both the proxy and logic contract inherit from. An in-depth explanation is provided by OpenZeppelin <a href="https://blog.openzeppelin.com/proxy-patterns/">here</a>.</p></li><li><p><a href="https://medium.com/1milliondevs/new-storage-layout-for-proxy-contracts-and-diamonds-98d01d0eadb">Diamond Storage</a>: Similar to Unstructured Storage, values are stored at arbitrary positions. Additionally, the Diamond Standard uses a lookup table for locations of the logic contracts. Diamond Storage is a work-in-progress defined in <a href="https://eips.ethereum.org/EIPS/eip-2535">EIP-2535: Diamonds, Multi-Facet Proxy</a>.</p><ul><li><p>Integration with OpenZeppelin Contracts can be found <a href="https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2964#issuecomment-1032263428">here</a>.</p></li><li><p>Trail of Bits has done an <a href="https://blog.trailofbits.com/2020/10/30/good-idea-bad-design-how-the-diamond-standard-falls-short/">audit</a> on the Diamond Standard, and the Diamond Standard team has since released a new version and published <a href="https://eip2535diamonds.substack.com/p/poorly-written-trail-of-bits-article https://eip2535diamonds.substack.com/p/poorly-written-trail-of-bits-article">this article</a>.</p></li><li><p><a href="https://docs.aavegotchi.com/abi/diamondabi">Aavegotchi</a> and <a href="https://github.com/pie-dao/initialisable-diamond">PieDAO</a> are two main services that use/have used the Diamond Standard. Additional services that are using the Diamond Standard can be found <a href="https://github.com/mudgen/awesome-diamonds#projects-using-diamonds">here</a>.</p></li></ul></li></ul>]]></content:encoded></item><item><title><![CDATA[What token standard should I use for my NFT?]]></title><description><![CDATA[ERC-721 seems to be the most popular NFT standard, but is there another option?]]></description><link>https://www.noopmood.com/p/what-token-standard-should-i-use</link><guid isPermaLink="false">https://www.noopmood.com/p/what-token-standard-should-i-use</guid><dc:creator><![CDATA[noop]]></dc:creator><pubDate>Mon, 18 Apr 2022 07:04:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!TSJF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TSJF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TSJF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TSJF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TSJF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TSJF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TSJF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg" width="1280" height="691" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:691,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:222152,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TSJF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TSJF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TSJF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TSJF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9a0680c6-6adb-42d7-b9dd-3e5f07c7af6e_1280x691.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If you browse the <a href="https://opensea.io/rankings">top NFT collections on OpenSea</a>, you&#8217;ll notice they all have one thing in common&#8212;the token standard ERC-721.</p><p>What is a token standard and why do we need them? Well, an NFT can really be implemented in any way, as long as it is distinguishable from other tokens. But since we need an easy way for NFT marketplaces to recognize and understand what NFTs are, token standards come in handy. The finalized official Ethereum token standards are listed <a href="https://eips.ethereum.org/all">here</a>, although a quick google search will unfold numerous unofficial ones that cater to various niche use cases.</p><p>Currently, the main Ethereum token standards are ERC-20, ERC-721, and ERC-1155. The differences between the standards can be found in many articles, but most focus on fungibility: ERC-20 represents fungible tokens, ERC-721 represents non-fungible tokens, and ERC-1155 represents both fungible and non-fungible tokens.</p><p>Below are the ERC-721 and ERC-1155 specifications for transfer:</p><pre><code>// ERC-721 transfer specification
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);</code></pre><pre><code>// ERC-1155 transfer specification
event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value);</code></pre><p>As shown above, ERC-721 and ERC-1155 achieve non-fungibility within a token collection simply through token identifiers (<code>_tokenId</code> and <code>_id</code>). ERC-1155s additionally support fungibility by letting more than one token to exist for a token ID (<code>_value</code> represents the token count of a token ID). This means that we can restrict  <code>_value</code> to be at most 1 if we want to guarantee non-fungibility for ERC-1155 NFTs. With ERC-1155, we can create NFT collections that have both fungible and non-fungible objects.</p><p>Another way to achieve non-fungibility with ERC-1155s is with URI variables. ERC-1155 specifies that if the string <code>{id}</code> exists within any URI, clients must replace it with the actual token ID in hexadecimal form. Using this variable, ERC-1155 <a href="https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens">suggests</a> &#8220;[t]he top 128 bits of the uint256 <code>_id</code> parameter in any ERC-1155 function MAY represent the base token ID, while the bottom 128 bits MAY represent the index of the non-fungible to make it unique.&#8221; In other words, a single contract can represent multiple collections by representing an NFT collection with the high bits of <code>{id}</code>. While this is also possible for ERC-721s since it has a <code>tokenId</code>, with an ERC-1155, a single team may only ever have to deploy a single contract for all its NFTs due to its support for both fungible and non-fungible collections.</p><p>One other notable ERC-1155 feature is batch transfers, as hinted by its transfer event name above (<code>TransferSingle</code>). The ability to have batch transfer events means that a batch mint, a batch safe transfer, or a batch burn can be processed in a single transaction. The gas price for a batch action will be similar to that of a single action, which is particularly beneficial for projects where the mint price less than the gas price. Furthermore, batch mints come in handy for token airdrops, since many holders own more than one NFT under the same collection. Additionally, <a href="https://docs.openzeppelin.com/contracts/4.x/api/token/erc1155">OpenZeppelin&#8217;s ERC-1155 implementation</a> saves gas by having only the base URI parameter in its <a href="https://docs.openzeppelin.com/contracts/4.x/api/token/erc1155#ERC1155-_setURI-string-">_</a><code>setURI</code><a href="https://docs.openzeppelin.com/contracts/4.x/api/token/erc1155#ERC1155-_setURI-string-"> function</a>, so that the URI is set at the contract level and not per token.</p><p>ERC-1155s can save gas costs for both developers and buyers. So why are all the top NFT projects ERC-721 tokens?</p><p>While I haven&#8217;t found a clear answer, I did notice that there was a strong perception that all NFTs are ERC-721s (with the exception of CryptoPunk). I observed this in NFT community posts, and even the popular Azuki NFT team posted the following tweet:</p><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/AzukiOfficial/status/1479235139167207432?s=20&amp;t=U6lQY36PnFF4mIZdl002_A&quot;,&quot;full_text&quot;:&quot;Introducing ERC721A: An Improved ERC721 Implementation &#9961;&#65039;\n\n<a class=\&quot;tweet-url\&quot; href=\&quot;http://azuki.com/erc721a\&quot;>azuki.com/erc721a</a>\n\nAzuki has developed a new algorithm, which for the first time *ever* in the NFT space, enables minting multiple NFTs for essentially the same cost of minting a single NFT. &quot;,&quot;username&quot;:&quot;AzukiOfficial&quot;,&quot;name&quot;:&quot;Azuki&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Thu Jan 06 23:35:14 +0000 2022&quot;,&quot;photos&quot;:[{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FIdG5rDVQAQrtoz.png&quot;,&quot;link_url&quot;:&quot;https://t.co/3AU9tmin2y&quot;,&quot;alt_text&quot;:null}],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:1319,&quot;like_count&quot;:3571,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><p>Here, the Azuki team made changes to the OpenZeppelin ERC-721 implementation to do exactly what the ERC-1155 standard already does, despite the OpenZeppelin ERC-1155 implementation <a href="https://github.com/OpenZeppelin/openzeppelin-contracts/issues/1728">existing since 2020</a>. The Azuki team also stated the ERC-721A &#8220; for the first time ever in the NFT space, enables minting multiple NFTs for essentially the same cost of minting a single NFT.&#8221; While this may be true within ERC-721s, it is technically not true within the NFT space since ERC-1155 has already achieved this.</p><p>Another guess is that some NFT teams do not care about gas costs inflicted on buyers. At this point, a lot of us have become indifferent to high gas prices, and we are used to paying for ERC-721s. Not only that, but the support for a single contract to represent multiple collections does not yet exist in major marketplaces, such as OpenSea and LooksRare. This leads to developers ending up deploying one contract per collection even for ERC-1155 contracts.</p><p>If not the reasons above, perhaps teams are relying on gas solutions with Layer 2 (and potentially <a href="https://medium.com/starkware/fractal-scaling-from-l2-to-l3-7fe238ecfb4f">Layer 3</a>) scaling instead. Please let me know in the comments below if you know any other reasons why the top NFT projects use ERC-721s over ERC-1155s. Regardless, we should strive to stay up to date on the latest standards and adopt the best choice.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.noopmood.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading noop&#8217;s Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[The boundaries between tokenization and gameplay]]></title><description><![CDATA[To tokenize, or not to tokenize, that is the question (ft. Nifty Island).]]></description><link>https://www.noopmood.com/p/the-boundaries-between-tokenization</link><guid isPermaLink="false">https://www.noopmood.com/p/the-boundaries-between-tokenization</guid><dc:creator><![CDATA[noop]]></dc:creator><pubDate>Sun, 03 Apr 2022 08:26:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!mM8P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mM8P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mM8P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png 424w, https://substackcdn.com/image/fetch/$s_!mM8P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png 848w, https://substackcdn.com/image/fetch/$s_!mM8P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png 1272w, https://substackcdn.com/image/fetch/$s_!mM8P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mM8P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png" width="889" height="480" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/760f7dfb-0105-415c-993d-e0affe16447b_889x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:889,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:116098,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mM8P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png 424w, https://substackcdn.com/image/fetch/$s_!mM8P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png 848w, https://substackcdn.com/image/fetch/$s_!mM8P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png 1272w, https://substackcdn.com/image/fetch/$s_!mM8P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F760f7dfb-0105-415c-993d-e0affe16447b_889x480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If there was a modern day <a href="https://knowyourmeme.com/memes/put-a-bird-on-it">Portlandia pilot episode</a>, the title of it would be &#8220;Put a Token On It!&#8221; NFTs have helped us define ownership in digital assets, leading to the tokenization of everything, starting from <a href="https://www.wsj.com/articles/sothebys-enters-nft-market-with-17-million-sale-of-art-by-enigmatic-artist-pak-11618429617">pixels</a> to <a href="https://fortune.com/2022/02/12/nft-florida-home-sale-ether-crypto/">real estate</a>.</p><p>The rise of NFTs has blown new life into developing &#8220;the metaverse,&#8221; and in particular, metaverse blockchain games. Multi-billion dollar companies such as Samsung, JP Morgan, and PwC have invested in the top metaverse games, and celebrities have publicly endorsed their holdings as well. <a href="https://decentraland.org/">Decentraland</a> and <a href="https://sandboxgame.gitbook.io/the-sandbox/">The Sandbox</a> are currently the top leading NFT metaverse games, and at the very heart of their gameplay, they allow users to build a digital world of their own and experience their creations with other players. However if you&#8217;re looking to escape to the Metaverse to avoid high real estate prices, chances are, you can&#8217;t afford the Metaverse either. I know I can&#8217;t.</p><p>Games such as Decentraland and The Sandbox require users to first own LANDs, NFTs that represent digital real estates that users can build on. The present floor price for LANDs is <a href="https://opensea.io/collection/decentraland">around $10K</a> due to its finite supply, and although less popular games with cheaper LAND exist, the number of users is highly important for social platforms. While there is a free way to play, the free version is limited to observing LANDs of players who paid or decorating your avatar with <a href="https://www.coindesk.com/learn/what-is-a-crypto-airdrop/">airdrops</a>. Tokenomics for the top NFT metaverses today don&#8217;t diverge much from this, leaving users without much choice but to pay or be a spectator.</p><p>Is this pay-to-play economics bad? I don&#8217;t think so. Tokenizing land and assets gives every player significant ownership over their creations, and limited land provides exclusivity.</p><p>Be that as it may, we live in a world where storage is increasingly cheap and demand for metaverses is booming. Is the tokenization of everything affecting gameplay? Can a free-to-build NFT game benefit players and creators alike? <a href="https://www.niftyisland.com/">Nifty Island</a> says <em>yes</em>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UVzL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UVzL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png 424w, https://substackcdn.com/image/fetch/$s_!UVzL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png 848w, https://substackcdn.com/image/fetch/$s_!UVzL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png 1272w, https://substackcdn.com/image/fetch/$s_!UVzL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UVzL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png" width="650" height="147" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/a2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:147,&quot;width&quot;:650,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39507,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UVzL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png 424w, https://substackcdn.com/image/fetch/$s_!UVzL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png 848w, https://substackcdn.com/image/fetch/$s_!UVzL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png 1272w, https://substackcdn.com/image/fetch/$s_!UVzL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2d61dc2-a31d-4838-9cf9-49aaaba3e8d3_650x147.png 1456w" sizes="100vw"></picture><div></div></div></a><figcaption class="image-caption">Nifty Island logo from niftyisland.com</figcaption></figure></div><p></p><p>On its homepage, Nifty Island introduces itself as the following:</p><blockquote><p><strong>Nifty Island is an open social gaming platform and virtual world being developed by Nyft Studios. It will be the centerpiece and first title in what we call the Nyftverse: a set of interoperable games, a marketplace, play-to-earn protocol, game developer tools and infrastructure &#8212;all powered by web3 to realize the dream of a truly open and player-owned metaverse.<br><br>We don't believe in land scarcity in a world of digital abundance. Every user is greeted with their own island, entirely free, and tasked with building their home in the metaverse. The player is able to build structures, play and create games, import their nft collection, purchase new 3D, metaverse-ready NFTs from our marketplace, earn new items for their island by completing quests, and socialize with other players via voice and text chat.</strong></p></blockquote><p></p><p>Nifty Island is a refreshing take on the pay-to-do-anything custom that many NFT games follow. I&#8217;ve been following Nifty Island for around a year now, and I was lucky enough to test out its Alpha version this February when it came out .</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KQav!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KQav!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png 424w, https://substackcdn.com/image/fetch/$s_!KQav!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png 848w, https://substackcdn.com/image/fetch/$s_!KQav!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png 1272w, https://substackcdn.com/image/fetch/$s_!KQav!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KQav!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png" width="749" height="435" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/a1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:435,&quot;width&quot;:749,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:428861,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KQav!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png 424w, https://substackcdn.com/image/fetch/$s_!KQav!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png 848w, https://substackcdn.com/image/fetch/$s_!KQav!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png 1272w, https://substackcdn.com/image/fetch/$s_!KQav!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1d84460-10da-4c5d-a5e2-97ad60e34847_749x435.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">My personal nifty island in the shape of a turtle</figcaption></figure></div><p>At the start the game, players are given a chunk of land and B33, a robot pet to talk to and roam islands with. The mechanics for sculpting land and assembling buildings are smooth, and I was able to create a huge turtle shaped island fairly easily. Multiplaying and voice chat works effortlessly well with large crowds, at least for the closed alpha. Charles, the founder of Nifty Island who is extremely involved with the Nifty Island community in various ways, often popped by players&#8217; islands to help out with builds or to just have a good time.</p><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/Nifty_Island/status/1488229042226544640&quot;,&quot;full_text&quot;:&quot;Building your island is more fun with friends &#127965;&#65039; &quot;,&quot;username&quot;:&quot;Nifty_Island&quot;,&quot;name&quot;:&quot;Nifty Island &#127965;&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Mon Jan 31 19:13:48 +0000 2022&quot;,&quot;photos&quot;:[{&quot;img_url&quot;:&quot;https://cdn.substack.com/image/upload/w_728,c_limit/l_twitter_play_button_rvaygk,w_120/micldolttmotfumizyhp&quot;,&quot;link_url&quot;:&quot;https://t.co/2TWbSiKDlb&quot;,&quot;alt_text&quot;:null}],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:39,&quot;like_count&quot;:173,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:&quot;https://video.twimg.com/ext_tw_video/1488228980473745410/pu/vid/1280x720/QvqjlhYKJuuXLuN_.mp4?tag=12&quot;,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><p>Everything is customizable in Nifty Island including the density of the clouds and the size of an avatar&#8217;s pupil. Players can also showcase their existing NFTs as art pieces on their island, or buy Nifty Island NFTs. Nifty Island NFTs serve as in-game utilities for those who want to have a bigger island or cooler skins, and does not exclude non-paying players from enjoying the core gameplay.</p><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/Nifty_Island/status/1497763426386341892&quot;,&quot;full_text&quot;:&quot;Free land &#9989; \nOriginal art &#9989; \nWorking game &#9989; &quot;,&quot;username&quot;:&quot;Nifty_Island&quot;,&quot;name&quot;:&quot;Nifty Island &#127965;&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Sun Feb 27 02:40:02 +0000 2022&quot;,&quot;photos&quot;:[{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FMkfp2FUcAQ-r_R.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/Na8fGIypZf&quot;,&quot;alt_text&quot;:null},{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FMkfp2FVcAE0EDz.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/Na8fGIypZf&quot;,&quot;alt_text&quot;:null},{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FMkfp2GVcAQ_O-g.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/Na8fGIypZf&quot;,&quot;alt_text&quot;:null},{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FMkfp2HVQAAffHr.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/Na8fGIypZf&quot;,&quot;alt_text&quot;:null}],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:25,&quot;like_count&quot;:128,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/Nifty_Island/status/1505346461843660804&quot;,&quot;full_text&quot;:&quot;Self portrait &#127965;&#65039;\n\n<span class=\&quot;tweet-fake-link\&quot;>@cadewalkergreen</span> &quot;,&quot;username&quot;:&quot;Nifty_Island&quot;,&quot;name&quot;:&quot;Nifty Island &#127965;&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Sun Mar 20 00:52:19 +0000 2022&quot;,&quot;photos&quot;:[{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FOQQm46VcAAusY4.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/8R5Sv2xmtS&quot;,&quot;alt_text&quot;:null}],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:7,&quot;like_count&quot;:50,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/Nifty_Island/status/1500981471711940609&quot;,&quot;full_text&quot;:&quot;We like the blocks &#129001;&#128998;&#127965;&#65039;\n\n<span class=\&quot;tweet-fake-link\&quot;>@GoddessHyliaa</span> \n<span class=\&quot;tweet-fake-link\&quot;>@lola03art</span> \n<span class=\&quot;tweet-fake-link\&quot;>@bwv1056_</span> \n<span class=\&quot;tweet-fake-link\&quot;>@NftSupreme</span> &quot;,&quot;username&quot;:&quot;Nifty_Island&quot;,&quot;name&quot;:&quot;Nifty Island &#127965;&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Mon Mar 07 23:47:24 +0000 2022&quot;,&quot;photos&quot;:[{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FNSNe6KVUAEZEAD.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/ufPcQrxOzt&quot;,&quot;alt_text&quot;:null},{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FNSNe-XVgAAdxMg.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/ufPcQrxOzt&quot;,&quot;alt_text&quot;:null},{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FNSOZopVcAE8E2D.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/ufPcQrxOzt&quot;,&quot;alt_text&quot;:null},{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/FNSOcCnUcAMYXO3.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/ufPcQrxOzt&quot;,&quot;alt_text&quot;:null}],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:12,&quot;like_count&quot;:48,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><p></p><p>What should or should not be tokenized in the metaverse will vary for each player depending on what they value the most. Regardless, metaverse companies that introduce new tokenomics and provide more options for players are important. If you&#8217;re interested in checking out an all-inclusive metaverse, give Nifty Island a try.</p><p><em>Let me know in the comments below if you know of any metaverse games with other unique tokenomics.</em></p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.noopmood.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading noop&#8217;s Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[How to create an NFT using Go]]></title><description><![CDATA[Tutorial on creating and deploying an ERC-1155 contract and minting tokens in Go]]></description><link>https://www.noopmood.com/p/how-to-create-an-nft-in-go</link><guid isPermaLink="false">https://www.noopmood.com/p/how-to-create-an-nft-in-go</guid><dc:creator><![CDATA[noop]]></dc:creator><pubDate>Mon, 21 Mar 2022 01:11:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!xsrG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xsrG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xsrG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png 424w, https://substackcdn.com/image/fetch/$s_!xsrG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png 848w, https://substackcdn.com/image/fetch/$s_!xsrG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png 1272w, https://substackcdn.com/image/fetch/$s_!xsrG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xsrG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png" width="794" height="436" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:436,&quot;width&quot;:794,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24390,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xsrG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png 424w, https://substackcdn.com/image/fetch/$s_!xsrG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png 848w, https://substackcdn.com/image/fetch/$s_!xsrG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png 1272w, https://substackcdn.com/image/fetch/$s_!xsrG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F79eb1b4f-7316-4f9f-9501-2d23e9156046_794x436.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Create gold tokens out of thin air like No Face</figcaption></figure></div><p>If you have written or read blockchain code, you are probably familiar with Go. <a href="https://geth.ethereum.org/">Go Ethereum</a> is one of the original implementations of the Ethereum protocol, and currently has the biggest user base for Ethereum clients. On top of this, Go is excellent for high scale projects and allows an object-oriented style of programming.</p><p>However if you look on the world wide web for deploying an NFT in Go, it&#8217;s currently hard to fund a full end-to-end tutorial. This is because much of the smart contract development has been targeted towards browser based apps, focusing the priority on Javascript or Typescript based tutorials.</p><p>In this post, we will go over end-to-end on how to deploy an NFT contract and mint NFTs with that contract in Go. Let&#8217;s get started!</p><p><em><strong>All code used in this tutorial can be found here: https://github.com/noopmood/go-erc1155-tutorial . The OS used in this tutorial is macOS Monterey v12.2.1.</strong></em></p><h1>1. Creating an ERC-1155 contract</h1><p>One of the most famous NFT and fungible token contract implementation library is <a href="https://github.com/OpenZeppelin/openzeppelin-contracts">OpenZeppelin Contracts</a>, used by Bored Ape Yacht Club, Cool Cats, Tubby Cats, and many more. Code reuse is highly recommended when creating smart contracts for security reasons. Borrowing an excerpt from <a href="https://github.com/ethereumbook/ethereumbook">Mastering Ethereum</a>, &#8220;Try not to reinvent the wheel. If a library or contract already exists that does most of what you need, reuse it.&#8221;</p><p>OpenZeppelin API docs for an ERC-1155 contract can be found <a href="https://docs.openzeppelin.com/contracts/4.x/api/token/erc1155">here</a>. For easy testing purposes, we will be exposing the internal <code>_mint</code> method so anyone can mint tokens with our contract.</p><ol><li><p>Create a <code>contracts</code> directory for our smart contract code.</p></li><li><p>Inside <code>contracts</code>, create a <code>CoinNft.sol</code> file with the following contents</p></li></ol><pre><code>// Contract based on https://docs.openzeppelin.com/contracts/4.x/erc1155
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

contract CoinNft is ERC1155 {
  constructor() ERC1155("https://raw.githubusercontent.com/noopmood/TutorialNFTInGo/main/metadata/{id}.json") {}
    
  function mintCaller(uint256 tokenId, uint256 amount) public {
    _mint(msg.sender, tokenId, amount, "");
  }
  function mintAddress(uint256 tokenId, uint256 amount, address addr) public {
    _mint(addr, tokenId, amount, "");
  }
}</code></pre><p>The HTTPS link above contains the metadata of our NFT. The string <code>{id}</code> will be replaced with the actual token ID by clients, in lowercase hexadecimal and leading zero padded to 64 hex characters. This means for token ID <code>0</code>, clients would replace <code>{id}</code> with <code>0000000000000000000000000000000000000000000000000000000000000000</code> to retrieve JSON at <code>https://raw.githubusercontent.com/noopmood/TutorialNFTInGo/main/metadata/0000000000000000000000000000000000000000000000000000000000000000.json</code>, which has the contents:</p><pre><code>{
  "description": "Gold coin",
  "image": "https://openmoji.org/data/color/svg/1FA99.svg",
  "name": "Gold",
  "attributes": [
    {
      "trait_type": "Color",
      "value": "Gold"
    },
    {
      "trait_type": "ID",
      "value": "0"
    }
  ]
}</code></pre><p>Here, we can see that a token ID of <code>0</code> represents our gold token.</p><h1>2. Create a Go binding</h1><p>To interact with the contract, we will need to implement the Ethereum API in Go. Doing so is not trivial due to various edge cases, but luckily for us, Go Ethereum has <code>abigen</code> that automatically does this for us. The <code>abigen</code> library also handles all remote client API work for us, so we don&#8217;t have to worry about RPC codes. To use <code>abigen</code>, we simply have to provide a solidity contract and it will generate the full Go source code. On top of this, <code>abigen</code> is compile time checked, so you get no surprises during deployment. For more information on abigen, please visit <a href="https://geth.ethereum.org/docs/dapp/native-bindings">Go Ethereum&#8217;s documentation</a>.</p><p>Before we feed our contract into <code>abigen</code> however, we will need the help of <a href="https://trufflesuite.com/">Truffle</a> to import the OpenZeppelin library. Since Truffle has an <code>abigen</code> plugin, we will ask Truffle to create the Go binding through <code>abigen</code> for us.</p><ol><li><p>Initialize Truffle and install dependencies.</p><pre><code>cd ~/TutorialNFTInGo

yarn init -y
yarn add truffle @openzeppelin/contracts @chainsafe/truffle-plugin-abigen

yarn truffle init # Answer "N" for overwriting contracts</code></pre></li><li><p>Add the following line to the end of <code>truffle-config.js</code>.</p><pre><code>plugins: [
  "@chainsafe/truffle-plugin-abigen"
]</code></pre></li><li><p>Compile the contract and generate the <a href="https://docs.soliditylang.org/en/develop/abi-spec.html">ABI</a> and <a href="https://goethereumbook.org/en/smart-contract-compile/">BIN</a> files.</p><pre><code>yarn truffle compile

# Create the directory that will store ABI and BIN files.
# Truffle fails silently if this directory does not exist.
mkdir abigenBindings

yarn truffle run abigen CoinNft</code></pre></li><li><p>Create a Go binding, <code>coincontract.go</code>. The BIN file is needed to generate deploy methods on the Go contract file.</p><pre><code>mkdir coincontract

abigen --bin abigenBindings/bin/CoinNft.bin --abi abigenBindings/abi/CoinNft.abi --pkg=main --out=coincontract.go</code></pre></li></ol><h1>3. Deploying a contract</h1><h2>1. Create an endpoint and private key</h2><p>We need an endpoint to deploy our smart contract on an EVM compatible network. Select any endpoint service, such as Alchemy or Infura, to create a personal endpoint. To use Alchemy, follow <a href="https://docs.alchemy.com/alchemy/introduction/getting-started">these steps</a> to create an Alchemy app and get its HTTPS endpoint.</p><p>Next, we will need the private key of a wallet to deploy contracts and mint NFTs. If you don&#8217;t have a wallet, <a href="https://medium.com/@alias_73214/guide-how-to-setup-metamask-d2ee6e212a3e">Metamask</a> provides a quick and easy option.</p><h2>2. Get test ether</h2><p>Blockchain transactions cost fees, and so we will be using test ether to deploy our contract. While you can choose any test Ethereum network, this tutorial will use the Ropsten network. <a href="https://www.moonborrow.com/">Here</a> is my favorite Ropsten faucet website, the Thinklair Ropsten Faucet.</p><h2>3. Write deployment code</h2><p>If we take a look at the Go binding code we created in the steps above, we can see that Truffle has populated OpenZeppelin contract implementations for us to call. To deploy our contract, let&#8217;s call the <code>DeployCoincontract</code> function.</p><ol><li><p>Create another directory and move the go-binding to the new directory if you prefer to keep everything in one Go package. Feel free to configure Go to point to the current directory if you would like the separation.</p></li><li><p>Create a <code>deployer.go</code> file to write our contract deployer function.</p><pre><code>package main
&#9; 
import (
  "github.com/ethereum/go-ethereum/common"
  "github.com/pkg/errors"
)

type Contract struct {
  Address common.Address
  Instance *Coincontract
}

func (c *Client) DeployContract() (Contract, error) {
  contractAddress, _, instance, err := DeployCoincontract(c.Auth, c.Rpc)
  if err != nil {
    return Contract{}, errors.Wrap(err, "failed to deploy the contract")
  }

  return Contract{contractAddress, instance}, nil
}</code></pre></li><li><p>Create our <code>main</code> function to call <code>DeployContract</code>. The Ropsten network has a chain ID of 3. To speed up or override previous transactions, increase the gas price.</p><pre><code>package main

import (
  "fmt"
  "math/big"
)

func check(e error) {
  if e != nil {
    panic(e)
  }
}

func main() {
  endpoint := "${YOUR_ENDPOINT}"
  privateKey := "${YOUR_PRIVATE_KEY}"
  chainId := big.NewInt(3)

  client, err := NewClient(endpoint, privateKey, chainId)
  check(err)

  client.SetNonce(big.NewInt(${YOUR_WALLET_NONCE}))
  client.SetFundValue(big.NewInt(0))
  client.SetGasLimit(uint64(8000000))
  client.SetGasPrice(big.NewInt(1875000000))

  contract, err := client.DeployContract()
  check(err)
  fmt.Println("Contract address:", contract.Address.Hex())
}
</code></pre></li><li><p>Run the program.</p><pre><code>export GOPROXY=direct # Avoid i/o timeouts
xcode-select --install # Install developer path
go env -w GO111MODULE=on # Turn on auto module imports
go mod init # Initialize the Go module
go mod tidy # Download module imports
go run .</code></pre><p>The output should look like the following:</p><pre><code>Contract address: ${YOUR_DEPLOYED_CONTRACT_ADDRESS}</code></pre></li><li><p>Check the status of your transaction on the <a href="https://ropsten.etherscan.io/">Ropsten Etherscan</a> by searching with the contract address or your public wallet address. You may have to wait a few minutes depending on your gas price.</p></li></ol><p>Congratulations! You have deployed an NFT smart contract to the Ropsten network!</p><h1> 4. Minting NFTs and fungible tokens</h1><ol><li><p>Create a <code>minter.go</code> file to mint NFTs.</p><pre><code>package main
&#9; 
import (
  "math/big"

  "github.com/ethereum/go-ethereum/core/types"
  "github.com/pkg/errors"
)

func (c *Contract) MintToken(client Client, tokenId *big.Int, tokenAmount *big.Int) (*types.Transaction, error) {
  tx, err := c.Instance.MintCaller(client.Auth, tokenId, tokenAmount)
  if err != nil {
    return nil, errors.Wrap(err, "failed to create signed mint transaction")
  }

  return tx, nil
}
</code></pre></li><li><p>Create a <code>checkOk</code> function in <code>main.go</code> to verify boolean returns.</p><pre><code>func checkOk(ok bool) {
  if !ok {
    panic(ok)
  }
}</code></pre></li><li><p>Append the following to the <code>main</code> method in <code>main.go</code> to create five tokens of token ID <code>0</code>, which represents gold.</p><pre><code>client.SetNonce(big.NewInt(${YOUR_WALLET_NONCE}))
tokenId := new(big.Int)
tokenId, ok := tokenId.SetString("0", 16)
checkOk(ok)
tokenAmount := new(big.Int)
tokenAmount, ok = tokenAmount.SetString("5", 16)
checkOk(ok)
fmt.Println("Minting", tokenAmount, "tokens of ID:", tokenId)

tx, err := contract.MintToken(client, tokenId, tokenAmount)
check(err)
fmt.Println("Mint transaction:", tx.Hash()) </code></pre></li><li><p>Run the package.</p><pre><code>go run .</code></pre><p>The output should look like the following:</p><pre><code>Minting 5 tokens of ID: 0
Mint transaction: ${YOUR_MINT_TRANSACTION_HASH}</code></pre></li><li><p>Check the status of your transaction on the <a href="https://ropsten.etherscan.io/">Ropsten Etherscan</a> by searching with the transaction hash or your public wallet address. You may have to wait a few minutes depending on your gas price.</p></li></ol><p>Great work! You have created a fungible token! To create an NFT, set and restrict the <code>tokenAmount</code> to 1. You can view the NFT in your Metamask wallet by following the steps <a href="https://ethereum.org/en/developers/tutorials/how-to-view-nft-in-metamask/">here</a>. At the time of writing, NFTs images are only visible on Metamask through its mobile app.</p><p>For more activities, such as minting tokens in a different address than the caller or transferring tokens, write to the chain with other functions in <code>coincontract.go</code>.</p><h1>Final notes</h1><ul><li><p>If you are looking for an Go based Ethereum client other than Go-Ethereum due to licensing issues, please let me know if you find a good one. At the time of writing, <a href="https://github.com/INFURA/go-ethlibs">INFURA&#8217;s <code>go-ethlibs</code></a> seems to be the only viable option with MIT licensing. However <code>go-ethlibs</code> lacks strong tooling, particularly around contract deployment and transaction signing.</p></li><li><p>If you are looking to deploy and create NFTs in Javascript, the Ethereum organization has an <a href="https://ethereum.org/en/developers/tutorials/how-to-write-and-deploy-an-nft/">excellent tutorial</a>.</p></li></ul><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.noopmood.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading noop&#8217;s Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Setting up an EVM compatible blockchain on Cosmos]]></title><description><![CDATA[Using Evmos to stand up a private blockchain network with EVM compatibility]]></description><link>https://www.noopmood.com/p/standing-up-a-private-blockchain</link><guid isPermaLink="false">https://www.noopmood.com/p/standing-up-a-private-blockchain</guid><dc:creator><![CDATA[noop]]></dc:creator><pubDate>Mon, 14 Mar 2022 04:45:21 GMT</pubDate><enclosure url="https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/03e44dbd-2419-4a94-9e9a-ac64ae751cf8_4133x2480.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vWsQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vWsQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png 424w, https://substackcdn.com/image/fetch/$s_!vWsQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png 848w, https://substackcdn.com/image/fetch/$s_!vWsQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png 1272w, https://substackcdn.com/image/fetch/$s_!vWsQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vWsQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png" width="1456" height="874" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:874,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:194260,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vWsQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png 424w, https://substackcdn.com/image/fetch/$s_!vWsQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png 848w, https://substackcdn.com/image/fetch/$s_!vWsQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png 1272w, https://substackcdn.com/image/fetch/$s_!vWsQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e92f10f-e882-47a4-9803-a7bdfe88b9ff_4133x2480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If you haven&#8217;t heard about it already, <a href="https://v1.cosmos.network/intro">Cosmos</a> is a decentralized network that aims to bridge independent blockchains together to easily allow horizontal scaling.</p><p>To create a test EVM compatible private blockchain on top of Cosmos, currently the best option is to use <a href="https://evmos.dev/">Evmos</a>, a proof-of-stake blockchain that is EVM compatible and built on Cosmos SDK.</p><p>This post will go over step-by-step on how to set up Evmos on a Ubuntu host. While the Evmos website does provide a <a href="https://evmos.dev/quickstart/installation.html#">quick start on how to run a Evmos testnet</a>, many of the commands in the website were broken or uninformative during the time of my experimentation. Until the Evmos website and setup code is fixed, I hope this post will help those struggling to run a test blockchain on Cosmos.</p><h1>Standing up the blockchain</h1><h2>Preparing the host</h2><ol><li><p>SSH into the host. If you are using AWS EC2, make sure to select Ubuntu when selecting the platform.</p></li><li><p>Setup golang</p><ol><li><p>Install golang</p><pre><code>wget -c https://golang.org/dl/go1.17.5.linux-amd64.tar.gzsudo tar -C /usr/local -xvzf go1.17.5.linux-amd64.tar.gzmkdir -p ~/go_projects/{bin,src,pkg}</code></pre></li><li><p>Set go environment variables</p><ol><li><p>Add the following lines to <code>$HOME/.profile</code></p><pre><code>export PATH=$PATH:/usr/local/go/binexport GOPATH="$HOME/go_projects"export GOBIN="$GOPATH/bin"export PATH=$PATH:$GOPATH/bin</code></pre></li><li><p>Don&#8217;t forget to<code> source ~/.profile</code></p></li></ol></li><li><p>Check go version</p><pre><code>go version
# Output should be: "go version go1.17.5 linux/amd64"</code></pre></li></ol></li><li><p>Setup <code>gcc</code>, <code>jq</code>, and <code>make</code></p><pre><code>sudo apt install gcc
sudo apt-get update
sudo apt-get install jq
sudo apt install make

# To install docker (since the Evmos tutorial has examples on docker), follow steps in:
# * https://docs.docker.com/engine/install/ubuntu
# * https://docs.docker.com/compose/install

# If you are going to run docker with the sudo command,
# modify or comment out the "env_reset" and "secure_path" lines
# in the /etc/sudoers file.</code></pre></li></ol><h2>Steps on running Evmos on a single node</h2><ol><li><p>Install Evmos</p><ol><li><p>Install the latest Ethermint repository</p><pre><code>git clone https://github.com/tharsis/ethermint.git
cd ethermint
make install</code></pre></li><li><p>Check installation</p><pre><code>ethermintd -h</code></pre></li></ol></li><li><p>Run a local node for Evmos</p><ol><li><p><code>./init.sh</code></p></li><li><p>The console output should look like the following:</p><pre><code>5:54PM INF received proposal module=consensus proposal=... {truncated}
5:54PM INF received complete proposal block hash=127C91E3EFFE5B992874280EE140E448F38D42DA6D1E243895BCA996D2214F2D height=17 module=consensus server=node
5:54PM INF finalizing commit of block hash=127C91E3EFFE5B992874280EE140E448F38D42DA6D1E243895BCA996D2214F2D height=17 module=consensus num_txs=0 root=3F30260CA9E5F2F7F7C49F8D9DB5ED723E2AF70D856AD34E66E446E1ED915F24 server=node
5:54PM INF minted coins from module account amount=2059731934472497943aphoton from=mint module=x/bank</code></pre></li><li><p>Single machine RPC call access test</p><pre><code>ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key mykey --chain-id ethermint-1</code></pre></li><li><p>Running JSON-RPC server on Evmos</p><ol><li><p>Enable server</p><pre><code>ethermintd start
# in a different terminal:
ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key mykey --chain-id 8</code></pre></li><li><p>Return current ethereum protocol version</p><pre><code>curl -X POST --data '{"jsonrpc":"2.0","method":"eth_protocolVersion","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545
{"jsonrpc":"2.0","id":1,"result":"0x41"}</code></pre></li></ol></li></ol></li></ol><h2>Steps on running Ethermint on multiple nodes</h2><h3>Automated testnet</h3><ol><li><p>Clone the old Evmos repository (the latest repository commands are broken)</p><pre><code># To create the automated testnet, we must use the old repository
git clone https://github.com/cosmos/ethermint.git
cd ethermint
make install</code></pre></li><li><p>Follow <a href="https://docs.ethermint.zone/quickstart/testnet.html">steps in the old Evmos website</a>, or create an automated testnet through Docker with the commands below:</p><ol><li><p>Start the localnet through Docker</p><pre><code>make localnet-start</code></pre></li><li><p>Verification</p><pre><code># It should look something like this:
Creating network "ethermint_localnet" with the default driver
Creating ethermintdnode3 ... done
Creating ethermintdnode0 ... done
Creating ethermintdnode1 ... done
Creating ethermintdnode2 ... done

# To see files created in each node, check the build folder.
# Check logs through:
docker exec ethermintdnode0 tail ethermintd.log # daemon logs
docker exec ethermintdnode0 tail ethermintcli.log # REST &amp; RPC logs
# Following logs:
docker logs -f ethermintdnode0 </code></pre></li><li><p>Stop the local net by using the command <code>make localnet-stop</code></p></li></ol></li></ol><h3>Manual testnet: Option #1</h3><ol><li><p>Clone the old Evmos repository</p><pre><code># To create the automated testnet, we must use the old repository git clone https://github.com/cosmos/ethermint.git cd ethermint make install</code></pre></li><li><p>Create a single node</p><ol><li><p>Create a single node, node 1, with <code>init.sh</code></p></li></ol></li><li><p>Deploy other nodes</p><ol><li><p>Create another node, node 2, on another instance with with <code>init.sh</code>.</p></li><li><p>Copy the <code>~/.ethermintd/config/genesis.json</code> file from node 1 and paste it over to node 2.</p></li></ol></li><li><p>Set seeds</p><ol><li><p>Get node ID of node 1 using <code>ethermintd tendermint show-node-id</code>.</p></li><li><p>Construct the seed of node 1 using the format <code>${nodeID}@${IP address}:26656</code></p></li><li><p>Add the seed of node 1 to the file <code>~/.ethermintd/config/config.toml</code> of node 2, by inserting the seed into <code>seeds</code>.</p></li></ol></li><li><p>Allow nodes to talk to each other</p><ol><li><p>Modify the firewall (for AWS, modify the EC2 security group) of node 1 to allow traffic from node 2.</p></li></ol></li><li><p>Start the nodes</p><ol><li><p>Start node 1 first, then start node 2.</p><ol><li><p>Use command</p><pre><code>ethermintd start &#8212;pruning=nothing &#8212;rpc.unsafe &#8212;log_level &#8220;main:info,state:info,mempool:info&#8221; --trace</code></pre></li></ol></li><li><p>The two nodes should be synchronized. Synchronization can be verified when the app hashes for committed states will be equal to each other.</p></li></ol></li></ol><h3>Manual testnet: Option #2</h3><ol><li><p>Clone the old Evmos repository</p><pre><code># To create the automated testnet, we must use the old repository git clone https://github.com/cosmos/ethermint.git cd ethermint make install</code></pre></li><li><p>Create the Ethermint configuration and genesis file for each node using the <code>ethermintd</code> command, which can take in a list of addresses (<code>--ip-addrs</code>), number of nodes (<code>-v</code>), and type of <a href="https://evmos.dev/guides/keys-wallets/keyring.html">keyring</a> (<code>--keyring-backend</code>).</p><ol><li><p>Run the <code>ethermintd</code> command</p><pre><code>ethermintd testnet --ip-addrs=172.31.5.94,172.31.12.215,172.31.1.32,172.31.7.5,172.31.7.53 --v 5 --keyring-backend=file</code></pre></li><li><p>The generated files should be in the <code>build</code> directory of where you ran the command.</p></li></ol></li><li><p>Make the following directories in each instance:</p><pre><code>mkdir /home/ubuntu/.ethermintd/
mkdir /home/ubuntu/.ethermintd/config/
mkdir /home/ubuntu/.ethermintd/config/gentxs/
mkdir /home/ubuntu/.ethermintd/data/
mkdir /home/ubuntu/.ethermintcli</code></pre></li><li><p>scp the generated file to each instance (add the <code>-i /home/ubuntu/ubuntu.pem</code> flag for EC2 instances):</p><pre><code>sudo scp -r /home/ubuntu/testnet/build/node4/ethermintd/config/* ${hostname}:/home/ubuntu/.ethermintd/config/

sudo scp -r /home/ubuntu/testnet/build/node4/ethermintd/data/* ${hostname}:/home/ubuntu/.ethermintd/data/

sudo scp -r /home/ubuntu/testnet/build/gentxs/node4.json ${hostname}:/home/ubuntu/.ethermintd/config/gentxs/

sudo scp -r /home/ubuntu/testnet/build/node4/ethermintcli/keyring-test-ethermint/ ${hostname}:/home/ubuntu/.ethermintcli/ </code></pre></li><li><p>Run the nodes for each instance with <code>ethermintd start</code></p><ol><li><p>If the nodes tries to connect to itself and fails, remove itself from <code>~/.ethermintd/config/address.json</code></p></li></ol></li></ol><h1>Final notes</h1><ul><li><p>Evmos has moved from <a href="https://github.com/cosmos/ethermint.git">https://github.com/cosmos/ethermint </a>to <a href="https://github.com/tharsis/ethermint">https://github.com/tharsis/ethermint</a>. However, the <a href="https://docs.ethermint.zone/">official website</a>&#8217;s tutorial corresponds to the the old version of Evmos, and so there will be conflicts/command that will not work.</p></li><li><p>Looking at Tendermint docs may be more useful than Ethermint&#8217;s. There isn&#8217;t a 1:1 correlation in the commands/settings, but they are quite similar.</p></li><li><p>Tendermint docs on adding non-validator vs validator: <a href="https://docs.tendermint.com/master/tendermint-core/using-tendermint.html">https://docs.tendermint.com/master/tendermint-core/using-tendermint.html</a></p><ul><li><p>Adding a non-validator is simple. Just copy the original <code>genesis.json</code> to <code>~/.tendermint/config</code> on the new machine and start the node, specifying seeds or persistent peers as necessary.</p></li><li><p>The easiest way to add new validators is to do it in the <code>genesis.json</code>, before starting the network.</p></li></ul></li><li><p><code>node_key.json</code></p><ul><li><p>node_key.json is used to store the node's key. The node-id queried by <code>ethermintd tendermint show-node-id</code> is derived by the key, which is used to indicate the unique identity of the node. It is used in p2p connection.</p></li></ul></li><li><p><code>priv_validator.json</code></p><ul><li><p><code>pri_validator.json</code> is the Tendermint Key file that the validator will use to sign Pre-vote/Pre-commit in each round of consensus voting. As the consensus progresses, the tendermint consensus engine will continuously update <code>last_height</code>/<code>last_round</code>/<code>last_step</code> values.</p></li><li><p>Query the associated public key prefixed with <code>icp</code>: <code>ethermintd tendermint show-validator</code></p></li><li><p>Query the associated bech32 address prefixed with <code>ica</code>: <code>ethermintd tendermint show-address</code></p></li></ul><p></p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.noopmood.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading noop&#8217;s Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>