Beyond CryptoKitties: building tradeable, interoperable ERC721 digital assets by Devin Finzer
Devcon·Fri, Oct 9, 2020, 12:00 AM
Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more. https://archive.devcon.org/archive/watch/5/beyond-cryptokitties-building-tradeable-interoperable-erc721-digital-assets ERC721, a standard for non-fungible tokens pioneered by CryptoKitties, is the new standard on the block, somewhat less well understood than the more mature ERC20. ERC721 has a variety of emerging use cases, including pure collectibles, game items, event tickets, naming systems, and even physical assets like real estate. This workshop will guide participants through the process of creating a new ERC721 contract from start to finish, with functionality beyond simple collection and trading. It will cover a range of tools for building robust, useful ERC721 assets, including decentralized file systems like IPFS for metadata storage, integration with marketplaces like OpenSea, interoperability with virtual worlds like Decentraland and CryptoVoxels, ERC20-compliant wrapped ERC721's, and ties to off-chain data with Oracles like ChainLink. The workshop will leverage existing Ethereum infrastructure like Truffle and Infura, allowing the user to deploy a fully-functional ERC721 contract that could then be launched alongside a dapp on the Ethereum mainnet. The workshop will also discuss extensions to the ERC721 contract, as well as newer standards like ERC1155. Speaker(s): Devin Finzer Skill level: Intermediate Track: Developer Infrastructure Keywords: technical Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum Learn more about devcon: https://www.devcon.org/ Learn more about ethereum: https://ethereum.org/ Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. Devcon 5 was held in Osaka, Japan on Oct 8 - 11, 2019. Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/
Transcript
[Applause] it was intended to be sort of a workshop so if anyone wants to at the like sort of halfway through we'll be doing some coding if anyone wants to take out their laptop and try some stuff out if not that worries but yeah so this the workshop overview the introduction is just a little bit of background amenities for those of you who aren't as familiar with them a little bit of background on open seat and then the second part of the presentation will be the develop a goal of deploying a tradable nft conference ticket with the sub goals of implanting a simple GRC 7.1 contract viewing the tickets on marketplace putting them on sale that maybe as a take-home task programmatically selling the tickets using something like the open sea SDK so how many of you are familiar with GRC 721 SS majority room so this is probably just a refresher but the ERC 20 R represents what are called fungible assets so currencies and ERC 721 was designed to represent unique or non fungible digital assets so each one was associated with a unique fire and the space of one of the reasons we're excited about non-financial assets is we actually think that the number of currencies that individuals will use on a day-to-day basis is limited to maybe stable plans maybe in-game currencies it's like this but the number of digital assets that we already use day to day basis it is very wide so yeah things like game items things like domain names include event tickets and then when you start connecting these digital assets to the real world you have you know things like real estate or physical items as well that could be represented using this standard so a little bit of history of GRC 7:21 so 2017 has anyone heard of crypto punks that so most people so Krypton Punk's was sort of the first non fungible asset on aetherium there were non-financial assets using Bitcoin counterparty but it was sort of the first one that you know was the idea of a crypto collectible and ethereal but there was no standard around it and what crypto kiddies did was number one they built a game around these assets but they also pioneered the ERC 7:21 standard which was refined by the etherium community such that it could be leveraged by other projects so one of those early projects was a project called the central and which represented their virtual land using the ERC 7:21 standard that was in like late 2017 in early 2018 we sort of had a miniature cranes around non-clinical tokens that was a lot more isolated to the early adopter tech enthusiasts that you know relative to the cranes that we saw around ICS and years of 20s but there were a lot of perpetuity clones like crypto BOTS crypto fighters and there were also these games called hot potato games which were kind of these games where you would buy a collectible with the intention of selling it at a higher price so it's kind of this you know even more experimental period than we're going through right now with you know a lot of scamming projects as well in mid 2018 we started seeing higher quality projects enter the space so this year right there and there were a lot are gods Unchained which is a trading card game that used the ERC 7:21 to represent their assets and then MLB crypto which was actually an officially licensed game from the Emily that that have these crypto collectively associated with them and that brings us to 2019 we're actually you know it's less of a well known space in the crypto sphere but there's actually quite a lot of activity happening in the NFT space right now so so a Formula One recently auctioned off some cars using our marketplace actually there's a couple of Japanese games that are becoming really popular there's a space game that is kind of like EVE Online if anyone's played that and then there are starting to be assets that are not in just collectibles and gaming so ens is one of those that is using the ERC 7:21 standard to allow their names to be tradable so one question one might ask is like why why is gaming kind of the leader here so why is this a an interesting fit for gaming number one I think gaming is often done like a digital sort of a playground for any technology we saw this with the mobile phone we saw this with the early internet but you know there's the shift in gaming that you know folks are excited about is this idea that as a game developer you sort of manage every piece of your economy you manage the supply of your items you usually don't allow other items to be imported into your game there's nothing really exported from the game it's sort of this highly controlled isolationist economy and what's exciting is that with blockchains and digital ownership you could have an open economy where you know you could export things from the game you could trade them on open market places you could do all these interesting things and so this is kind of the shift that people are excited about in the gaming community so a little background on open sea so open sea is a marketplace or all of these items so starting with the year - 721 but we recently did a support for a new standard called 1155 we have around 700,000 monthly volumes they on the lower side of centralized exchanges but you know this is volume that people of this is actual unique digital assets that are being traded it's not just token which there is a lot of wash traded for we also provide an API this is more of a convenience for wallets that are trying to show GRC 721 items so this is used by coin baseball trust wallet opera and maybe 20 other different well that's all and then we partner with a lot of games to build customized white-label of market places so this is kind of what open C looks like the moment you have an D arcy 7:21 item you can put it on sale it's kind of like eBay trades our wallet wallet so they never leave your account they're never escrowed and we also provide a lot of the functionality that eBay provides for digital assets so this is the Formula One car museums actually last sold for 450 either this is a record sale in NFC community and you know basically we provide an interface for allowing people to do you Bay style auctions for these items so if if you were to build your own marketplace on open sea essentially what you get out of the box is all of the functionality that's built into the ONC website every single open sea feature and you can customize it and I shall talk about some of these over here so this is what it looks like for this game from two space commanders you have this browser view of your items you can add rich metadata to them to kind of control how they're displayed on the marketplace and then the most important element of this model is that we allow the developer of nmt to take a cut of every secondary sale on their marketplace so our model right now is transaction fee based that might change in the future but we think that there should be an incentive for developers to promote their marketplace we also provide a tool kit for which we'll talk a little bit about and workshop piece for programmatically creating marketplaces so this is a marketplace created by aetherium which is a trading card game and you can see that the marketplace that they've created and the open sea marketplace are actually synchronized such that every sale or every auction that happens on their marketplace also happens see it shares the same contracts and the same order books so a couple examples of interesting and IT projects to kind of make some of this a little more concrete so this is the project called crypto voxels who here has heard of crypto voxels okay so not not that many people and so crypto voxels is a virtual world where the land is represented as GRC 7:21 and of TS and it actually just started as one developer and he just started selling this virtual land and he sold it at a pretty low price and when you own this land is kind of like minecraft you could build things on top of it so here the other interesting thing the developer did was he allowed you to pull in your assets into this virtual world so this is a crypto Kitty's museum inside of Krypton voxels where you can actually go and and purchase these crypto kitties inside of the virtual world it's all do a quick demo so one one interesting that thing that this happened is there are now folks who are curators of digital collectibles and they have started creating galleries and crypto voxels to explore these these artworks so this is a gallery from someone you know who basically thinks of themselves as a digital art curator and it's sort of created this as Museum another interesting NFT project was crypto stamp so crypto stamp is an interesting one because it was actually coupled to a physical stamp so the Austrian Postal Service basically created this line of collectible stamps where if you purchase one you would not only get a real useable stamp a lot of people probably don't use those these days but you would get a Sam and then you'd also get a crypto collectible that you could trade on an open marketplace and this was kind of an interesting way to engage an existing community of stamp collectors in digital assets and we think we'll see a lot of that kind of tethering these virtual assets to a real-life physical asset and then of course the most recent one is the ENS project so ENS is a name system for Imperium so you can think of it kind of like comms and right now these assets are tradable as er c720 ones most recently we collaborated with the ENS team on doing the auctions for their short name and so these were basically names like set eath that were reserved for an auction system that'll that is actually currently taking place right now all right so I guess any questions about NF TS or years so 721 before I hop into the workshop NFC NYC yep what's the growth you've seen yeah so the initial spike and usage of entities of those crypto kiddies and you know you probably remember these cats selling for like fifty thousand dollars each and nothing has you know risen to that level of market volume but I think that was you know some extent anomaly in terms of market volume growth it's sort of slow but steady linear growth at the moment so we're seeing we're seeing high growth in the number of projects that enter the space we're seeing sort of gradual growth in the number of users that are trying them out it's a lot of the same early adopter tech coders who are like trying these out and you know it's a variety of reasons that's the case the usability scalability of this [Music] that's all in gaming pretty much this tomorrow it's that of the art and it it's also interesting but still pretty small I think like for art the biggest thing is having a place to display the art so projects like Krypton box'll isn't essentially a kind of add that utility to art but there are there are a number of crypto artists who have sold works or you know five the tenth because they have such a solid reputation in space so it is starting to be interested yeah so there was a standard called ERC 998 that did that I'm not aware of any like easy-to-use tools that allow you to like button well so we have bundles which basically allow you to sell a bunch of entities at the same time but that's a little bit different I don't know of any websites at the moment that are making it really easy to like impose and I've teased together interesting projects yeah what do you think mister have wonderful we can see like most roll before we see yeah that's like a common question I think right for everyone in there you know it's fast it like nearly every panel specific wouldn't have to do that yeah for nf2 use I think maybe a couple different axes so one is quality of the games which is steadily growing but the life site or the development time of the game is actually typically pretty long so I think the quality of the experiences have to be high enough for people to want to use them and right now they're just they're getting there but they're not quite there and then use just usability of the network in general so things you know better wallets you know potentially better blocked chance for people to build these assets on existing our site where the game I think the main thing preventing them is well I guess a couple things one is I think it's kind of tricky to for an existing game to just move their assets to the blockchain right especially if it was a really big game and they wanted the same user experience you know they could hide away all the theory and stuff but then you know they're just basically basically using a really expensive database for their game um so I think it I think the games that are most effective have to be new games and those new games suffer from the like onboarding experience of getting ether some some hide it but then you know you use everything and then they're kind of competing with every other game but if they leverage the blocks you in an interesting way then you know there are some like really interesting user benefits like trading on up apartment leases we've seen any adoption from virtual reality these days or augmented reality producers not just the games of maybe even like interest from the manufacturers of the headsets and such I'm not sure yeah I other than the virtual reality projects I'm not I'm not sure it seems to be like one company that they have is that their unique individually collectively each other because of my collectibles a little cost of total production it's really easy for lots of people to start creating these and they all just end up that definitely needs a so weird is where you think the dynamism is it like ability to be on i.t because you can't pick that or other brands like I think yeah utility and provenance and maybe some other things but so utility of NFC in a game right so you know if you can just if you can with statements like for tonight right if you can wear a legendary or the well-known skin yeah that's cool and you can show it off that's sort of utility and then Providence is like oh this was the officially endorsed Disney collectible and hence and like Disney has sang she has said this is a smart contract we're using there were only be this number of them I think that it kind of with the Austrian Postal Service right not a huge brand but you know they basically said this is the official crypto stamp for the Austrian Postal Service there's only five like red stamps and those might be valuable for collectors yeah so there have been a lot of like swap your crypto kitty or burn your crypto Katie to receive I think it was like cryptid strikers that did this so that is a real that's a really good point I think a very interesting way to to engage the existing community is to leverage like the existing set of entities right so go to cryptic Cadiz and say oh now they're useful in this other game or you can trade them in for our game asset that's better yeah and then there's there's also like NFT airdrops so people like airdrop promotional and of tea in your yeah there's like tons of things you could do it's pretty interesting have you seen much you seen anybody kind of use an empties as my assistant like I have this path set so therefore I have no rights to do this yeah so there's the unlock protocol which is basically sort of a subscription service that you you buy an N of T and then you get access to content or something like that so that's not what they're going after is they're talking to publishers that saying it was for that also a Def Con ticket sold on and upon open c-47s the other day so tickets they're kind of a commissioning system right so there's stuff like that all right so now digging into the nitty-gritty so if anyone has their laptop they can follow along your thought just watch me to do stuff so this is the ERC 721 interface it's basically a lot like ERC 20 except that the key method is sort of this owner of token ID right so the token I think of as for example like an individual crypto kitty would have a token I do something and to check who owns that group that could either you call owner up and then maybe some of you are familiar with the idea of proof in the RFU 20 but basically this is a way for an individual to say I approve this account to transfer my item so for exchange is very useful because you can approve open and see are actually a proxy but that's kind of a detail to transfer your items in the event of a sale so that they don't have to actually leave your wallet while they're on sale and then this transfer from is obviously a really key one this is basically the ability to transfer a crypto Kitty or what-have-you from an address to another address then the kind of interesting very interesting part of ERC 721 is you know you have these token ideas but how do you actually represent you know what encrypted Kitty is which is you know has a name as an image as the description has to be some traits so where does that live and at the moment all of that lives off chain I don't think there's handling of a single GRC 7:21 that has put a lot of data on chain there some funny ones that put some data on chains but most have some off chain component that's where this token URI comes into play so token URI is basically a way for the ERC 7:21 developer to say this is where you can grab all the data for my item so this takes in a token ID and returns a URL so here's an example of some data that would be returned from the URL when you hit it that represents the asset so this is what's actually one of our test assets called an open sea creature and you can see it has a description a image a name an external URL and these all mapped to this item right so you can see the the image this view on open sea creature is basically the external URL that you would kind of click into and then it has these properties which this is kind of an addition that open sea made up to allow you to add rich data to your cigar items but what's cool is that you know as long as you implement the token URI and you've conformed to the year succesfully but standard you kind of get it all for free and as you can see like this is automatically tradable all that stuff because it is here since definitely and then what the other interesting thing is this is also what is allowing for limited degrees of interoperability so this is that same of a sea creature inside of that crypto voxels game that is mentioning right so now because that metadata is standardized crypto box hole or whatever site it can go and pull it or use those fancy api which makes it a little more convenient to grab this assets and display it in the virtual world and ethers can as well has actually recently just started listing all the inventory of GRC seven twenty ones which i think is that there's an interesting sign that these are sort of starting to achieve the same level of significance as year c twenty which you know has had a nice either scan interface for a while we've crypto awesome he kind of I think your either display is that any any kind of control over look at it and they don't write so they did not need permission to like check who the owner of that if he is they didn't need permission to call the API to get the data in crypto voxels case they use our API it's like I'm a convenience thing we kind of create some data nicely but ya know they don't question five points URI right yeah so we'll see if I got the work for the coding part of this that it can be changed depending on where it's hosted so if you hosted on an HTTP server you know you can't really change it there's not really good standard around like you know the metadata is changing and then everything updating or I'm just like whole but if you post it on some decentralized immutable file storage statement yep [Music] yeah so you could well so before it gets old can you transfer it [Music] oh yeah so um like if I put a sale up on open sea for example that says I'm gonna sell this but then I but then I transfer it somewhere else then that sale will be kind of cancelled by us or like we'll keep track of like is a sale valid and then there's the maybe the more or if an attack is like transferring it right before it gets bought so in that case like the the sale transaction would fail right because it would try to transfer something that no longer is in that account so that it's an atomic swap right so there's no sort of scenario we're like in the middle of the sale transaction something gets transferred because this is like watching so didn't open them do them yeah so if anyone wants to try out deploying any RC 721 contract I made a starter repo that Forks are basic like you know demo repo for folks who are not technical we we also have a there's plenty there's tons of ways to mint entities which I encourage you to recommend or encourage you to try out so one example here is a rinkeby instance of open sea which is basically kind of a playground for creating enough tees and you can go in our storefront manager and like you know actually deploying a contract and then mint NM tees there's also in space I think I saw in the video you midbass which is a much better tool for deploying networking here I see yeah and they say oh it's right there for ya so my base is like a much more feature-rich way of deploying interesting entities our storefront manager just like kind of this is one of the day was deploying earlier this morning but you know I'm pretending that these are being taken for an FTM I see and you guys for the non-technical folks you can go to the development new storefront manager and sort of go through the process with with meta mass for deploying a year to 7:21 with like an image and name and description but if you were so what's interesting about this is you know you can deploy a GRC 731 using any of these tools and they're all like compatible with each other so it doesn't really matter you know if you use open C to deploy it use midbass or if you do it yourself and for the developers I'll go into a little bit of code to show what this would actually look like and so this is people go yeah so very technical so this is a example tradable ERC 721 token it tradable you're so sometime token isn't don't think of it as anything really special we just added some like utility functions oh sorry yeah so also my like linters but the so you know just let simple way to mint if you go to our documentation you'll also see some special stuff we do with pre approving tokens for trading but basically it's just an ear see 721 and heritage from the open Zeppelin PRC 721 full which has all sorts of nice things associated with it it has like token URI it has like easy ways to mint easy ways to burn all that stuff so it's now I mean it's very simple to deploy something you know I'm not a coder but even as a coder you can do it pretty easily so I will attempt to so um I won't like trying to have everyone do it because I never thought that time but basically you could create a dot end file and that would sort of configure all the accounts that you want to use to deploy your contract so it also sets up a figure or you can get in a fury key and inject it in there and then if you run the minting scripts or sorry if you run the deployment script then in theory this will give you a new yearís at 7:21 contract and one cool thing is that open sea will actually pick up it kind of like ether skin will pick up any new air 7:21 so they're deployed and so once we mint our first asset on this year so 71 contract will automatically it'll automatically show up but I can see and you could don't trade it so we go to the contract employed in the meantime I can start talking about the minting scripts so here's our contract and so the minting scripts this is this kind of where the token URI immutable versus not immutable data storage becomes kind of interesting so this minting script I made earlier today and it basically just uses some JSON storage site that I found so if we go to this I just literally just like I just created a little bit of JSON right so named hello description hi there I'm in an image and this is really good enough for the metadata standard technically but it to point back there I can go and like modify this right so if you're trying to create an N of T that is immutably like has a mutable image associated with it it's always the same name etc then you'll probably want to look into something like a TFS so that you know your customers can have this guarantee that there don't be changed it seems like most for usin URLs yep our most liked readers of MFT s fingertip over the URL or - yeah so certainly like we have support for IVFs um there's not that many like nf2 readers they all like most of them use our API because they're in their early days like with crypto kiddies there was actually no token or a standard and so everyone just had their own like weird API right like that showed data in some random and people still deploy your simply minds without conforming to the meditative standard so a lot of folks use our API which is not you know a very good thing like we don't want to be the central point but but yeah if you were building a like open-source nft aggregator you would definitely want to support or something like IVFs so yeah so time for bed so we do have our GRC 721 contract we can go on rinkeby ether scan and check it out I do that exciting and then we could admit some items on here so don't worry this like stuff is not go away and so I'm gonna replace this address here and then hopefully if I run the minting script it'll meet some items with that metadata that I showed you and after it's done that you can view an item on open sea if you just use a little bit of URL wizardry by hitting slash assets slash address slightly token I eat I think good to wait for it to deploy so it has minted an item and so it has meant it took an ID number one and now we can go to rinkeby slash one and hopefully it shows show up yeah so that's the image I use it was called hello and then some other interesting things you can do here are you can immediately put this on sale both through the open cui or programmatically through our SDK you can sell it in a different token on on main that we support stable point sounds like that on test night we use it for this test token you could create sort of a Dutch auction where you started at a certain price ended another price you could create a private sale eBay style auction you can bundle it together with other entities any even from other contracts and things like that so there's all these things you can immediately do with it and you can see the history for it so it was born a minute ago to my accountant and lastly I think I'm running out of time you can configure this so you get a free storefront so deployed a lot of contracts called creature but assets slash creature - 49 and you can actually edit this storefront and what's what's interesting here is we use the ownable owner of the contract to permission who can edit their storefront so I gotta edit storefront I can add a image for the storefront and description and then my marketplace fees which are basically whenever something sells I'll take that a cut of the sales to group a payout address and a little bit around how the items are displayed any any last minute questions all right thanks so much [Applause]
Automatic transcript — names and jargon may be misspelled.