NFT Metadata
ETHGlobal·Sat, Oct 9, 2021, 12:00 AM
Join Alex Atallah at the Creator Economy and NFT Summit, for a talk titled "NFT Metadata," part of ETHOnline 2021, a month-long virtual hackathon with over 1,000 engineers, designers, and creators building new protocols, learning at summits and workshops, and gaining valuable feedback from ecosystem professionals along the way. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal Check us out: https://ethglobal.com Email us at: hello@ethglobal.com
Transcript
[Music] [Applause] [Music] so i want to introduce alex atala from open c um to uh as our next speaker alex here will be talking about nft metadata and off chain and how all that works out here and there's so much to cover here so what i'll do is i'll just let alex jump in directly and without further ado uh please welcome alex alex um hey guys thanks for having me on uh apologies about the background noise i'm gonna train station in dc everything's wise quietest place i could get great to see you again um let's start with the screen share okay it's still just loading you know yeah yeah it still says loading for me too um let me try to again or can everybody see my screen here without me clicking all right i'll just do this so i wanted to do a talk about uh nft metadata starting from the beginning and go into decentralized versus centralized metadata and where we see it going down the road so to start with let's talk a little bit about nfts and how metadata fits into the big picture there nfts we can break down into a couple different components or a couple different themes that go into them there's property data property data is who owns what and how many of each thing does someone own some some of these tokens are not truly non-fundable they're also semi-fungible tokens that people colloquially call nfps when really one user can own multiple copies of them um all of that is considered property data but for the purposes of this talk i'm just going to be referring to all of these media attached tokens as nfds we have property rights which is abilities that a certain token owner can access by owning the token so these could be things like oh owners of this token can uh can access another asset that's on chain um owners of this token can participate in a game that's being run by another smart contract uh owners of are partial owners of some semi-fungible token can uh interact with each other in a special method to play like an on-chain uh you know engagement and there's a lot of creativity that hasn't really been explored for property rights there's also on-chain history what's happened to the nfc and and when that happened and all the events that involved in msc and on the blockchain going back till it wasn't ended or created and then there's metadata which is basically everything else what what what the content of the nft is um or what information there is about it like like what what media is really being attached to it that is what we consider metadata it's a bit of a vague topic but we'll go into a couple specific examples really soon so metadata itself we can break down into a couple different components that we've seen so far there's images there's videos there's animations all these can be attached to nfts using metadata there's 3d models which are typically glb and gltf format there's name description properties information about which address or who created it and also links to other resources like links for an external site it could be links to other nfts links like environments that make the nxt special so an important website to check out to understand this a bit better and really go into details your developer is docs.openc.io there are but there is a metadata standard attached to the nft standards that you might have heard of erc 721 and 155 but it's pretty simple so what openc has done is expand the metadata standard and add rich properties and new things that develop what we've just watched developers adopt over the last three and a half years open c started in december of 2018 and back then there there was absolutely no metadata standard and most nfts were just kind of guessing and throwing out random data inside of it from their smart contracts over time more and more developers have adopted similar looking json formatted metadata and all the site is is a way of collecting like the most common the most and our suggestion for what your metadata could look like and if your metadata looks like you know something that represents the files described in this uh in the stock it'll automatically work out so here's an example you can create rich traits here's the herbie star belly this is the name um open sea creature this represents the metadata around the smart contract which i'll get to later um there's no like creator data on this item but there could be and then it would display in the description pane right right in the middle of the screen we have properties these are fixed strings that you can just attach to a single nft and you can give these strings trait type names so like this is a trait type of base and a trait value of jellyfish and open c will automatically compute the rarity of each of your properties so that users can figure out pretty quickly how rare something is and what makes it rare users can also click on these attributes in the openc ui and it will show them all the nfts in your collection or contract that have that property on them so you can easily visualize and explore your collection there are stats these are just numbers that don't only generally fit in any other category and there sorry there's also levels which are numbers that are out of something like that have some kind of maximum value that you want to configure yourself so these could be things like generations stamina um any anything that has some kind of max value associated with it metadata can also apply to entire smart contracts not just nfds smart contracts are often represented as collections on openc a collection is just a bunch of nfts that belong to some uh common theme typically just one smart contract powers of collection so we have name and description we have the image or logo for the collection we have the royalty this is the percentage of each seller fee that goes to whatever the royalty recipient is and whoever deploys a smart contract can instantly go to openc and configure their all these attributes about their collection even if they forgot to do it in the metadata itself um as long as they own the smart contract launching here's the url for going a little bit more detail about setting up contract level metadata notice that for both for contract level metadata we have a little code snippet here but i didn't and i didn't show the equivalent in uh nft metadata it looks like this these code snippets are really important and your contracts there's a for for erc 721 there's a method called token uri token uri accepts one argument token id and returns a string and this is how openc will pick up your smart contracts the url or the resource for your metadata given a single nfp's token id in this example we take the base token uri for the whole collection and we append the token id to the end of it so so if you had centralized metadata something like this url here this is a heroku app url um you create your own api that just takes in a token id at the end and returns nft compliant json json that looks like this name description image attributes if your api returns an object that looks like this it'll automatically show up on openc and after indexing happens which sometimes takes a few minutes to an hour and everybody will be able to discover it and search by these attributes on opc2 so it's a very like programmable web and you don't have to get overseas permission do that per se as long as you're you actually own all the work and you know it complies with the terms of service you will have an nft up on openc immediately that's kind of the beauty of the whole concept permissionless innovation on top of open blockchains so back to contract uri this is the equivalent of token uri but for the whole contract so here's an example we have open c creatures description an image an external link seller fee basis points this is this represents the percentage seller fee that you want to take for all successful sales so 100 would be a one percent seller fee and fee recipient this can be a smart contract address or a wallet address if it's a smart contract address you can use it to split the royalty between multiple recipients you just have to call the smart contract to receive it next wanted to cover a little bit about debugging metadata so a lot of developers get their metadata a lot of developers want to work on their metadata in real time especially in test nets and need some way to see if openc is picking it up properly or if they've been following the metadata standards properly so we have a validate endpoint this is kind of a nice little bit to know in our docs that not too many developers know how easy or how simple this makes metadata development but you can use the validate endpoint to take your smart contract address and a specific token id and see what errors show up when openc parses your metadata this is especially useful if you're doing something unusual like having both an image and a video attached to your nfp or both an image and a 3d model and wanting you want to make sure that the image will show up in the grid view on opencv but the 3d model or animation shows up when you click into an nft and see it large in a single item page next topic i wanted to cover is decentralizing metadata so metadata you can break down into both into two buckets there's centralized data which just get stored on some google cloud or some server somewhere and there is decentralized metadata which can either be on a file storage a decentralized file storage network like ipfs a block chain like system for storing files like are we or directly on chain meaning the image name etc all the metadata is actually in ethereum itself or in polygon itself whatever blockchain the nft is on the latter is expensive to do because you pay to store all those bytes on the blockchain and blockchains are typically not made for things like that and that's why we have ipfs and are we which are lower much lower cost ways of storing large amounts of data so centralized um metadata had two major downsides there's impermanence server can go down and then you can't find the metadata you had this is particularly important for nfts that are cultural you want you want them to last like decades or hundreds of years or more um so it really matters that they never go down and that they and that there's some kind of guarantee to the creator and collector that they'll always stay up and then there's mutability um collectors want to make sure that they're that the metadata the nft that they're buying is always going to look the same and the that the creator or any anyone else is not going to be able to change it we have a bit about decentralized metadata in our docs if you use ipfs to host your metadata or are we it'll automatically work on opc um you should omit the part that specifies which which gateway you're using for ipfs and arleigh that way if the gateway goes down at some point in the future it doesn't really matter gateways are just a way for like miners or relayers on file networks to relay files to any consumer and you don't really want to be dependent on the gateway we will automatically ignore your gateway at openc but it's usually best practice it's usually pretty interesting or something that hardcore collectors will look at to see if your decentralized metadata is truly gateway-free so here's an example of a gateway-free ipfs url and the gateway free rweek url another interesting thing about metadata on openc is that we've added a couple like additional elements to the year c721 and the 1155 standards so you can improve the way your metadata shows up one is emitting a new type of event called permanent uri so if you have the ability if you let users change metadata for tokens they're creating on your contract you can omit this event and then openc will automatically see that oh this that according to this contract this token uri has metadata that is no longer changeable so we will consider it frozen meaning collectors will see that no one can ever change this metadata and if you want your entire smoke if you want to tell us that your whole smart contract is frozen and you don't want to admit permanent uri events for every single token id you can contact us on our help center and we can help a couple different types of metadata storage um backing up to what i was saying a few minutes ago we have centralized and decentralized metadata and and even if you want to go with centralized metadata you can make it verifiable on chain so a really good example of this is crypto box crypto punks doesn't have the images on chain itself like on ethereum but they do have a hash that's stored in the smart contract a hash of the combination of all 10 000 images so you can check that hash to see if at some point in the future someone who stores crypto punk's images has changed one because then the hash of all 10 000 will be different from what you see on ethereum likewise in the decentralized camp um you can have both decentralized metadata that is stored somewhere in our wee or ipfs or directly on chain but isn't necessarily immutable someone can change it later it's important that if you're a collector and doing due diligence on nfps to go into the smart contract and look that up yourself um openc will try to do that diligence for you you should always do it on your own and when we detect that something is not only decentralized but also unchangeable by the creator we mark it as frozen and it shows up like this you can hover over it and you get a tooltip this item's metadata was permanently locked and stored in decentralized file storage i there's a bit more i can cover about four types they're covered in our blog though encourage people to check it out if they're interested um if you want more details about like centralized and verifiable nfts and different examples um examples of decentralized versus decentralized throats and nfts and the differences between our weave and ipfs will gloss over those details but feel free to ask me about them in q a in terms of the future of metadata i'm not going to go into lots of details here but i have a couple guesses of what's to come seeing new kinds of 3d models that are showing up as animations models that aren't necessarily glb and gltf uh one example see if i can just navigate to it right now um there's a cool collection called bonsai and these nfts they're loading kind of slowly so i'm just going to wait for a bit they actually have usbz [Music] um 3d models attached to that usdz is apple's 3d file format and it lets you your tree look at it through your ios devices camera but you can take a look at it and experiment with new 3d models and and we're very excited to work with projects that want to do something different in the 3d space there's also nft hyperlinks i really haven't seen much of this it's very surprising i think that um we haven't seen a lot of good examples of energy's trying to link to each other a really early example was cryptokitties every cryptokitty had parents that read it this is considered an nfc hyperlink but it wasn't directly in the metadata in a way that was easily parcelable um we had to look on chain and figure it out uh there's also interesting metadata around multi-chain items so an item that's created on another block and then bridge to ethereum or vice versa we'll often have information in the metadata about like wallets that exist in non-evm chains and which wallets created it um which wallet currently owns it and opens he's very excited to work with developers building bridge metadata standards there's also richer unlockable content right now if you don't want if you want to give owners the ability to unlock content on openc yeah you can only use text right now um there aren't a lot of standards around unlockable content because something is being hidden and can't be revealed on chain but they're i think would be really exciting to figure out how to enforce secrecy with some parts of the content and support that in secondary marketplaces like opc lastly there's legal attachments and licenses licenses are an incredibly undertapped area of nfts imagine font licenses for example every time you buy a font it's important for fonts to be scarce otherwise you just see it on too many websites and it's not special anymore so imagine buying fonts and be being able to trade them on the secondary market to find the true market value but also provably like show that you own the license to a box and not have to like jump through these really strange centralized and obscure or opaque marketplaces that currently power font businesses and uh and cheesy quote but the point is that metadata standards are not supposed to constrain creativity around nfts so this is really the beginning of them and it's likely going to change dramatically in just a year's time so if you're working on something new sorry about the background noise yeah don't let these standards awesome alex uh thank you so much for that amazing talk um interestingly uh so many of our listeners are developers i think that q a turned into uh customer support for the dev cooling side so i'll i'll try to filter some of those questions out but uh uh two two kind of obvious questions that i have from from our chat is um people are very curious to hear about um how the split or or just sort of the the developer experience has been like on our rv versus ipfs and if you've noticed anything that's either easier or not easier compared to uh no as people are maintaining nfts and adding metadata there yeah good question are we we've seen a lot of adoptions recently for and uh there are parts that i think are really exciting uh there's it's it's a bit more like a blockchain with ipfs it's important to know how many nodes have copies of your member data and i think they're working on making the redundancy more transparent and and easier to check out from a collector's point of view but to answer your question directly we we see a lot more nfts using ipfs than our weave on ethereum um on other blockchains the ipfs dominance is a lot less um and i think that's where we're seeing the most are we growth awesome another sort of question on that same topic is what happens or how often do you run into scenarios where the uh anywhere from the metadata to the underlying asset just uh isn't available uh if the permalink kind of disappears like did you run into invalidation of content or so is everything actually permanent you haven't prioritize these types of scenarios openc caches metadata in our own cloud and if we see that we can't access the metadata because the centralized server is down now we keep whatever copy we had before in our cloud so it's a way of giving collectors a little bit more peace of mind in case something disappears we have seen like we have seen this happen a few times and sometimes the idea just goes back up on the on the original server like a few weeks later or sometimes the game or the the server really does go down forever awesome and uh the last question is a lot of people have asked if uh they can go through the slides uh in more detail on their own pace so um if you can send us a link to the slides we'll be able to share that either on the chat or post post this summit to everybody online [Music] will do perfect thank you so much alex and uh hope you enjoy the rest of your trip [Music] [Applause]
Automatic transcript — names and jargon may be misspelled.