Deploy Your Own NFT with Infura, ConsenSys NFT and Replit - Kristofer Shinn
Ethereum Denver·Sun, Oct 9, 2022, 12:00 AM
Transcript
and api access so builders can build their projects easier just connecting to us you don't have to worry about running a node and i'm here to talk to you about nfts this is a little bit more developer focused but what i hope to cover here is a little bit of background and use cases with nfts and describe some common project concerns if you're building nft projects we'll use a tool called replits and inferior's ipfs api to deploy and mint an nft do a bit of live coding and finally we'll introduce the consensus nft api something that's up and coming that's uh pretty exciting all right so nfts why are we talking about nfts as as people in this room probably know they're pretty popular right now um whether you know their headline news with people and like 100 million dollar sales the marketplaces like openc are starting to get more into the public consciousness traditional auction houses like christie's is auctioning off nfts so they're really starting to enter i think grow outside of just a web 3 circle so what is an nft if it hasn't been covered before i'll try to define it here right so fungible is something where you have a set of like objects or a set of like items and you can exchange them for like for like value so coins fiat currency eth um bitcoin those are all fungible tokens non-fungible tokens then implies that you cannot trade them for like for like value right so there's a uniqueness there's a rarity among the nfts amongst the tokens where i can't just give you my token you can give me your token and it's a fair exchange of value diving even lower at the developer level what defines an nft is simply conformance to one of these two standards that i have on the screen here erc 721 or erc 1155 right if you implement those interfaces congratulations you're an nft simplifying it even further down the way that i defined an nft is basically metadata that's saved on chain right with this token uri the token ui points to metadata which defines the nft and there's an address that owns that nft right this is really all that that we're talking about today all right so allow me to get on my soapbox for just a second while the dominant use case of nfts is digital collectibles and digital art right now i wanted to point out some use cases that kind of make the case that nfts are so much more than just digital collectibles right ens domains as an example they conform to the 721 interface therefore they're an nft they can be transferred and traded just like any other nft other use cases are like real world deeds there are projects out there that are trying to take real estate deeds and um sort of real world property and tokenize them on the blockchain using nfts and finally the one that i think is a little bit more interesting and maybe a little bit esoteric is this idea of negative value assets like there there's an idea that you can take an nft and represent like say debt paper with it or or loans in which case it behaves like an nft right you can't trade it like for like but the holder of that nft could have all of the rights and privileges associated just like in traditional finance holding debt paper all right now that i said all that this this talk is going to be about digital art so if you're doing a digital art or a digital collectible project these are the kinds of concerns that might be floating through your head as you're putting your project together right what contract am i going to use is a 721 is that 1155. do i need to use extensions like am i going to have royalties on this sealed metadata there's a ton of extensions that you can also implement around nfts and if you're rolling this yourself do you need to be an expert at security at auditing your contract or do you need to hire you know something like consensus diligence to do a an audit on your contract how comfortable do you feel with real world value flowing through the contract you just wrote another aspect is around the metadata how do you generate and store all the metadata that is attached to your nft i'll dive a little bit uh further into that in just a few moments and finally when you're minting or dropping the nft like what are the mechanics around that how are you going to do it uh are you going to script it or are you going to create software to script it are you going to do it by hand are you going to use a platform like openc or a marketplace where you can just do it through the interface all right so let's talk about storage for storing the metadata and storing the assets there's basically three methods you could use right you could do centralized storage which is your traditional web hosting you're gonna get a um a digital ocean droplet or a heroku and host images from a web server right extremely easy flexible low cost problem is is that it happens to be censorship prone you know what if your hosting provider isn't welcome in certain geographies what happens if somebody doesn't pay the bill what happens when your web server goes offline so generally not recommended on-chain storage is an interesting idea so that token uri that i was talking about can be any uri including a data uri so you can encode all of your metadata and save it on chain this is great because it's simple not a lot of moving parts but it's expensive because you're basically taking all of this metadata and using the chain to store it right it's something that you'll have to weigh the best the best option in my opinion is decentralized storage something like ipfs right it keeps your on-chain storage down so that that you are you're only saving a url it's decentralized and has content id so you know it's immutable and it's not going to change and while there's some additional moving parts like you have to find an ipfs provider or host a node yourself i think it's worth the additional complexity all right so let's make some nfts this is the general thing we're going to be stepping through today um storing we'll have to collect our assets and store them on ipfs we'll generate the metadata store that on ipfs we'll use replit to deploy a contract to mint an nft and then we'll make millions of dollars so let me talk about replit for just a second so replied is a company um that produce that makes these sort of online coding environments it's a really great easy way to to set up right it's free zero setup xero config browser-based platform all you have to do is all you have to have is an internet connection and a browser and you have a you have an ide that you can collaborate and share with right they launched a solidity template four months ago which is the basis of this of uh the repli that i'm going to use today and this is what it's going to basically look like we'll start from that general solidity template i've added some tooling for ipfs and some integration with infire so that if you wanted to play with it all of these tools that i'm doing today are out of the box the basic work around this is you connect the repo with your metamask wallet you modify the contract solidity file with any custom logic anything you want to do there manage the assets on infuria's ipfs api and then deploy and mint it's pretty pretty easy and then if you're working on a team you can share you can share the url of your reple and you can collaborate all in real time all right so let's go to demo time this is the usual warning of live live coding demos all right so let me just make this bigger all right so if you can see on the screen this is what replit looks like you can see there's a code editor here on the left um there on the right we have a ui this is where you would connect your wallet i've already connected my my metamask wallet so if not you would see a connect wallet here um something to deploy although the contracts all the nfts and then once you've deployed in nft you can just call functions within this ui on the bottom panel here there's a shell that we can use to interact with the environment and this is how we'll be managing the ipfs assets now before we get too deep into the live coding we have to do a little bit of setup so what you want to do first is either sign up or log into your inferior account by the way everything that that we're doing today qualifies under the inferior free tier including all of this ipfs work so if you wanted to play around with it there there's no charge for any of the stuff that i'm doing up here so once you log in you'll want to create a project um up here select ipfs name the project since i already have projects created i'm just going to use one of one of my pre-baked projects you'll be dumped to a settings page here where you'll see the project id in secret so you just copy these project ids and secrets come back to the secrets manager in your reple pretty cool right secrets management and then you want to create these two two secrets right project under id project c under secret um these case and and words matter here um input your project id and project secret and then you're ready to go by the way in this readme um all of this stuff that i'm doing um is it's here in this readme in case you want to look at it later all right so back to back to live coding um this contract sole is what gets compiled and what will get deployed right anything to find here you can choose to deploy so i'm going to choose i'm going to start with this nft 721 contract and since i used a bunch of sort of like badly main badly made memes for this presentation we're just going to use that as uh as our nft source so we'll name this a bad meme token you can give it an nft name in a symbol which is part of the spec so bad meme token and the symbol let's just say it's bm um right so now you see it compiles it saves and compiles automatically i didn't have to hit save and you see the bad meme token listed here in the drop down all right i'm going to try to deploy this all right great live coding give me just a second nobody look at my password by the way if you don't use one password you should it's a great tool that is not my password all right let's try this again and if i can get this reworked give it a second to boot up all right one more time confirm all right so while that's deploying and we'll wait for that transaction to get confirmed um i'm going to drop in over here to the assets so let's look at the ipfs part so i've created in this folder assets these are all my images and all the metadata that describes that images those images the metadata adheres to it the openc metadata standard so if i wanted to hawk the stuff on openc it's completely compatible openc should be able to read it and make it freely tradable right take a look at that standard if you're diving into openc type projects so the ipfs npm run ipfs dash directory is assets jp images and this is pattern match so you could uh just use a glob everything that ends in jpeg i think that looks good i need quotes here all right now while that's running it's going through this directory and uploading it to ipfs so you can see all of the images um that i that i have in this directory now are now stored in ipfs you'll want to pay attention to this http link if i were to click it it opens the image in ipfs getting served out of inferior's gateway so now that we have all of the image urls we have to make all the metadata i cheated a bit and i did all this beforehand so i have all the metadata in um the json files so pretend that i copied and pasted all of these um all of these urls into this uh this metadata json or i was clever and i made some script to do it now we need to sync this metadata json to ipfs easy enough oops i have to change it to the json directory live coding all right so now all of our json files are now stored on ipfs and i can start minting tokens so while i was talking you can see that bad meme token has now deployed onto the gurley network i can now run transactions against this contract so we'll come over here let me just get this down a little bit here's our mint function so this is basically how you meant nfts i'm going to come up here and just grab my own address to as a recipient i'm going to grab the token url of where our metadata json is i'm going to run that transaction confirm and it's on your way that easy we have now accomplished nft thank you thank you thank you it's for q a i have one more thing before before we kick in the q a um let me just go so we did this at a very low level right we're talking about contracts we're talking about ipfs deployment we're talking about like deploying in transactions well let's say you don't got time for none of that well consensus uh is now is going to be releasing a consensus nft uh from from our nft group and what it will be is a full cycle sas platform powered by apis sdks cli tools it's going to come out of the box at the white level a white label market front a storefront that can store can that can support primary drops and secondary trading normie buyers can redeem nfts through email it's got stripe integration so you can pay in fiat it's a basically an out-of-the-box solution uh for nft projects if you're interested if you're interested in learning more it's up and coming go to the the consensus booth and ask about you know the consensus nft api i'm gonna leave this up for while we do q a um this qr code goes to this presentation so all of the links all of the tools like everything that you need you'll have access to it's it's a public presentation so i'll leave that up for q a who has any questions what's the delta between what's available free and what's paid and then are you talking about with inferior yeah for ipfs specifically um the i believe the threshold is five gigs um and then there's the max amount of pins that i don't have off the top of my head i think the link that i have in the um in the slideshow um we'll show you what the free tier is and then i believe with the developer account you get um you know 100 000 requests per day something like that like if you're not a public project you're just building and experimenting free is like the easiest thing to do yeah anyone else uh i saw you pass like the inferior gateway url uh on the mint would you recommend doing that with an actual nft like with a gateway or would you use just the ipfs cid or whatever it's sort of it's your choice um and it also depends on your project like if you have the ability to you know parse those ipfs urls and i believe openc does have that like it can take native ipfs urls you're certainly free to use that um mainly i use the gateway for this uh this particular workshop because i can actually preview um preview the images yeah got it makes sense thank you all right we have time for one more question um so i know that was obviously a very manual example just for the sake of this workshop but say you did have like 10 000 images with metadata that was labeled through photoshop and everything appropriately in the layers folders is there a way to do that automatically where it's uploading to ipfs at the same time kind of syncing them i would say not out of the box that's sort of what i was alluding to around the projects of like one of the developer concerns is how are you going to mint it so you could use like a commercial tool like something that's built for that or if you wanted more control you would have to create software or script it yourself right those are the two basic ways that i would say you could manage okay thank you so much um and one last announcement that i want i i have my twitter handle up here i'm gonna try to put in some work on build weekend on this build week to mint these nfts on polygon if anybody wants a bad meme nft free of charge that you can make a million dollars or more off of um you know feel free to dm me your address on polygon and i'll i'll get those out first come for serve thank you thank you
Automatic transcript — names and jargon may be misspelled.