<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Paolo Servillo on Medium]]></title>
        <description><![CDATA[Stories by Paolo Servillo on Medium]]></description>
        <link>https://medium.com/@donpablooooo?source=rss-e0c1a837d478------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hVIVa8XmgOSaTJZ-QqQ9Kg.png</url>
            <title>Stories by Paolo Servillo on Medium</title>
            <link>https://medium.com/@donpablooooo?source=rss-e0c1a837d478------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 07:13:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@donpablooooo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[10 Common Misconceptions About Blockchain]]></title>
            <link>https://medium.com/coinmonks/10-common-misconceptions-about-blockchain-c88e3513dce2?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/c88e3513dce2</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[misconception]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[top-ten]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 15:26:13 GMT</pubDate>
            <atom:updated>2024-01-10T15:26:13.762Z</atom:updated>
            <content:encoded><![CDATA[<p>Highlighting ten common misunderstandings about Blockchain</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJ4tZtlymLCPDjDa8xhRHA.png" /></figure><p>If you are here, sure you have heard, studied, and read a lot about blockchain, but, like me, you have the feeling that some misunderstandings about blockchain have emerged.</p><p>Here, I tried to separate facts from fiction, individuating the ten prevalent misconceptions surrounding this revolutionary technology.</p><p>We’ll be debunking ten common myths about blockchain, and I’m eager to hear if you agree or disagree</p><ol><li>Blockchain is a solution for all problems</li><li>Blockchain equals Bitcoin</li><li>Blockchain is only for financial applications</li><li>Blockchain eliminates the need for intermediaries</li><li>Blockchain is entirely secure</li><li>Blockchain is entirely decentralized</li><li>Blockchains are entirely transparent</li><li>Transactions on blockchain are always anonymous</li><li>All blockchains are the same</li><li>Blockchain is a mature technology</li></ol><h3>Number 1: Blockchain is a solution for all problems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZVb-NqUJQT5xn3OFJoLUg.png" /></figure><p>Blockchain isn’t a one-size-fits-all solution. Not all use cases benefit from decentralization, and implementing blockchain without addressing specific business needs or regulatory considerations can lead to inefficiencies.</p><p>Blockchain’s robustness in preventing tampering might be unnecessary for a situation where simple database management or barcoding systems could suffice.</p><h3>Number 2: Blockchain equals Bitcoin</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TUdKtpx-pC-C_bNkWtQq_A.png" /></figure><p>Many assume that blockchain and Bitcoin are synonymous. While Bitcoin operates on a blockchain, blockchain technology extends beyond cryptocurrencies.</p><p>So, in simple terms, while Bitcoin uses blockchain as its underlying technology to keep track of transactions, blockchain is a broader concept that can be used for various things beyond just cryptocurrencies. It’s like saying a car uses an engine, but the engine itself is not the whole car. Similarly, Bitcoin uses blockchain, but blockchain is not limited to Bitcoin; it can do a lot more!</p><h3>Number 3: Blockchain is only for financial applications</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kpndIC2Wvnrf6BxiG3YjuQ.png" /></figure><p>This point strictly relates to the number 1. But, beyond cryptocurrencies, blockchain finds applications across numerous sectors, including healthcare, supply chain management, voting systems, real estate, and identity verification.</p><h3>Number 4: Blockchain eliminates the need for intermediaries</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GadbJsmdOHat3VnZRpAmgA.png" /></figure><p>Blockchains are often celebrated for their ability to facilitate direct peer-to-peer transactions, reducing the reliance on intermediaries. However, there are scenarios where intermediaries are still necessary despite the presence of blockchain technology.</p><p>Certain aspects of industries, regulations, user interfaces, dispute resolution, legacy systems, and transaction immediacy might still require intermediaries to facilitate operations and ensure seamless integration with existing systems and regulatory frameworks.</p><h3>Number 5: Blockchain is entirely secure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jiPvOG8WQvV3SpFDC5WILA.png" /></figure><p>Although blockchain boasts robust security features, it’s not immune to vulnerabilities. While the immutability of recorded data makes altering information extremely challenging, other threats like 51% attacks, but even more simply, smart contract bugs, and human error can compromise blockchain systems.</p><h3>Number 6: Blockchain is entirely decentralized</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YXzTw-jRfyNoD0xkldOzAQ.png" /></figure><p>While decentralization is a key feature, not all blockchains are fully decentralized. Some utilize a hybrid approach or operate on a sliding scale of decentralization, balancing efficiency and security according to specific use cases. An example is <a href="https://www.vechain.org//wp-content/uploads/2023/10/vechain-whitepaper-3-0.pdf">Vechain</a> with its Proof Of Authority consensus mechanism.</p><h3>Number 7: Blockchains are entirely transparent</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fWA2c_kpf9mjXn-92bIvg.png" /></figure><p>While blockchains offer transparency by storing data in a public ledger, they can be designed as public, private, or consortium networks. In private or permissioned blockchains, access to data and transactions can be restricted, providing confidentiality to sensitive information.</p><h3>Number 8: Transactions on the blockchain are always anonymous</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZbCRQekkUMS-4YfXG67HuA.png" /></figure><p>Transactions on a blockchain are often seen as pseudonymous rather than entirely anonymous. While blockchain technology provides privacy by using cryptographic addresses instead of real-world identities, it doesn’t guarantee complete anonymity. This is because, public blockchains maintain transaction records visible to all, potentially linking transactions to specific users through analysis or forensic methods. Achieving complete anonymity in a public blockchain while maintaining transparency and preventing misuse is challenging.</p><p>Besides, in some jurisdictions, regulatory authorities require exchanges or cryptocurrency service providers to implement Know Your Customer (KYC) and Anti-Money Laundering (AML) procedures. This can involve collecting user identification information, undermining the anonymity of transactions made through these platforms.</p><h3>Number 9: All blockchains are the same</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U8iLHpgUDmeZVXwfdFcyMA.png" /></figure><p>Blockchains vary in design, consensus mechanisms, scalability, and governance structures. Some prioritize decentralization, while others focus on scalability and throughput. Understanding these differences is crucial when selecting or developing a blockchain solution.</p><h3>Number 10: Blockchain is a mature technology</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_7mpkhrWpAez4T7rpxwBjQ.png" /></figure><p>While blockchain has made significant strides, it remains an evolving technology facing challenges such as scalability, interoperability, energy consumption, and regulatory uncertainty. Ongoing research and development are essential for its advancement.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c88e3513dce2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/10-common-misconceptions-about-blockchain-c88e3513dce2">10 Common Misconceptions About Blockchain</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a RESTful API with Google Sheets]]></title>
            <link>https://medium.com/coinmonks/create-a-restful-api-with-google-sheets-2cded873d52a?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cded873d52a</guid>
            <category><![CDATA[rest]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[spreadsheets]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 11:59:46 GMT</pubDate>
            <atom:updated>2023-09-04T09:28:40.272Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn how to serve data from Google Sheets using Google Apps Script</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1RdYR13077yzetBO" /><figcaption>Photo by <a href="https://unsplash.com/@rubaitulazad?utm_source=medium&amp;utm_medium=referral">Rubaitul Azad</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you are searching for a quick and straightforward way to expose data via HTTP endpoints, you are in the right place.</p><p>We will use Google Sheets which are a simple and cost-effective way to store structured data. Then, on top of a Google Sheet, we will create a RESTful API to serve data using Google Apps Script.</p><p>This can be very useful for quick prototyping and when non-technical users need to collaborate by modifying data.</p><p>No more talk, let’s get to the point!</p><h3>How it works</h3><p>Of course, the first step is to create a Google Sheet with your Google account and if you are here you know how to do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/0*Dj96iSC8y90KIzyR" /><figcaption>Create a Google Sheet</figcaption></figure><p>Now we can store our data in tabular format. The first line contains the column names. Let’s store the personal data of the Big Bang Theory characters, in any particular order (anyway Raj is my favourite).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*GAqTPHoZwLm5QjANsBEevQ.png" /><figcaption>The Big Bang Theory characters</figcaption></figure><p>Our goal (at least for today) is to create an HTTP endpoint able to serve this data in JSON format. We will do it through a Google script.</p><p>Open the Google Apps Script editor by clicking on Tools =&gt; Extensions =&gt; Apps Script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3R2aOkK7mODF1wnl" /><figcaption>Open Google Apps Script editor</figcaption></figure><p>An empty App Script project will open In a new window. It contains an empty function myFunction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KsoHcmyWYBpcQgCH" /><figcaption>The Google App Script editor</figcaption></figure><p>Replace myFunction with the following code (note that the function name has to be doGet, with one input parameter).</p><pre>function doGet(req) {<br>  var doc = SpreadsheetApp.getActiveSpreadsheet();<br>  var sheet = doc.getSheetByName(&quot;Sheet1&quot;);<br>  var values = sheet.getDataRange().getValues();<br><br>  var output = [];<br><br>  for (var i = 0; i &lt; values.length; i++) {<br>    if (i == 0) {<br>      continue;<br>    }<br>    var row = {}; // Create a new row object for each row<br>    for (var j = 0; j &lt; 100; j++) {<br>      if (!values[i][j]) {<br>        break;<br>      }<br>      row[values[0][j]] = values[i][j];<br>      }<br>      output.push(row); // Push the row object to the output array<br>      delete row;<br>    }<br>  return ContentService.createTextOutput(JSON.stringify({ data: output })).setMimeType(ContentService.MimeType.JSON);<br>}</pre><p>The doGet function receives an event object as an input parameter. This object contains information about the incoming HTTP request, including the URL and path parameters.</p><p>Anyway, this function will be called when someone accesses your web app via a URL. It basically retrieves the data in the sheet and transforms them from the tabular form to the JSON format.</p><p>The Apps Script editor allows debugging, logging and other cool features. But let’s focus on our goal for the moment. It’s time to deploy your Google Apps Script as a web app.</p><p>To deploy the App, click on the Deploy button on the right side of the editor. Then, click on New deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*323SXYHPtlIBNJiV" /><figcaption>Deploy the App</figcaption></figure><p>Now a popup window will open. Firstly, we have to select the type of deployment. Click on Select type and then choose Web app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*laOl351YT4Slk613" /><figcaption>Select the type of deployment</figcaption></figure><p>Now, we have to configure the App deployment. A simple and working configuration is the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yK2geMH4KOPVLok2" /><figcaption>Configure the deployment</figcaption></figure><p>The relevant part of this configuration is that anyone can access the web app. In this way, we do have not to deal with authentication and other boring stuff.</p><p>Ready to deploy?</p><p>Click on the Deploy button and authorize the web app to access your data when requested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*guGYSO7QjryehVbx" /></figure><p>Don’t worry if the following message appears (in our case the Big Bang Theory characters are not sensitive data).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/0*rFo_TeTI7cfQW2W1" /></figure><p>Click on the Advanced link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*Gb2uqM3BcDPt96Lp" /></figure><p>Now, click on Go to the &lt;Project Name&gt; project (unsafe). Then give the authorization to the App Script project to access your Google Sheets (Allow button).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/0*mxmISiAldOxc_YlB" /><figcaption>Authorize app</figcaption></figure><p>Congratulation! You have successfully deployed the Script as a Web App.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SUI6ZuQQQuDyr27z" /><figcaption>Successful App deployment</figcaption></figure><p>A popup window will show you the HTTP GET endpoint just created. So, you can test your web app by sending an HTTP GET request to its URL.</p><p>In this example, the URL is: <a href="https://script.google.com/macros/s/AKfycbxlXoDY5-V0sDnM2xlssXf_fe3sC8xmtiNC2kpvak1RlCuT-b11BHZLTys7B2NexDd6/exec">https://script.google.com/macros/s/AKfycbxlXoDY5-V0sDnM2xlssXf_fe3sC8xmtiNC2kpvak1RlCuT-b11BHZLTys7B2NexDd6/exec</a></p><p>Try to open it in a browser tab. You should see this output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*YBm0FgPR2Akzk84S" /></figure><p>Similarly, when you want to manage an HTTP POST request, you must create a doPost function. The doPost function receives an event object as a parameter. This object contains information about the incoming HTTP POST request, including the request body that can be accessed to process its content.</p><h3>Final considerations</h3><p>Using Google Sheets to serve data through a REST API can be a practical choice for projects that require an easily accessible, collaborative, and cost-effective data storage and retrieval solution, especially for small to medium-sized applications and prototypes.</p><p>Data in a Google Sheet can be updated in real time, and changes are immediately reflected in the API responses. This can be valuable for applications that require up-to-the-minute data.</p><p>Google handles the infrastructure and maintenance of Google Sheets. This means you don’t need to worry about server maintenance, backups, or scalability issues, as you might with a traditional database.</p><p>However, for larger-scale or highly complex projects, you may need to consider transitioning to a dedicated database solution to meet scalability and performance requirements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cded873d52a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/create-a-restful-api-with-google-sheets-2cded873d52a">Create a RESTful API with Google Sheets</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redeemable NFT (EIP-5560)]]></title>
            <link>https://medium.com/coinmonks/redeemable-nft-eip-5560-6fddfc61eeaf?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fddfc61eeaf</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[eip]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[nft]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Tue, 20 Dec 2022 03:57:03 GMT</pubDate>
            <atom:updated>2022-12-20T03:57:03.326Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7">NFT Series</a></h4><h4>What if the concept of redeemability would be associated with NFTs</h4><p>Redeemable Non-Fungible Tokens (NFTs) are a new form of digital asset that has recently been gaining attention in the blockchain space. NFTs are unique digital assets that represent ownership of a certain asset, such as a digital artwork, a collectable, or an in-game asset. Redeemable NFTs are a special type of NFT that can be exchanged for a physical good or service.</p><h3>What is a redeemable NFT?</h3><p>The <a href="https://eips.ethereum.org/EIPS/eip-5560">EIP-5560</a> introduced the concept of redeemability associated with NFTs a few months ago (August, 30). The proposal is in draft status, anyway the concept of redeemable NFTs is straightforward: the buyer of an NFT can exchange it for another asset, such as a real-world item, or another digital asset.</p><p>Redeemable NFTs are designed to bridge the gap between the physical and digital worlds. With the help of a smart contract, users can use the NFTs to purchase physical goods such as apparel, collectables, and even tickets to events. The NFTs can also be used to redeem rewards, services, and special offers.</p><p>The usefulness or futility of this new type of NFT is yet to be determined, anyway, I would like to explore the pros and cons of this additional feature of an NFT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/0*_STbpW5mOxoAW422" /></figure><h3>Pros of Redeemable NFTs</h3><p><strong>Offer a tangible value</strong>: redeemable NFTs are a great way to exchange digital assets for something of tangible value, such as a physical item or service. This makes them more attractive to investors, as they can see the possibility of gaining a tangible benefit from their investment.</p><p><strong>Increase the value of goods and services</strong>: by creating a digital asset that can be exchanged for a tangible item or service, businesses can increase the value of their goods and services. This is because NFTs can be used to create a scarcity of the item being sold, as well as to offer customers the opportunity to own something of value.</p><p><strong>Pave the way to new business</strong>: redeemable NFTs can also be used to create new business models and revenue streams. For example, companies can issue their own redeemable NFTs and use them to issue vouchers or rewards to their customers. This could be used to incentivize customers to purchase products or services from the company.</p><p><strong>Create digital collectables</strong>: as with any NFT also redeemable NFTs can be used to create digital collectables, such as rare artwork or limited edition gaming items. This allows users to own something unique and collectable, which creates a market for these items, as well as a demand for them.</p><h3>Cons of Redeemable NFTs</h3><p><strong>Prone to fraud</strong>: NFTs are still a relatively new concept, and as a result, there is a risk of fraud associated with them. It is important to take necessary precautions when investing in NFTs to ensure that you are not scammed.</p><p><strong>Not yet widely adopted</strong>: redeemable NFTs are still a relatively new concept, and as a result, they are not yet widely adopted. This means that there is still a risk associated with them, as they have yet to be tested in the real world.</p><p><strong>Can be difficult to use</strong>: NFTs can be complicated to use, as they require a certain level of technical understanding. This means that they are not suitable for everyone, as not everyone is comfortable with the technology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z5So9-R8cw9nsd4a" /></figure><h3>The reference implementation</h3><p>As usual, I like to have a look at the code of the reference implementation. This is the standard interface of a Redeemable NFT as defined in the EIP.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98a8a43ebc4b29853b54d76eaa66c644/href">https://medium.com/media/98a8a43ebc4b29853b54d76eaa66c644/href</a></iframe><p>An ERC-721 contract has to implement this interface to provide a method of receiving information on redeemability.</p><p>Anyone can call the isRedeemable() function to check the redeemability status. This function should return:</p><ul><li><strong>true</strong>: if the NFT is redeemable,</li><li><strong>false</strong>: when the NFT was already redeemed.</li></ul><p>The redeem() function visibility is public by default, so anyone can trigger it. The EIP strongly recommends adding a require statement to restrict access. The decision about who is allowed to redeem the NFT has to be taken accordingly to the NFT issuer policies and requirements.</p><p>When the redeem() function is called, the Redeem event is emitted, so that third-party services may listen to this event to be updated on the redeemable status of the NFT.</p><h3>Conclusion</h3><p>Redeemable NFTs are a relatively new concept, and as a result, they come with both pros and cons. For those looking to invest in something of tangible value, or to create a digital collectable, they can be a great option. However, it is important to be aware of the risks associated with them, such as fraud and the lack of widespread adoption.</p><p>Overall, redeemable NFTs are an innovative way to bring the physical and digital worlds together. This technology has the potential to revolutionize how we conduct business and interact with digital assets. It remains to be seen how this technology will evolve in the future</p><p>What do you think about it? Redeemable NFTs are here to stay or not?</p><p>Read more from the <a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7"><strong>NFT Series</strong></a>.</p><blockquote>New to trading? Try <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">crypto trading bots</a> or <a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">copy trading</a></blockquote><blockquote>Diversify Crypto Holdings, Learn about <a href="https://coincodecap.com/binance-alternatives">Binance Alternatives</a></blockquote><blockquote>Join Coinmonks<a href="https://t.me/coincodecap"> Telegram Channel</a> and<a href="https://www.youtube.com/c/coinmonks/videos"> Youtube Channel</a> get daily <a href="http://coincodecap.com/">Crypto News</a></blockquote><h4>Also, Read</h4><ul><li><a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">Copy Trading</a> | <a href="https://medium.com/coinmonks/crypto-tax-software-ed4b4810e338">Crypto Tax Software</a></li><li><a href="https://coincodecap.com/grid-trading">Grid Trading</a> | <a href="https://medium.com/coinmonks/the-best-cryptocurrency-hardware-wallets-of-2020-e28b1c124069">Crypto Hardware Wallet</a></li><li><a href="https://medium.com/coinmonks/top-3-telegram-channels-for-crypto-traders-in-2021-8385f4411ff4">Crypto Telegram Signals</a> | <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">Crypto Trading Bot</a></li><li><a href="https://medium.com/coinmonks/crypto-exchange-dd2f9d6f3769">Best Crypto Exchange</a> | <a href="https://medium.com/coinmonks/bitcoin-exchange-in-india-7f1fe79715c9">Best Crypto Exchange in India</a></li><li><a href="https://medium.com/coinmonks/best-crypto-apis-for-developers-5efe3a597a9f">Best Crypto APIs</a> for Developers</li><li>Best <a href="https://medium.com/coinmonks/top-5-crypto-lending-platforms-in-2020-that-you-need-to-know-a1b675cec3fa">Crypto Lending Platform</a></li><li><a href="https://medium.com/coinmonks/free-crypto-signals-48b25e61a8da">Free Crypto Signals</a> | <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">Crypto Trading Bots</a></li><li>An ultimate guide to <a href="https://medium.com/coinmonks/leveraged-token-3f5257808b22">Leveraged Token</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fddfc61eeaf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/redeemable-nft-eip-5560-6fddfc61eeaf">Redeemable NFT (EIP-5560)</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiverse NFT (EIP-5606)]]></title>
            <link>https://medium.com/coinmonks/multiverse-nft-eip-5606-f7494bce2152?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7494bce2152</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[multiverse]]></category>
            <category><![CDATA[eip]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Tue, 08 Nov 2022 15:39:41 GMT</pubDate>
            <atom:updated>2022-11-08T15:39:41.603Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7">NFT Series</a></h4><h4>An attempt to address the interoperability aspect of NFTs and “true” ownership across platforms.</h4><h3>Introduction</h3><p>These days, I came across an interesting Ethereum Improvement Proposal (<a href="https://eips.ethereum.org/EIPS/eip-5606">EIP-5606</a>). The EIP was created a few months ago and is in the review stage at the moment. Despite the proposal does not seem so mature, it brings to light a real problem regarding NFTs and the platforms where they are used.</p><h3>Motivation</h3><p>NFTs are largely used in metaverses, games or other blockchain platforms to manage assets like avatars, in-game items, physical assets and so on. Each platform typically has its separate EIP-721 or EIP-1155 token contract to integrate the NFT in its “universe”.</p><p>Apparently, there is no problem with that, but from a publisher’s point of view, this means that the same digital asset must be published on various platforms as a separate token.</p><p>An example will help!</p><p>Imagine that a company markets a new product, say a new sunglasses model. The company want to release this new model on several platforms in the form of a digital wearable. It must be minted as a separate NFT on each platform also if it is the same object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zUvcivaE5-TnNht3" /><figcaption>How the same digital asset is replicated on different platforms</figcaption></figure><p>So, also when NFTs represent the same digital item, there is no relationship between their representation on different platforms. In this way, the concept of scarcity becomes hard to clearly delineate.</p><p><em>“NFTs lack of interoperability across platforms”</em></p><p>In this direction, the EIP-5606 specification is the first tangible attempt to address the interoperability aspect of NFTs and “true” ownership across platforms. It defines a standard “Multiverse NFT” that bundles the NFTs of other platforms.</p><h3>How does it work</h3><p>The EIP-5606 introduces the concept of Multiverse NFT, which represents a digital asset across multiple platforms. The Multiverse NFT contract defines a new kind of token that keeps the relationship between the unique digital asset and its associated platform-related counterpart (the EIP refers to them as delegated tokens).</p><p>The standard introduces the simple concept of the bundle. A bundle is essentially a set of delegated NFTs identified by a unique ID number (the multiverse token ID).</p><p>A publisher who intends to create a bundle of his NFTs created on different platforms has to “approve” them to the Multiverse NFT contract.</p><p>Then, the Publisher has to initialize the bundle. Once a bundle is initialized cannot be changed and:</p><ul><li>a new multiverse token is minted to the Publisher</li><li>the relationship between the Multiverse NFT and its delegated NFTs is stored on the blockchain</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6-YLlhJeYZ2AHPe6" /><figcaption>Multiverse NFT: bundle initialization</figcaption></figure><h4>Bundle</h4><p>The bundle operation applies to a Multiverse NFT. It transfers the ownership of the delegated tokens to the Multiverse contract itself. Of course, before executing the bundle function, it is critical that the delegate NFTs were “approved” by the owner to the Multiverse NFT contract.</p><p>Only the owner of the Multiverse NFT (or an address with the BUNDLER role) can call the bundle function.</p><p>After that, the Contract owns the delegated NFTs tied to the Multiverse Token (not necessarily all of them, but this will be clear after).</p><p>Now, the bundled Multiverse Token allows treating its delegated NFTs as a whole. The owner may sell it. Selling means that the new owner may use/resell the delegated NFTs.</p><h4>Unbundle</h4><p>The unbundle operation allows the Multiverse NFT owner to sell or use individually the delegated NFTs across any of the platforms. Essentially, after unbundling, the ownership of delegated NFTs is transferred back from the contract to the original owner. Only the owner is allowed to call the unbundle function.</p><h3>Reference implementation</h3><p>The reference implementation of EIP-5606 can be found at: <a href="https://eips.ethereum.org/assets/eip-5606/contracts/MultiverseNFT.sol">https://eips.ethereum.org/assets/eip-5606/contracts/MultiverseNFT.sol</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c79d531c35790d0e59d81f827f1e208d/href">https://medium.com/media/c79d531c35790d0e59d81f827f1e208d/href</a></iframe><p>The interface IMultiverseNFT defines a DelegatedData struct, where information about the delegate NFT tokens on each platform is contained.</p><pre>struct DelegateData {<br>        address contractAddress;<br>        uint256 tokenId;<br>        uint256 quantity;<br>    }</pre><p>The variables contractAddress, tokenId and quantity are able to differentiate either the EIP-721 or the EIP-1155 tokens (this standard is fully compatible with EIP-721 and EIP-1155).</p><p>Partial bundling or unbundling is allowed. In fact, bundle and unbundle functions accept an array of DelegateData structs. So, for example, also if a user initialised a bundle with three delegated NFTs, he can bundle or unbundle less than three at any time (of course, never more than three).</p><pre>abstract contract MultiverseNFT is<br>    IMultiverseNFT,<br>    AccessControl,<br>    ERC721Full,<br>    IERC1155Receiver</pre><p>The abstract contract MultiverseNFT extends:</p><ul><li>the IMultiverseNFT interface (of course)</li><li>an openzeppelin-based ERC-721 implementation (after all, the Multiverse NFT is an ERC-721 token as the others)</li><li>the IERC1155Receiver interface (to handle the receipt of the ERC1155 token type)</li><li>openzeppelin AccessControl (essentially to introduce the BUNDLER role)</li></ul><p>Information about the relationship between Multiverse NFTs and relative delegated is stored in the multiverseNFTDelegateData mapping.</p><pre>mapping(uint256 =&gt; DelegateData[]) public multiverseNFTDelegateData;</pre><p>Here, the Multiverse token ID maps to an array of delegated data structs.</p><p><strong>An important security consideration</strong>: as the transfer of ownership is realized by calling an external contract, reentrancy prevention measures should be applied.</p><h3>Final consideration</h3><p>Multiverse NFT allows treating the same digital asset on different platforms by the bundling/unbundling mechanism described before. Nevertheless, NFT fragmentation is still possible.</p><p>This is because the owner has the possibility to bundle or unbundle delegated NFTs selectively, detaching NFTs representing the same digital asset.</p><p>Considering a Multiverse NFT (already bundled) tied to 3 delegated NFTs (X, Y and Z), the following sequence of actions is possible:</p><ul><li>the owner unbundles only the NFT X</li><li>the owner sells individually the NFT X to BUYER A</li><li>BUYER A removes the approval of NFT X to the Multiverse contract</li></ul><p>Now, the owner can use or sell only NFT Y and NFT Z on their relative platforms. BUYER A can use or sell only NFT X. Now, also if the 3 NFTs logically refer to the same digital asset, they can be treated as separate objects.</p><p>Thank you for reading, I hope you enjoyed the article. Let me know what you think about it.</p><p>Read more from the <a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7"><strong>NFT Series</strong></a>.</p><h3>Reference</h3><p><a href="https://github.com/gaurangtorvekar">Gaurang Torvekar</a>, <a href="https://github.com/akhemraj">Khemraj Adhawade</a>, <a href="https://github.com/nikhilasrani">Nikhil Asrani</a>, “EIP-5606: Multiverse NFTs [DRAFT],” Ethereum Improvement Proposals, no. 5606, September 2022. [Online serial]. Available: <a href="https://eips.ethereum.org/EIPS/eip-5606.">https://eips.ethereum.org/EIPS/eip-5606.</a></p><blockquote>New to trading? Try <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">crypto trading bots</a> or <a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">copy trading</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7494bce2152" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/multiverse-nft-eip-5606-f7494bce2152">Multiverse NFT (EIP-5606)</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Selfdestruct: How To Destroy a Smart Contract]]></title>
            <link>https://medium.com/better-programming/selfdestruct-how-to-destroy-a-smart-contract-388a9ba51a94?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/388a9ba51a94</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Wed, 19 Oct 2022 18:17:02 GMT</pubDate>
            <atom:updated>2022-10-23T02:41:35.082Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding why and how to create a “mortal” smart contract while considering the relative security implications</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xmm35URpirS2pJDt" /><figcaption>Photo by <a href="https://unsplash.com/@emc?utm_source=medium&amp;utm_medium=referral">Eric Crawford</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What is a Smart Contract</h3><p>A “smart contract” account is simply a program that runs on the Ethereum blockchain and is defined by its code (the functions) and data (its state).</p><p>Smart contracts are not controlled by a user; instead, they are deployed to the network and run according to their programming. Users can then interact with a smart contract by submitting transactions that execute a function defined on the smart contract. The interactions with smart contracts are irreversible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/0*95Gs5LNCidvZj7ye" /><figcaption>Smart contract representation from <a href="https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf">Ethereum EVM illustrated</a></figcaption></figure><p>Once deployed on the network, smart contracts cannot be changed or deleted by default. However, it is possible to include a selfdestruct capability that would allow a smart contract to be “deleted,” erasing the code and its internal state (storage) and leaving a blank account.</p><h3>Why Destroy a Contract</h3><p>So, using the selfdestruct functionality enables developers to remove smart contracts from the Blockchain. But what are the reasons behind this drastic countermeasure?</p><p>To answer this question, it is helpful to read <a href="https://arxiv.org/pdf/2005.07908.pdf">Why Do Smart Contracts Self-Destruct?</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*pe5-RROvPSW-xVl8" /><figcaption><a href="https://arxiv.org/pdf/2005.07908.pdf">Reasons for Self-destruct and their distributions among 340 self-destructed smart contracts</a></figcaption></figure><p>In this study, 340 self-destructing contracts were discovered and analysed. By defining self-destructed contract as a “Predecessor” contract, and its upgraded version as a “Successor” contract, the authors identified five primary reasons why contracts were destroyed by comparing the difference between the “Predecessor” contract and the “Successor” contract.</p><p>They discovered that the need for functionality changes is at the top of the list, followed by the case when a contract contains a bug or exhibits undesirable behaviour.</p><p>Furthermore, Ethereum provides an incentive to remove smart contracts from the Blockchain. This transaction has a negative gas cost because the operation frees up space on the Blockchain by clearing all of the contract’s data. This negative gas deducts from the total gas cost of the transaction.</p><h3>How Does selfdestruct Work?</h3><p>The smart contract life begins with a creation transaction from an EOA or a contract account. The data payload of a transaction creating a smart contract is itself bytecode that runs the contract constructor (if present) to initialize the contract’s state.</p><p>On the other end, the final breath of a contract is its destruction. selfdestruct in Ethereum is an <a href="https://github.com/wolflo/evm-opcodes/blob/main/gas.md#ab-selfdestruct">OPCODE</a> at the EVM level, regardless of the language or client used.</p><p>This opcode is available as a high-level built-in function called selfdestruct, which only accepts one argument: the address to which any remaining ether in the contract account has to be sent.</p><pre>selfdestruct(address recipient);</pre><p>An important note is that a developer must explicitly add this command to the contract. Otherwise, the smart contract will never be deletable.</p><p>After the contract’s destruction, any transactions sent to that account address do not result in any code execution because there is no longer any code there to execute.</p><p>Deleting a contract does not remove the transaction history (past) of the contract since the blockchain itself is immutable.</p><blockquote>“So using selfdestruct is not the same as deleting data from a hard disk.”</blockquote><h3>Making a Smart Contract “Mortal”</h3><p>Now, we will create a straightforward smart contract with a constructor and a selfdestruct command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fcdc666c5e6fa6a89fe57a5fb9787ee0/href">https://medium.com/media/fcdc666c5e6fa6a89fe57a5fb9787ee0/href</a></iframe><p>Usually, it’s desirable that the selfdestruct command has to be callable only by the account that originally created the contract. For this reason, the address type variable named owner is used. In fact, at contract creation, the constructor assigns this variable to the msg.sender.</p><p>The contract has a minimal destroy() function. A require statement ensures that only the owner can run this function. It checks that the owner is the caller, otherwise fails. If the check is ok, the contract will self-destruct and send any remaining balance to the owner’s address.</p><p>The following tests show the intended behaviour of a destructible contract.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/928e2ac6d7a43cf34bc49f1d69788e31/href">https://medium.com/media/928e2ac6d7a43cf34bc49f1d69788e31/href</a></iframe><ul><li>Deployment: deploys the contract</li><li>Get owner: checks if the owner of the deployed contract is correct</li><li>Call destroy fails: checks if the destroy function is callable only from the contract’s owner</li><li>Call destroy succeeds: calls the destroy function from the owner account</li><li>Get contract fails: checks that the contract code is not available anymore</li></ul><h3>Security Implications</h3><p>There is a common misconception about smart contracts. In fact, many inexperienced Solidity developers mistakenly believe that a contract can only obtain ethers through payable functions.</p><blockquote>That is not true!</blockquote><p>As seen before, any contract that implements the selfdestruct function can send all its ethers to a specific address. If the address is a contract address, the transfer of ethers occurs without calling any functions (including the fallback).</p><p>So, the selfdestruct function is a way to forcibly send ethers to any contract regardless of any code implemented inside it (even if the contract lacks payable functions).</p><p>This behaviour implies an attacker can easily force ether to be sent to a target contract in three simple steps:</p><ol><li>can create a contract with a selfdestruct function</li><li>send ether to it</li><li>call selfdestruct(targetContract)</li></ol><p>This vulnerability leads to false assumptions about the actual ether balance of a contract.</p><p>There is nothing better than an example game contract to clarify how this situation can lead to unwanted effects.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f62576e6a4f5c5823ab6fcbb7dba505f/href">https://medium.com/media/f62576e6a4f5c5823ab6fcbb7dba505f/href</a></iframe><p>This contract represents a simple game and is not intended to be used in practice. A user who wants to play sends 0.5 ether to the contract (calling the play() function). They hope to be the one that reaches one of three milestones. Milestones are determined amounts of ethers owned over time by the contract. The first user to reach a milestone can claim a reward in ether when the game has ended. The game ends when the final milestone is reached.</p><p>An attacker could send a small amount of ether (also 0.000001 is sufficient) via the selfdestruct function of a contract deployed by himself. This simple operation prevents any future player from reaching a milestone. This is because the currentBalance, as calculated at line 17, will never be a multiple of 0.5 ether thanks to this small ether contribution to the contract balance (note that players are forced to send only 0.5 ether increments).</p><p>The problem here is the poor use of this.balance at line 17. Contract logic should avoid being dependent on the contract’s balance as it can be maliciously manipulated.</p><p>A possible solution could be to use a self-defined variable (e.g. depositedEth) and increment it to track the deposited ether safely. This variable will not be influenced by a selfdestruct call because it no longer references this.balance.</p><pre>uint currentBalance = depositedEth + msg.value;</pre><p>Thank you for reading. I hope you enjoyed the article.</p><p>Let me know what you think about it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=388a9ba51a94" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/selfdestruct-how-to-destroy-a-smart-contract-388a9ba51a94">Selfdestruct: How To Destroy a Smart Contract</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The imitation game reloaded]]></title>
            <link>https://medium.com/the-techlife/the-imitation-game-reloaded-e1af2194ecd8?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1af2194ecd8</guid>
            <category><![CDATA[turing-test]]></category>
            <category><![CDATA[challenge]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Tue, 27 Sep 2022 12:52:08 GMT</pubDate>
            <atom:updated>2022-10-26T06:46:44.394Z</atom:updated>
            <content:encoded><![CDATA[<h3>Man Vs Machine: who is the winner?</h3><h4>Is artificial intelligence so advanced? I challenge you to guess if something is written by a human or an AI writer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HqFALhSyNjPjPPOL" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>The challenge</h3><p>Artificial intelligence is nowadays a pervasive aspect of our everyday lives, even if we no longer notice it. The progress in this field has grown so much in the last few years that almost every device or digital service exploits the technological results of this discipline.</p><p>I don’t want to dwell too much on artificial intelligence’s definition and its applications (why will be clearer later), but rather, I have a question for you:</p><blockquote>Are you able to distinguish an AI from a human-made artefact?</blockquote><p>Now, I’m going to explain more in detail what I mean.</p><p>Among the millions of artificial intelligence tools and applications, let’s focus on AI writing software. Usually, this type of tool is mostly used to assist writers, but it can be used to produce a text entirely written by a machine, without human intervention.</p><p>So, this is a sort of simplified <a href="https://en.wikipedia.org/wiki/Turing_test"><strong>Turing Test</strong></a>, where I challenge you to guess who is the human and who is the machine only by reading a text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*b5MOk-i75L1jaFaT" /><figcaption>The imitation game — Image by <a href="https://upload.wikimedia.org/wikipedia/commons/5/55/Turing_test_diagram.png">Wikimedia</a></figcaption></figure><h3>Set up the challenge</h3><p>Below, I will figure out how I designed this challenge and which tools I used.</p><h4>The topic</h4><p>Of course, the topic of the text artefact is the first thing to decide. After some thought, an exciting idea emerged from my mind: an artificial intelligence speaking about artificial intelligence itself as a sort of autopoietic phenomenon. Why not?</p><blockquote>The choosen topic is “Artificial Intelligence”… let’s continue!</blockquote><h3>Content length</h3><p>The text’s length has to be a compromise because too short text might be very hard to distinguish, while too long content is not compatible with the average patience of a reader.</p><blockquote>I think 250 words is a good compromise</blockquote><h3>The machine</h3><p>When I started searching for AI writers, I was surprised at how many solutions exist. So, I needed some criteria to restrict my search. First of all, I need the content creation feature (so I excluded all tools that are exclusively writer’s assistants). Then, I didn’t want to pay for a tool to use once, so I filtered out all free solutions or those with a free trial.</p><blockquote>The choice fell on <a href="https://jenni.ai/">Jenny</a></blockquote><p>Jenny is an interesting tool able to generate content autonomously, with a free trial possibility limited to 500 words of generated text (which is more than enough for my purpose). So I configured the tool as shown below, with:</p><ul><li>Type: Blog</li><li>Topic description: “Write a blog about <strong><em>artificial intelligence application in real life</em></strong>”</li><li>Style: friendly</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*kIBU3RLGiaFGJ9ZA" /><figcaption>Jenny configuration</figcaption></figure><p>Then, Jenny started writing a sentence that I accepted. After the first sentence, I accepted almost all the other subsequent sentences until reaching 250 words.</p><p><strong>Fun fact</strong>: in the end, to my big surprise, the generated text was impossible to copy, and so I had to do a trick to copy the text that I won’t reveal here :-)</p><h4>The human</h4><p>For the human part, I needed an article written by someone on artificial intelligence. The obvious way to find an article is by doing a Google search</p><p>So, on September 21, 2022, I googled the same sentence used for the topic description of the AI writer: “<strong><em>artificial intelligence application in real life</em></strong>”. Then, I reached page 3 (I must confess that it was the first time I visited the third page of Google results).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3eeoNHlQpRGNbD7s" /><figcaption>Google search result</figcaption></figure><blockquote>I chose the result highlighted in red in the figure</blockquote><p>Then, I took an excerpt of about 250 words from the article (now that you know the article I picked, please don’t cheat by reading it before your guess).</p><h3>It’s time to guess</h3><p>To make your choice clearer, I introduced two fictional authors: Olivia and Ed. Now, I ask you to read the following contents and try to guess who is human and who is the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/144/1*HPqb2Bi6X85Z7HCYh9lRug.png" /></figure><p>“<em>Artificial intelligence is a term that refers to the ability of machines to perform tasks normally requiring human intelligence, such as visual perception, speech recognition, decision-making, and translation between languages. AI is already being used in many different fields, including healthcare, finance, manufacturing and marketing. It can be used for a variety of applications, including fraud detection, sales forecasting, inventory optimization, customer sentiment analysis, and spam detection. Machine learning can help companies to improve processes, products, and services by detecting patterns and suggesting improvements. For example, machine learning may help a company to identify inefficiencies in their supply chain so that they can take steps to reduce costs and improve efficiency. Or it may recommend improvements to a company’s advertising strategy to increase their conversion rate. Facebook uses machine learning to help customers find relevant content and friends. The company has also started using machine learning to help identify hate speech in online posts. This allows them to respond quickly and remove offensive content before they negatively affect their users. Netflix also uses machine learning to recommend movies to its customers based on their viewing history and ratings provided by other users. Google uses machine learning to structure its results, for its search engine and for YouTube’s recommendation system. It also uses machine learning to help self-driving cars to navigate unfamiliar roads. Amazon.com uses machine learning to help customers make product recommendations and to suggest products based on a customer’s previous purchases.</em>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/143/1*KrJ6GIXAAFkLbk_1qGuWag.png" /></figure><p>“<em>Artificial intelligence is the simulation of human intelligence processes by machines, especially computer systems. Specific applications of AI include expert systems, natural language processing, speech recognition and machine vision. AI is important because it can give enterprises insights into their operations that they may not have been aware of previously and because, in some cases, AI can perform tasks better than humans. Particularly when it comes to repetitive, detail-oriented tasks like analyzing large numbers of legal documents to ensure relevant fields are filled in properly, AI tools often complete jobs quickly and with relatively few errors. This has helped fuel an explosion in efficiency and opened the door to entirely new business opportunities for some larger enterprises. Prior to the current wave of AI, it would have been hard to imagine using computer software to connect riders to taxis, but today Uber has become one of the largest companies in the world by doing just that. It utilizes sophisticated machine learning algorithms to predict when people are likely to need rides in certain areas, which helps proactively get drivers on the road before they’re needed. As another example, Google has become one of the largest players for a range of online services by using machine learning to understand how people use their services and then improving them. In 2017, the company’s CEO, Sundar Pichai, pronounced that Google would operate as an “AI first” company. Today’s largest and most successful enterprises have used AI to improve their operations and gain advantage on their competitors.</em>”</p><blockquote>So, who is the artificial intelligence?</blockquote><h3>Check your guess</h3><p>It’s time to reveal the truth.</p><blockquote>Drumroll…</blockquote><blockquote>Drumroll…</blockquote><blockquote>Drumroll…</blockquote><p><strong>Olivia</strong> is the artificial intelligence, while Ed is the human, and his article is available at: <a href="https://www.techtarget.com/searchenterpriseai/definition/AI-Artificial-Intelligence">https://www.techtarget.com/searchenterpriseai/definition/AI-Artificial-Intelligence</a></p><p><strong>Fun fact: </strong>as you can see on <a href="https://www.techtarget.com/contributor/Ed-Burns">TechTarget</a>, Ed’s photo is real and his name is really Ed, while Olivia’s photo is a random Artificial Intelligence generated image obtained on <a href="https://thispersondoesnotexist.com/">https://thispersondoesnotexist.com/</a>.</p><h3>Conclusion</h3><p>In my opinion, AI technology has improved significantly in the last few years. What do you think about it? Maybe in the next future, we will not be able to tell if something is written by a human or an AI.</p><blockquote>Maybe this article was written by an AI too?</blockquote><p>Anyway, I’m very curious to know your guess and the motivations behind it. Tell me in the comments what your choice was and why you made it.</p><blockquote>New to trading? Try <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">crypto trading bots</a> or <a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">copy trading</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1af2194ecd8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-techlife/the-imitation-game-reloaded-e1af2194ecd8">The imitation game reloaded</a> was originally published in <a href="https://medium.com/the-techlife">The Techlife</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain Oracles: why do you need them]]></title>
            <link>https://medium.com/coinmonks/oracles-bring-the-external-world-to-the-blockchain-59c3bf9a6daf?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/59c3bf9a6daf</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Thu, 15 Sep 2022 15:17:15 GMT</pubDate>
            <atom:updated>2022-09-19T07:16:35.308Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understand why smart contracts cannot manage real-world information and how Oracles try to solve this problem.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WGzANTto5JMNW8JW.jpg" /></figure><h3>Why Oracles</h3><p>The term “Oracle” comes from Greek mythology, where it referred to a person who could see events of the future by communicating with the gods.</p><p>An oracle in the context of blockchains is a system that can provide Ethereum smart contracts with external data sources.</p><blockquote>But why smart contracts are unable to manage off-chain/real-world information?</blockquote><p>The Ethereum Virtual Machine is a critical component of the Ethereum platform, with the ability to execute programs and update the state of Ethereum on any node in the decentralized network while adhering to consensus rules.</p><p>To maintain consensus, EVM execution must be completely deterministic and based solely on the Ethereum state and signed transactions. This is because each node on the network has to be able to produce the same result when a transaction is executed. If execution at different nodes gives different outputs, consensus will never be reached.</p><blockquote>Non-determinism leads to failure in consensus</blockquote><p>This has two significant implications:</p><ul><li>there can be no intrinsic source of randomness,</li><li>external data can only be introduced as the data payload of a transaction.</li></ul><p>Extrinsic information, such as randomness sources, price information, weather forecasts, and so on, can only be included as data in transactions sent to the network. However, such information cannot be trusted because it comes from untrustworthy sources. As a result, we have simply postponed the problem. An Oracle tries to solve this problem.</p><h3>Oracles design patterns</h3><p>The first thing to repeat and repeat continuously is that Oracle is not a product or a specific smart contract implementation, but rather:</p><blockquote>Oracle is a design pattern!</blockquote><p>The key functions of oracles are the capability of:</p><ul><li>Gather information from an off-chain source</li><li>Send the data on-chain using a signed message</li><li>Put the data in the storage of a smart contract to make it available</li></ul><p>Once the data is in the storage of a smart contract, other smart contracts can just use message calls to access it.</p><p>The three major options for designing an Oracle are:</p><ul><li>immediate-read</li><li>publish-subscribe</li><li>request-response</li></ul><h4>Immediate-read Oracles</h4><p>This kind of Oracle stores data in its contract storage only once and the data is updated very rarely. Those who wish to query this type of data typically do so on a “just-in-time” basis; the lookup is performed when the information is required and may never be repeated.</p><p>Examples of these Oracles include those that store information issued by organizations, such as academic certificates, institutional documents, self-sovereign IDs, etc.</p><p>For efficiency and most of all, privacy reasons, a recommended practice is not to store the raw data that the oracle is serving in the smart contract’s storage.</p><p>An effective way to design such a service would be to hash the data and only store the hash in the smart contract’s storage.</p><h4>Publish-subscribe Oracles</h4><p>When data is expected to change regularly and frequently, then a publish-subscribe Oracle could be the solution. It follows a similar pattern to RSS feeds in that the oracle is updated with fresh information and a “flag” indicates that new data is available to those who consider themselves “subscribed.”</p><p>To determine whether the most recent information has changed, interested parties must either poll or listen for updates of the oracle contracts.</p><p>While polling is very inefficient in the world of web servers, in the context of a blockchain ecosystem, polling for data changes is a simple local call to a synced client. Then, Ethereum event logs make it particularly easy for applications to look out for Oracle updates.</p><p>Examples of these Oracles include those that manage information such as price feeds, weather information, economic or social statistics, traffic data, etc.</p><h4>Request-response Oracles</h4><p>This kind of oracle fits well when the data space is too large to be kept in a smart contract, and users are only intended to consume a small portion of the total dataset at a time.</p><p>It is usually implemented as a two components system with:</p><ul><li>on-chain smart contracts</li><li>off-chain infrastructure</li></ul><p>The data request is typically an asynchronous process involving several steps.</p><p>First of all, an EOA interacts with a decentralized application <strong>(1)</strong>, which is a call to a function defined in the Oracle smart contract with some associated arguments such as a callback function and scheduling parameters. This function realizes a blockchain transaction <strong>(2)</strong>. Once this transaction has been validated, the off-chain infrastructure comes into play. It is used to monitor the Oracle request <strong>(3)</strong> (that can be observed as an EVM event emitted by the Oracle contract, or as a state change). The arguments are used to perform the actual query of the off-chain data source <strong>(4)</strong>. Finally, the resulting data is delivered in a transaction to the decentralized application that made the request <strong>(5)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/0*ugugnIxn36jIpyG5" /></figure><p>The oracle may also require payment for processing the request, gas payment for the callback, and permissions to access the requested data.</p><h3>Oracle example</h3><p>Here is a basic example of a request-response Oracle implementation by <a href="https://provable.xyz/">Provable™</a>. The original code can be found <a href="https://github.com/provable-things/ethereum-examples/blob/master/solidity/DieselPrice.sol">here</a> on GitHub.</p><p>To integrate with Provable, the contract <strong>DieselPrice</strong> must be a child<br>of <strong>usingProvable</strong>. The usingProvable contract is defined in the <a href="https://github.com/provable-things/ethereum-api/blob/master/provableAPI.sol"><strong>provableAPI.sol</strong></a> file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3cd36d8e332e32fd68d18bb05f3cd3c/href">https://medium.com/media/a3cd36d8e332e32fd68d18bb05f3cd3c/href</a></iframe><p>The EOA requests the data by calling the <strong>update()</strong> contract function.</p><p>The data is actually requested by the <strong>provable_query</strong> function. This is an overloaded function that expects at least two arguments:</p><ul><li>the supported data source to use (URL in this case, but also WolframAlpha, IPFS, or others are available)</li><li>the argument for the given data source, which may include the use of<br>JSON or XML parsing helpers</li></ul><p>Once the data has been retrieved from the desired external source, the <strong>__callback()</strong> function is called by an account controlled by Provable that is allowed to call the callback; it passes in the response value and a unique <strong>_myId</strong> argument, which, for example, can be used to handle and track multiple pending callbacks from Provable.</p><h3>Conclusions</h3><p>Oracles play an important role in smart contract execution by bringing external facts into the equation. On the other hand, they introduce a potentially huge risk. With this approach, one has to trust not only the Oracle company offering this service but also the service provider (fueleconomy.gov of the example). The Oracle service company can be either malicious or the data can be corrupted. In this way, the contract they feed is exposed to potentially false input, compromising its execution.</p><blockquote>New to trading? Try <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">crypto trading bots</a> or <a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">copy trading</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59c3bf9a6daf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/oracles-bring-the-external-world-to-the-blockchain-59c3bf9a6daf">Blockchain Oracles: why do you need them</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Soulbound NFT (EIP-4671)]]></title>
            <link>https://medium.com/coinmonks/soulbound-nft-eip-4671-57674e705088?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/57674e705088</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[soulbound-tokens]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Tue, 06 Sep 2022 06:33:29 GMT</pubDate>
            <atom:updated>2022-10-25T17:07:12.344Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7">NFT Series</a></h4><h4>Trying to understand why and when a Non-tradable token is useful.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xcFOWqmjteJ0kRrSNjUe0Q.jpeg" /></figure><h3>Introduction</h3><p>Especially in the last year, interest in NFTs has grown dramatically. The reasons for this interest are many, but this is not the aspect that I want to deepen in this article. The point is that more and more people have become familiar with the concept of NFT.</p><p>It can represent ownership over digital or physical assets and fits very well in use cases where it is used as:</p><ul><li><strong>Access NFTs</strong>, to grant their owners entry and access to communities, events, or experiences in both the digital and physical world</li><li><strong>Engagement NFTs</strong>, when are used to engage with brands and other users within the community</li><li><strong>Gamified NFTs</strong>, where are tied to elements that are part of a gaming universe</li><li><strong>Asset NFTs</strong>, when encompasses the ownership of a unique value-based digital or physical asset</li></ul><p>About NFT Classification, it is worth reading <a href="https://medium.com/u/7694a4ec6a82">Miguel Cienfuegos</a>’s article <a href="https://medium.com/blockchain-biz/nft-utility-classification-current-and-prospective-trends-3fe0b0c5b43a">NFT Utility Classification — current and prospective trends</a>, where a very useful and well-defined taxonomy of NFT is shown.</p><h3>Motivation</h3><p>But what do all these use cases have in common?</p><p>In these scenarios, the NFTs are always tradeable items, with the peculiarity that they can be transferred or sold by the owner.</p><p>But in this way, a typical case is not covered, when the asset represented by the NFT is “<em>soulbound</em>”.</p><p>What does it mean “<strong>soulbound</strong>”?</p><p>It simply implies that once picked up, the NFT cannot be sold or transferred to another person.</p><p>With this concept in mind, a very interesting EIP was created on January 2022 by <a href="https://ethereum-magicians.org/u/omaraflak/summary">Omar Aflak</a>: <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4671.md">EIP 4671 — Non-Tradable Tokens Standard</a>.</p><p>As he states:</p><blockquote>“…non-tradable tokens … don’t have monetary value, they are personally delivered to you, and they only serve as a proof of possession/achievement”</blockquote><p>The motivation behind the Non-tradable tokens (or NTT) is to address all the cases where a token is not tradable. So, when it symbolises intrinsically personal possessions (material or immaterial), such as university diplomas, online training certificates, government-issued documents (national id, driving license, visa, wedding, etc.), labels, attendance to events and so on.</p><p>But, in my opinion, use cases involving certificates or documents are very complex to address with the NTT approach, taking into account that privacy and security are the key elements in this context. The current most viable way is delineated in the context of the Self-Sovereign Identity (SSI) initiatives as the<a href="https://ssimeetup.org/understanding-european-self-sovereign-identity-framework-essif-daniel-du-seuil-carlos-pastor-webinar-32/"> European Self-Sovereign Identity Framework (ESSIF)</a>.</p><p>On another side, soon after the creation of the EIP, <a href="https://medium.com/u/587a00dbce51">Vitalik Buterin</a> wrote about the argument in his blog post “<a href="https://vitalik.ca/general/2022/01/26/soulbound.html">Soulbound</a>”. Here, he focuses on the concept of <strong>NFT signaling, i.e.,</strong> a person must prove some kind of skill to acquire an NFT. But, because NFTs are tradable items, you cannot tell if someone did X personally or if they simply paid someone else to do X.</p><p>An NFT, as is, just signals wealth, so, this is the reason why the world needs Non-tradable tokens.</p><p>The post continues by pointing out the importance of well-defined governance for non-transferability and the need to have very clear ideas on how to manage and preserve the privacy of users. These may be the reasons why Vitalik indicates “<em>proof of attendance</em>” as an excellent use case of NFT that works better if it could be soulbound. The use case is simple and well delineated, as the NFT simply represents the idea that the owner personally participated in some event.</p><h3>The reference implementation</h3><p>Anyway, I’m curious to look at the current status of the reference implementation of the EIP (currently in draft status).</p><p>An NTT contract is seen as representing one type of certificate delivered by one authority. The choice here is to not extend the ERC721 standard and override the transfer methods to do nothing, so this is the <a href="https://github.com/ethereum/EIPs/blob/master/assets/eip-4671/IERC4671.sol">IERC4671 interface</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5085b9bd38d198ab0d69055a664954a6/href">https://medium.com/media/5085b9bd38d198ab0d69055a664954a6/href</a></iframe><p>This interface has the `balanceOf` and `ownerOf` methods in common with the IERC721, but in addition, it was thought to manage the revocation of a token. For this reason, the methods `isValid` and `hasValid` are present:</p><ul><li>`isValid`: checks if a token hasn’t been revoked</li><li>`hasValid`: checks if an address owns a valid token in the contract</li></ul><p>So, whoever delivers an NTT has the faculty to revoke it, but cannot delete a token.</p><p>Some interesting extensions were proposed:</p><ul><li><strong>IERC4671Metadata</strong>: allows to add metadata linked to each token and it is exactly the same as the <em>IERC721Metadata</em> interface</li><li><strong>IERC4671Enumerable</strong>: allows enumerating the tokens of an owner (very similar to <em>IERC721Enumerable</em>)</li><li><strong>IERC4671Delegate</strong>: allows delegation rights of token minting</li><li><strong>IERC4671Consensus</strong>: allows minting/revocation of tokens based on a consensus of a predefined set of addresses</li><li><strong>IERC4671Pull</strong>: allows a token owner to pull his token to another of his wallets</li></ul><p>The <a href="https://github.com/ethereum/EIPs/blob/master/assets/eip-4671/ERC4671.sol">ERC4671 reference implementation</a> extends <em>IERC4671</em>, <em>IERC4671Metadata</em>, <em>IERC4671Enumerable</em> and <em>ERC165</em> interfaces.</p><pre>abstract contract ERC4671 is IERC4671, IERC4671Metadata, IERC4671Enumerable, ERC165</pre><p>A struct `Token` is present to store token’s information as the issuer, the owner and the validity of the token:</p><pre>struct Token {<br>    address issuer;<br>    address owner;<br>    bool valid;<br>}</pre><p>Then, the mappings from `tokenId` to `Token` and from owner’s address to its owned tokens are present:</p><pre>mapping(uint256 =&gt; Token) private _tokens;</pre><pre>mapping(address =&gt; uint256[]) private _indexedTokenIds;</pre><p>Relevant methods are:</p><ul><li>`_revoke`: to mark a token as revoked</li><li>`_mint`: to mint a new token</li><li>`_isCreator`: True if the caller is the contract’s creator, false otherwise</li></ul><h3>A demo application</h3><p>On Vercel at <a href="https://non-tradable-token.vercel.app/">https://non-tradable-token.vercel.app/</a> is possible to interact with a demo ERC4671 contract implementation.</p><p>The idea is that the NTT token is used as proof of having visited the website. Everyone can connect to the site and get a token or check the token ownership.</p><p>The code of the contract is the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db7d93125f68018ef6a7c7a74dcfc59a/href">https://medium.com/media/db7d93125f68018ef6a7c7a74dcfc59a/href</a></iframe><p>The relevant feature is that only the creator (that is the deployer of the contract) can mint or revoke a token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oJ4xw-9s5JipEOYO" /></figure><p>So, after connecting the wallet to the website, is possible to:</p><ul><li><strong>check</strong> if you have a valid token</li><li><strong>get</strong> a valid token, only if you don’t own any (the minting transaction will be triggered by the backend)</li></ul><p>All the application lives on Goerli testnet and the code can be found at <a href="https://github.com/donpabblo/non-tradable-token">https://github.com/donpabblo/non-tradable-token</a></p><p>Thank you for reading, I hope you enjoyed the article. Let me know what you think about it.</p><p>Read more from the <a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7"><strong>NFT Series</strong></a>.</p><h3>References</h3><p><a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4671.md">Eip-4671</a> on GitHub<br><a href="https://ethereum-magicians.org/t/eip-4671-non-tradable-token/7976">EIP-4671: Non-tradable Token</a> on Ethereum Magicians forum<br><a href="https://vitalik.ca/general/2022/01/26/soulbound.html">Soulbound</a> by Vitalik Buterin<br><a href="https://github.com/ethereum/EIPs/tree/master/assets/eip-4671">Reference implementation</a> on GitHub</p><blockquote>New to trading? Try <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">crypto trading bots</a> or <a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">copy trading</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57674e705088" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/soulbound-nft-eip-4671-57674e705088">Soulbound NFT (EIP-4671)</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You do not completely own your NFTs]]></title>
            <link>https://medium.com/coinmonks/you-do-not-completely-own-your-nfts-a571ec596667?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/a571ec596667</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[ledger]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[nft]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Mon, 22 Aug 2022 13:18:14 GMT</pubDate>
            <atom:updated>2022-10-25T17:07:38.412Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7">NFT Series</a></h4><h4>Recognise the difference between NFT and ETH ownership.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fAbfywTqy-rW_Vlo" /><figcaption>Photo by <a href="https://unsplash.com/@joseantoniogall?utm_source=medium&amp;utm_medium=referral">Jose Antonio Gallego Vázquez</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Consider purchasing a very costly NFT on OpenSea, such as <a href="https://opensea.io/assets/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/8585">Bored Ape #8585</a>, which is now selling for 777,7 ETH ($1.217.971,52) at the time of writing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*MOhHP4OfFYhciNdM" /><figcaption>Source: <a href="https://img.seadn.io/files/f5e46e461e5b1769b29cc30d8bc2191d.png?fit=max&amp;w=600">https://img.seadn.io/files/f5e46e461e5b1769b29cc30d8bc2191d.png</a></figcaption></figure><p>Are you confident that this precious NFT is completely in your hands and that it is under your full control, just as your Ethers?</p><p>We need to grasp the following concepts to comprehend why the two types of ownership are so dissimilar:</p><ul><li>Ethereum account<br>– Smart Contract<br>– Externally Owned Account (EOA)</li><li>Wallet</li><li>NFT</li></ul><h3><strong>Ethereum account</strong></h3><p>An Ethereum account is an entity identified by a unique address that can hold Ethers and send transactions on Ethereum. Accounts can be user-controlled or deployed as smart contracts.</p><h4><strong>Smart Contract</strong></h4><p>A “smart contract” account is simply a program with some functions and data (its state).</p><p>Smart contracts accounts are not controlled by a user, instead, they are deployed to the network and run according to their programming. User accounts (later referred to as Externally Owned Accounts) can then interact with a smart contract by submitting transactions that execute a function defined on the smart contract.</p><p>The status of a smart contract is stored on the Ethereum ledger and is essentially associated with four pieces of information:</p><ul><li><strong>nonce</strong>: a counter that indicates the number of transactions sent from the account</li><li><strong>balance</strong>: the number of wei owned by the account (1 ETH is 1e+18 wei)</li><li><strong>codeHash</strong>: represents the programming code of the smart contract</li><li><strong>storageHash</strong>: represents the storage contents of the smart contract</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*Tty_FfjYmxMzgMTkOKNjgA.png" /><figcaption>Diagram adapted from <a href="https://ethereum.org/en/developers/docs/accounts/">ETHEREUM ACCOUNTS</a></figcaption></figure><p>If you are curious about how an account status is stored on the blockchain, I suggest two exciting but challenging readings:</p><ul><li><a href="https://blog.ethereum.org/2015/11/15/merkling-in-ethereum/">Merkling in Ethereum</a> by <a href="https://medium.com/@VitalikButerin">Vitalik Buterin</a></li><li><a href="https://medium.com/codechain/modified-merkle-patricia-trie-how-ethereum-saves-a-state-e6d7555078dd">Modified Merkle Patricia Trie — How Ethereum saves a state</a> by <a href="https://medium.com/@kky2455?source=post_page-----e6d7555078dd--------------------------------">Kiyun Kim</a></li></ul><h4><strong>Externally Owned Account</strong></h4><p>An EOA is essentially composed of a public and private cryptographic key pair.</p><p>A user holds a private key that is used to sign transactions to receive and send ETH or interact with deployed smart contracts. The signing mechanism prevents malicious actors from broadcasting fake transactions.</p><p>The status of each EOA is stored on the Ethereum ledger and has two relevant information associated with it:</p><ul><li><strong>nonce</strong></li><li><strong>balance</strong></li></ul><h3><strong>Wallet</strong></h3><p>A wallet is nothing more than an interface or software program that allows you to interact with your Ethereum Externally Owned Account.</p><h3><strong>NFT</strong></h3><p>A non-fungible token (NFT) is a uniquely identifiable digital asset stored in a blockchain. Unlike cryptocurrencies, which are fungible, an NFT is unique.</p><p>The ownership of an NFT is registered in the blockchain, but not in the same way as your Ethers balance.</p><p>The following image shows where the amount of Ethers owned by an EOA is stored on the blockchain (the red square).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*2qWGIx5nMQUmKWy1sVWkUA.png" /><figcaption>Where Ether’s balance is stored</figcaption></figure><p>While an EOA’s Ethers balance is directly related to the account status, things are different for NFTs.</p><p>The difference is that an NFT lives in a Smart contract.</p><p>This is clear if we look at an ERC721 implementation. Let’s take for example a snippet from the OpenZeppelin implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*1sKtmaAxI9Wp1oohKk-lDQ.png" /><figcaption>Source: <a href="https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol">openzeppelin-contracts</a></figcaption></figure><p>At line 30 there is a mapping from NFT unique identifier to the owner, so the Smart Contract keeps track of who owns which token.</p><p>This means that the ownership of an NFT is stored in the Smart Contract storage space and is subject to the rules implemented by that smart contract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*wykPbWNODFIsXAVR8zyEtQ.png" /><figcaption>Where NFT’s ownership is stored</figcaption></figure><h3><strong>Conclusions</strong></h3><p>You should be aware that you do not fully own an NFT even after purchasing it. The original owner could still have some control over it, this is because the ownership of “your” NFT is based on a blockchain-based smart contract registry.</p><p>Therefore, depending on how the smart contract has been implemented, the original owner may be able to deny you access to it, take it away from you, or even burn it without your permission.</p><p>So, if you’re considering purchasing an NFT, bear these aspects in mind. Make sure you comprehend how the ownership works for that NFT, and make sure you’re at ease with the limitations that come with it.</p><p>Thank you for reading, I hope you enjoyed the article. Let me know what you think about it.</p><p>Read more from the <a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7"><strong>NFT Series</strong></a>.</p><blockquote>New to trading? Try <a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">crypto trading bots</a> or <a href="https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c">copy trading</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a571ec596667" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/you-do-not-completely-own-your-nfts-a571ec596667">You do not completely own your NFTs</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Burn an NFT]]></title>
            <link>https://medium.com/better-programming/how-to-burn-an-nft-c306c9cb6df?source=rss-e0c1a837d478------2</link>
            <guid isPermaLink="false">https://medium.com/p/c306c9cb6df</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Paolo Servillo]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 19:41:24 GMT</pubDate>
            <atom:updated>2022-10-25T17:08:23.938Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7">NFT Series</a></h4><h4>With an ERC721 Solidity contract</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VbfI8XDgWf-l4KQv" /><figcaption>Photo by <a href="https://unsplash.com/@yaoqiqiqilai?utm_source=medium&amp;utm_medium=referral">Yaoqi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>What is an NFT</strong></h3><p>A non-fungible token (NFT) is a uniquely identifiable digital asset stored in a blockchain. Unlike cryptocurrencies, which are fungible, an NFT is unique.</p><p>The ownership of an NFT is registered in the blockchain and can be transferred by the owner, enabling the sale and exchange of NFTs.</p><p>NFTs typically refer to digital files (images, videos, or others), and the NFT’s market value is tied to the digital file it refers to.</p><p>So, if NFTs are valuable digital assets, why should I burn them?</p><h3><strong>Why Burn an NFT</strong></h3><p>One reason would be the hope to make an NFT of a specific collection more valuable by making it rarer. For example, someone who owns all ten NFTs of a soccer player figurine may decide to destroy all except one to increase the value of the remaining one.</p><p>But, more frequently, companies:</p><ul><li>offer owners the chance to burn their NFTs in exchange for physical products or an “upgraded” version of the NFT</li><li>urge people to purchase NFTs of a drop rapidly by announcing that they would destroy all unsold NFTs after a specific date</li><li>eliminate unsold or problematic NFTs</li></ul><h3><strong>How to Burn</strong></h3><p>The weird thing is that the <a href="https://eips.ethereum.org/EIPS/eip-721">EIP-721</a> states:</p><blockquote>“…destruction of NFTs (“burning”) is not included in the specification. Your contract may implement these by other means.”</blockquote><p>OK, let&#39;s discuss the burning feature!</p><p>We need to start from an ERC-721 implementation. The OpenZeppelin <a href="https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol">ERC721</a> is one of the most widely utilized implementations.</p><p>This is a snippet of the contract code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f36eec4a1e4c3f6b6f060eebf60f8cda/href">https://medium.com/media/f36eec4a1e4c3f6b6f060eebf60f8cda/href</a></iframe><p>As we can see, this implementation already provides an internal _burn function. The function accepts the token id as the input and does the following:</p><ul><li>gets the NFT&#39;s owner</li><li>calls the _beforeTokenTransfer hook function (what a hook is will be clearer later)</li><li>clears all approvals for the token</li><li>decreases the owner balance</li><li>emits the Transfer event</li><li>calls the _afterTokenTransfer hook function</li></ul><p>So, the job is done?</p><p>Wait, something is missing!</p><p>The function does not check if the sender is authorized to operate on the token. Let’s do it ourselves!</p><p>For this purpose, we can use the _beforeTokenTransfer hook function.</p><p>As stated in <a href="https://docs.openzeppelin.com/contracts/3.x/extending-contracts#using-hooks">OpenZeppelin documentation</a>:</p><blockquote>“Hooks are simply functions that are called before or after some action takes place. They provide a centralized point to hook into and extend the original behavior.”</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b59b8c4d8d1fa330c38c9344fbd53188/href">https://medium.com/media/b59b8c4d8d1fa330c38c9344fbd53188/href</a></iframe><p>The _beforeTokenTransfer hook is an internal virtual function intended to be called before any token transfer, including minting and burning, with these conditions:</p><ul><li>when both “from” and “to” are non-zero, we are in the token transfer case</li><li>when “from” is the zero address, we are in the minting case</li><li>when “to” is zero, tokenId is going to be burned</li><li>“from” and “to” are never both zero</li></ul><p>Following the OpenZeppelin <a href="https://docs.openzeppelin.com/contracts/3.x/extending-contracts#rules_of_hooks">Rules of Hooks</a>, follows a BurnableNFT implementation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84f7287ac9c96448b099b24492ff692f/href">https://medium.com/media/84f7287ac9c96448b099b24492ff692f/href</a></iframe><p>In row 33, we check that we are in the burning or transfer scenario (“from” is not the zero address).</p><p>Then, the only address allowed to transfer or burn an NFT must be its owner so, at row 34, we get the owner of tokenId and “require” that it must equal to the sender of the transaction (msg.sender).</p><p>Then, the only thing to do is to add a public burn function that calls the parent contract _burn function.</p><p>All solidity code and tests can be found at: <a href="https://github.com/donpabblo/burnable-nft">https://github.com/donpabblo/burnable-nft</a></p><p>If you are here, thank you for reading. I sincerely hope that this explanation was useful to you.</p><p>Read more from the <a href="https://medium.com/@donpablooooo/list/nft-series-34dea60327e7"><strong>NFT Series</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c306c9cb6df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/how-to-burn-an-nft-c306c9cb6df">How To Burn an NFT</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>