Tips and Tools to Create Dynamic NFTs
ETHCC 6 · July 2023 · 38:37
Solange Gueiros demonstrates creating dynamic NFTs whose behavior follows defined rules. The hands-on session uses tools including Chainlink Automation and Functions and discusses techniques for updating NFTs onchain.
Speakers
Topics
From ETHCC 6, hosted by Ethereum France.
Transcript
[Music] [Applause] [Music] [Applause] [Music] thank you [Music] [Applause] [Music] hello everyone welcome here and I'm here to talk with you about Dynamic nfts yes they are over there and you can see that I'm not alone here in a few minutes I will introduce a special
person to talk with you as well because I have with me Stevie Ellis the CTO of Training Club is and the co-founder of training clubs and he will talk with you as well he will explain something about how I'm using the dynamic nfts and I'm so happy so let's talk about nfts so any of these represents something you know like probably you are at uh real and know about nfts before so what the nft can be a ticket can be a punk can be a real estate it can be a badge Etc and but every day I I miss seeing modern ft's being Dynamic and I'd like to tell
you something so interesting I am a dynamic nft because I am unique but I mean changing every day I'm being older and I hope to be not fat but my body is changing as well so I am a dynamic nft and each of you are a dynamic nfg and this is the concept of nfgs we are changing our timing and the nfts must change with us with highlights with careers with something that we like to have update in something that is unique but can be updated and we can Define the rules and the conditions conditions to updating FTS it
can be a score it can be a car here right light or experiences or even the weather you cannot update nfts in different ways and is this how are you update infj here today in fact my goal is to Mint an NF chain one chain and to see the nft in another chain so I need doing a cross chain nfg and why I'm doing this exactly because we launched the CCAP the cross chain protocol from chaining clubs exactly
Monday so it's a good moment to do this and now I'd like to introduce you is trivialis welcome Steve hey thanks Seoul um hey everybody so I'm Steve uh and yeah I'm excited to tell you about uh ccip this is uh a big uh our release this week we went live on mainnet on Monday with some users who've already been testing with us for a while are they in synthetics and so we're very excited to announce and launch this here at etcc with everyone so um it's a huge deal for us since the start of chain link we've uh We've embraced the multi-chain world we've had Services powering
um thousands of dapps across many many chains but these have all sort of existed in isolation in regards to how chain link has treated it and so we're excited for ccip to become the interoperability protocol so that all these different applications can now uh plug into each other and interoperate across chains we think this is going to unlock a lot of different use cases because different chains as we know have different Specialties uh different capabilities that they sort of unlock so for instance there's there's storage there is high high throughput compute some change are more secure some chains are more private so in the case of dynamic nfts maybe you want to go over to a a high throughput compute chain generate some new images move those over
store those on another chain and then manage them on a secure chain I think uh whatever your use case for nfts or any different application there's a lot of different ways to leverage these new the the um that the capabilities of each of these different chains so we're excited for that uh there's there's two different um sure sure there's two different uh types of messages or ways to use ccip one is messages messages is just arbitrary data you can send between different chains um but there it is also difficult uh to know the value of arbitrary messages so we also have another one secure token transfers where token issuers can uh we
we can we natively support token transfers and we will have those token transfers we can add different security properties so you know if you move larger amounts of value we can add more security as we move that across my my Dynamic NFC you'll be a message uh this will be a message I believe right cool cool awesome so yeah uh this this secure token transfer comes back to our philosophy around security ccip we've been thinking about it for a long uh we've been working on it for a long time thinking about it for a lot longer we want uh we always put Security First and we wanted to make sure it was as secure as possible before we released it so just to give you an idea of how some of this works uh there are two there are
multiple different layers of security one comes from like a lot of it is based around our Dons this is the security property for all the chain link products that we release and so this is the Don is our decentralized Oracle Network it's essentially a version of multi-party computation uh they one Don passes the committing Dawn passes a message across the chains um and then there is a second uh an independent client implementation written by a different team in Rust different language this was so we could make sure that any bugs that potentially pop up in one are not going to affect the other independent client this is they manage an allow list allow lists if you're not familiar with it as opposed
to block list allow us these proactive security favors safety over liveness and as opposed to a block list which would be sort of reactive trying to prevent bad messages from going through us as opposed to allowing them to pass through so again favoring Security in terms of this once the arm Network blesses a message to pass through we will be executing Don then executes and pushes that message through and executes it on the other side uh so this all comes back to the security that we try to put first on these Bridges and yeah so we also think it's very usable we think it's the most usable best ux of any different of any of the bridges so we recommend you to yeah we're going to General availability tomorrow uh on
testnets so we want you all to come hack on it try it out give us feedback tell us what you love what you don't love uh and yeah happy hacking yes thank you Steve and in a few minutes you do more questions for this Chief as well but now uh it's the Practical part so if you have your computer here prepare your computer because we are doing something we are coaching now we have a repo to do with you and you do here you can do with me and especially today like Steve said it will be open to the general access only tomorrow on testnet but I have a hotel here and you can use my hotel to test it with me now okay let's do it
if you'd like to go to do to do this with me please go to this link this is a collaborative pet that we are working together yes you can take a picture and then type pgs in your computer and also I have more people from chain link here with me who is from chaining clubs hi hi exactly and especially hence that he is from the CCAP team he helped to develop this and he is here as well to help you and support when you you are
trying to do this and also to respond some technical questions okay I'm going to do this link now okay if you are with me please add your name here ah yes yes welcome Jane
and Martin welcome welcome yes and I know that if you are online you can do this with me as well so let's do it and okay are you at the divided here and I will start to put the code that we need to use so here you are you must go to this repo and you can do a git clone of this okay
do the colony go to your folder and any pay me install then go over there instead perfect with this we are good to start
so what we have here and I may really following uh how the the process that I have here one different point for this is the is related to how we started uh some components and for example I need to have my private key uh here but I do not use a normal dot aim file because the moment I can like forgot and like publish this we created a chain link Labs encrypted Dot N file and this is security choice because you know that we really take care of security and also you need now to have a URL for two
chains and I'm doing my nfg from Fuji to sepolya I need to have so a URL for Fuji and another choose apolia to send you the transactions okay and let's do this week are important place every comment here for you to be sure that you can do this one with me and first of all I need to set a password in my Apple oh I don't have it to open it yet let's get
let's open here we are because I did this before are you not to do this again but when you do this comment uh with the Envy encryption set password you are defining a password to your uh encrypted variables and after this you need to set the variables and I will tell you what is this we need to set the private key from your wallet
the Avalanche Fuji and the Sequoia the best with these names okay yes so here you selling this the best way to get to the evolution [Music] chain restaurants go over there and you can get directly from the list idea for you I already did this so I know that I have my encrypted file here and I can show
you exactly because it's encrypted so you cannot do nothing with my audio without know my password and then here you were after created this three variables using the encrypted set you have here our everything encrypted so this is my private key my Avalanche Fuji RPC and my Chinese sepolia RPC as well you must have these three okay and okay let's uh go forward with this and next step we must compile the Audi files and we are first deploying in our destination
chain that is UB sepolya and what we are deploying in the destination chain we are deploying we are deploying uh the nft in the destination chain and the minted okay so one chain in one chain I using the command to another chain mint the nft this is the idea area okay be sure that you compile everything I already compile it
whenever I go and I will do this with you and another Point interesting let's see uh how is the concrete and let's see what is this exactly because I'm using the hard hat I already created some scripts to help you so I have you one script that is deploying everything in one step and this is easy for you let's go over that okay if you go here I can see first the conflicts so this is the nfg is a base KFC from openc I don't have nothing related to chain link here is really only an nft and using open Zeppelin and then I can
see on opexy and I show you the destination minted here what is important to you know is that I need to have a account compatible with the ccip receiver so I imported the cic ccip receiver and also the client the library clients from chain link and the nft as well only because I need to have with the I don't need the nft out the nft but I need an interface of the nft and I mean importing everything okay so is this here uh what I have in a different way I'm receiving a message
and when I received the message and my message is to be in my way in my way is the common to meet the nft my message is you can see here that in the address of my nfg I me calling the message it means that I'm executing the function that I miss sending it's the mint function in the same way that I miss sending the meeting function I can for example change some information in the metadata and I can change other parts of the NFC to be dynamic okay so is this this is the destination maintenance and we are deploying now the
nft itself and the destination let's do it in a few minutes are you suggest done foreign that is doing this let's go to where is my script here so here is the script using had hat to deploy this this is a normal script from hard hat where I am
deploying two contacts let's see how is this now wow and what's happened every time that you close like your repo or your uh in my case my my comment my terminal and I open again I need to set up the password again at the same password please okay now it's done let's see foreign
yes it's working so I'm minting the nft now and you can see that I defining that I'm doing this on sepolya okay here we are this is my nfg contract are you saving my file you know that I have an audit that I did before I'm updating let's go to the order now is the destination minted in sepali as well and um yes here I'm not this is the normal hotel but I don't need this okay so this is the is much context destination minted
this is the guy who you meet the Nifty here we are and remember I told you that we are minting this from Fuji Avalanche Fuji I need to deploy now the Fuji part so are you Deploy on Fuji and yes I forgot to tell you that you must have sepole it to do the other part so if you got an error related to balance is because of this and also now you must have some Avalanche Fuji as well if you don't have you can go to the
faucet of damage so so easy to do this okay and this is on Cersei are you deployed the sir cemented and this is the tricky this is working now with you because it's not launched yet so only tomorrow we have the test net access but to do the workshop with me today you can use this outage let's copy this for you so you can copy and paste this part now okay and be sure that you are using this hotel now but no not tomorrow
let's see let's go to the the content in this time and this is my searching inter let's see how is this cemented here we are when I'm using this in the moment that I mean minting the nfg I can choose if I need to pay for to do this I I can choose if I'd like to pay using the link token or using the native token in my case are you pay using the Avalanche Fuji token the the network token but you can use the link as well you can choose and here we are because I can choose I
have the option for both so I have the link token interface I have the outer client that you know that we are using the outer and here I have the client itself and because you must have some a vax Fuji or a link inside your concrete if you'd like to withdraw them later you have the withdrawal function and Stephen why I'm using the outer yes what is the outer the router is a way to essentially it's a single place that you can go to talk to any of the different
chains and as we continue to upgrade security and add new features the router will stay the same so that you can hard code that and then kind of get new features as they're added but we don't want you to have to sort of change addresses we know people like to hard code those so the router is the consistent entry point and exit point for any chain exactly thank you so this is the idea and tomorrow you can use the chaining official halted excellent let's see yes myself Sim inter contract is here my notes as well this is my notes and okay like I said before now I need
to fund my service contact with link or with Native token if it's uh Fuji you can sign this 0.1 if it's linked you can send you one link okay let's uh I know that no I don't have my address anymore okay here is my address let's see which thing I am now I have no idea yes a saint this is my service conflict myself and
are you saying the zero point is what 0.2 okay I'm feeling this and after this I cannot this is the best part so two minutes on Fuji you must adapt this comment for you so what am I doing here mint this Cersei blockchain is the Avalanche Fuji the third cemented this is your contract that you deployed now the destination blockchain ispolia the
destination Minter is the contract that we deployed before that I showed you before and here you must choose if you'd like to pay fizzing native token this is virginal or link and yes I was showing this for you and I I didn't finish so here I'm choosing how to pay fees as well in the smart content I have the outer I have the link here the message and this is the function mint that I make calling in the search chain to be executed in the destination chain and you can see here that I'm
creating a message and my message is mint for the address only this no extra arguments and this is the only part different value you can see that I'm not minting here here I'm sending the message to minting the other chain let's prepare my contents to do this and so what's my answer my name is yes yes this is my native my destination maintenance here and I need Paint fish in Native
and easy putting this now let's see what's happened and after this we are going to see this in the ccip explodes here we are and you can see that I have a transaction hash here you can see my transaction as well if you you are not doing and where you can see this index Florida
here we are you get my transaction again and let's search my transaction what I did wrong are you copy here because I don't know if I forgot some part ah yes I have another part of it so I enjoyed this here we are this is my transaction and it means that search finalized the first part of the transaction send the the
transaction is good but now we need to wait the second part and Shift come come here tell me why I need to wait what's happening now ah so uh yeah the at first we wait for the source we have a certain number of blocks before the The Source the first Dawn picks it up then they will wait uh send it across and right the the route onto the destination chain then the arm network will wait until it is finalized on the source chain uh however deep that needs to be and then finally once the arm arm will send a blessing and say okay this is a good message to pass through and then the
execution Don will pick it up once that happens and say okay like now it's fine to execute it and they'll continue to push the message through and deliver it on the other side so there's sort of three steps that need to to happen here but there's there's two different checks for finality before uh before that gets confirmed and is ready to execute okay and what's the difference between like saying the message and senga token can I send any token now how is this uh token issuers need to set up uh their tokens so that there is access to create the new token on the other side uh and yeah once they do that they can also configure and set limits so if you want
if you want to make sure that not too much outflow happens if something goes wrong on your chain through um you know commonly we'll see people send tons of uh if there's a hack they'll like use the bridge to get over to another chain so if you want to you can kind of lock down the bridge and make sure either on any direction on any or across the whole network there's not too much flow of the token at any time so there's like configurable security there's other uh options we we allow but uh this adds for extra security for the token transfers and provides better guarantees than what you can do for just arbitrary data we don't really want to be in the business of like
deciphering all your messages and figuring out the value of it I doubt you guys want that either oh it's blessed wow amazing yes so each change in one state but we need to stay to wait to one mod is this yes it needs to execute so it should be good to execute now I think it's just a matter of the execution Don seeing that and and executing but it should happen any moment now and is the time me that I'm awaiting is it different if I am from Fuji to boiler for Fuji it is dependent on what it takes for finality for another to get to another chain so
this is essentially like the security of that chain uh what that takes for you to be guaranteed uh oh look at that uh well it fell asleep so uh yeah yeah but it depends on the Chain um so you know for instance an L2 Could Happen much quicker than ethereum something like that okay yes cool thank you and you can see you really see RJ hour day status changes how the we pass our day status here live with you and let's see okay you know that I mean an nfg let's see I can see this
um with a moment but I also can see this on openc first of all I'd like to see in a comment that identified this comment for you so if you'd like to see this now you can see the balance of your nft for your address [Music] and this is my address and you can see that you see the balance on support now
let's do this video checking the balances so I have you when the nft of this collection let's see now I'm going to open c I copy this for you this is mine and this is these are your copy for you if you'd like to check yours as well and this is my nft just create it now this is the this ugly guy okay I I will change this in the future
sorry but he's ugly and if you see here in the details yes it was created two minutes ago so for me this is really amazing to maintenance nft from one chain to another chain this is uh GCU and lock a lot of I can say that GC will unlock the future of blockchain because now we are not modern silos we are not more closed in one blockchain we can do anything for any blockchain and this is this is totally related to the purpose of chain link that's to bring
real data to blockchain our goal is to connect the world with the blockchain so we can get any information any date outside and bring this to your contents using the other services of chain link and now you don't care more about you don't care anymore about too heavy only one chain now you can use it how the your contracts and you can thinking about your business using different chains so this is really the features and now it's present and let's come back here I only would you like to finish in my presentation with you so we saw the smart contents as
well if you'd like to get this presentation it's here we have uh once one minute if you'd like to get this care code feel free to get it okay I think it's done and I'd like to invite you uh how could you Haze your hand if you are a hacker in the hakato in the weekend in Italy hackathon
ah yay so this is good and let's build together we have amazing bouches in in the house uh watching only related to ccip and in order to use the other Training Services I hope to see you over there I will be over there a weekend I have another workshop on Friday in that Workshop I will talk about uh how to transfer tokings and how to transfer all their messages not only an nft so my workshop is Friday 2PM I think something like that in the beginning and to finish in October we have the smart home it will be the chainic
conference in Barcelona this is a discount code if you'd like to go and exactly the weekend before the conference the conference is Monday and Tuesday in the weekend we have a hacker house and the hacker house will be free you can if you go to me the main website you can see you can already subscribe to the hacker housing now and this is my Hacker House like I'm building this they I love changing because they really give me the hacker house to do in the way that I like to be in a hacker house and I mean preparing amazing things with like a room only for beginners starting from zero two rooms with Advanced
workshops of the best people in yb3 and also we have another room with monitors and we are plugging our computer and B refers and hacking creating some project and you can win some prizes over that as well and this is this is my talk I hope you like it and see you around thank you [Music] [Applause]
thank you