New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Build Secure Cross-Chain Applications With Chainlink CCIP | Solange Gueiros - Chainlink

Ethereum DenverWed, Oct 9, 2024, 12:00 AM

Why develop a project for a single blockchain when you can easily create a powerful cross-chain dApp? In this workshop, learn how to write secure cross-chain smart contracts and build advanced applications for the increasingly multi-chain Web3 ecosystem. APPLICATIONS FOR ETHDenver 2024: #YearOfTheSpork ARE OPEN APPLY NOW https://ethdenver.com/apply

Transcript

[Music] yes we are on time uh welcome everyone I'm here to talk with you about uh CCP coring applications and uh this is me my name is solos you can call me so these are my conts and you can find me in the other side in the other building as well because I am leading the camp buil and let's start about talking with our bounties uh I know that I have another mic uh the hands on mic where is this the other mic that I can walk around ah yes ah yes now I can walk a bit I know that I must be over there but let's walk so this is our bounties today in the uh here so in it's dver hakon so we have two kind of prices first is using ccip and I me teaching you how to use a CCP and we have so 2,000 for the best for projects and 2,000 more for someone that use CCP and usdc I me teaching you how to use usdc as well and also we have more five uh for the five best projects we have more 2,000 for each of these five best projects using any of the other chaining services and if you use all of them you can win in both tracks maybe let's see and this is the presentation so this is the most important for you you can take a picture you can read this QR code and I will try to do a demonstration here using ccip and if you'd like to do my demonstration in a handsone session later you can go to the camp build because we have another session starting like 5:00 p.m. uh using this in a hands on part okay and this this first of all okay I'm from chain link chain link it's a platform related to oracles related to services that you can use so oracles any kind of data sech that are outside of a blockchain or even in another blockchain and You' like to bring to yourart content how you can bring information to yourart content Oracle is the key to do this and when you talk about oracles it's so important that you have a decentralized Oracle network not only one s uh to bring the information so chain link is a decentralized Oracle Network platform with different services for you so is this we have the data feits to get prices to get information and the data streams as well we have the CCAP to have cross chain transactions between blockchains we are doing this in a few minutes but also we have a functions to get information imagine that we would like to get an API external API using a JavaScript code and bringing this information to your smart content you can do it and also you can generate your R numbers you can automate some execution in yourart content you can do everything using the services from chain link platform and by the way chain link is deployed in different blockchains so uh you can see the services in different blockchains as well this is another important QR code for you if you have a presentation you already have this because because how the uh how that you need to learn and it's not me but you can learn more uh in our documentation as well and this is let's talk about CCP so CCP in a high level uh we have like you are the Eng user and you have your application your application you communicate with the CCP hter H and the CCAP hter it's a smart content in deciding the C blockchain you must say what is the message that You' like to send to the other transaction to the other blockchain and uh what is the other blockchain what is the destination chain and we have a offchain part that is a de centralized Oracle Network that take care of this and after this the hter in the other network in the destination blockchain you receive your message you receive your trans transaction and then maybe you are sending to some application over there or in my case now I miss sending directly to my wallet because I miss sending usdc so I do this first in a practical way and I have some minutes in the middle that I can explain more for you so let's go uh I need both yes yes yes yes so here we are I am on REM miix now and I have a smart contact what is my smart contact this I have this basic smart content don't worry I share this with you later but this is my content where I am on the Avalanche Fuji Network so I staring on Avalanche Fuji test net and I miss sending my tokens to sepolia this is my go uh something things that we must have we must have the network set up in our metamask we must have tokens and also you must have the usdc token you can get in the fet all the links are in my presentation so here we are this is my contract and I do my transaction first and then explain what I have here uh I deploy my content first of all so let's deploy it this is my content to transfer usdc between chains let's see if I am on the right chain yes I am on Avalanche deploy It Go met mask yes now yes oo okay I think in a minute you have one more contest here this was other contest that I I was playing here probably you saw me playing here this was other contracts related to tokens like because I click it twice I would not do this okay one is enough this is my contract so now how can I transfer this uh I can transfer this in order to transfer I pay fees only in the cersi blockchain so I am in avalanche Fu now I must pay the fees in the destination blockchain but I do this here now on Avalanche Fuji the fees will be calculated by my contract and when I'm paying fees I can choose if I'd like to pay fees in the nativi token in this case in the Avalanche Fuji or using the link token it's like easy to get the link token than the the nativi token so I'm using link now I'm sending link to my contract to pay the fees let's do this is my contract so I have the address I came to metamask tokens link and let's send like to my contract five links here we are almost done same after this I'd like to transfer usdc so I must approve the usdc that I have in my wallet I must approve my contract to use my usdc to transfer my usdc so how can I do this again I will copy the address of my contract but I must came me to the usdc Token uh supposed to be here but it's not so let's get in my presentation it's in some place here getdc transfer okay this is something to you but probably I have it here uh yes I need this and I have this in my presentation in another place so what is this I'm going to the westdc contract on Fuji now and I must go to right as proxy to get the appr Pro function and my my account is already connected so who is the spender that I'd like to have is my content here and how much I'd like to spend imagine that it's one and the usdc has six uh decimal places so the connection with my metamask it's a bit slow but in a few minutes my metam mask you open the popup to do this yes done yes you can see that I'm approving to send one WDC okay if I come back to remix probably here I can see the balance of my account and I can see that the balance must be five links but not in ufdc yet if I see the hour yes it's already done so now I'm ready to transfer usdc to another chain who will be the receiver the re will be my wallet so get the address of my wallet is this and the amount is one in 6 Z it was that let's get from here 6 zos transact again wait the connection oh not too much now okay now when my uh my transaction is confirmed we can check the transaction on the ccip Explorer so we have an Explorer between the chains let's see this let's get the transaction ID then I'm going to the CCAP Explorer and you can see that I started on aalan Fu I'm going to seia but it's not done yet so this is the moment that I can come back to my concrete and talk a bit more with you so let's talk because we must wait a bit oh what no I don't like to share no it's not this no here yes so what am I doing I have a cross chain message the cross chain message can be to transfer tokens that are supported or to send any kind of data I can send a message to another to another content for example I have another example over there where I minting nfgs from one chain to another chain and I can even send the token imagine that I send the usdc and then i' like to borrow to to do a l to do a trade in the other chain I can do this the CCAP sender Can Be You external account or any smart contract the receiver can be a external account or if you have messages information data you must have the CCAP receiver inside your contract also I present to you the hter we must have the how the communication is made between the halters in both chains and we are talking that we can token transfer messages and transfer this in different ways this are some examples that you can do like we talk about the token transfer but imagine that you can have the collateral in one chain and do something with that collateral lock the collateral in one chain and do borrow something another chain you can do this imagine that you can do this with nfts like I told you before I show you an nft that I have that the backround uh changed uh according with the search chain and I can use this with account abstraction to have some wallet included that is uh working different chains or in gaming in data storage your computation you can have the computation in a cheaper chain and they result in another chain and this this we did the CCP uh this is the information that is important to you if you'd like to do this alone you have this good book you have a video as well and we did this so all the requirements are there so to have the Avalanche Fuji to have the token to add the link to have the usdc you can have all the information on this presentation and this is the Explorer that we are using now and this is interesting this is the workflow that is happening this moment so because of the C the usdc is a token supported by ccip we have a token pool managed here so I create I am this I create my contract descender it's went to the hter and the hter is talking with the token pool depends of the token you can lock the token in one side or you can burn the token in one side then we don't have only one network we have three networks to make this secure we have one hisk management Network that take care of every FR to not have a double spend take care of the finality of the trans transactions we have another uh Network that has a consensus to commit the transaction to the other chain and we have a third network that's executing the transaction so we have different parts exactly to be sure that this is really secure when this arrive in the other chain is the same imagine that you send the token what you did over there you lock maybe you are unlocking here or you are minting the token here depends of the token depends of the strategy and this is the same is going to the hter and if you have a message you must have a contract here a receiver but if it's only token you can go directly to your wallet like I did now I'm good and like I said before this is the token handling mechanism lock and mean or burning and lock in the other side or mint uh I already talk about the fees so you are paying fees only in the search chain and when you are paying the fees it's calculated in the smart content and also you pay a premium that for the node rewards I'd like to show my content to you as well let's go here so this is my content I'm importing out the house and client everything related to the CCAP and then you can see here that I'm using the hter address the link address the usdc this is the chain selector I can get all of this information in the documentation of ccip like this so it's loading and then this is my message that I'd like to show you the token amount I can send the token the address of the token the amount that I like to send then I'm creating a message this message has the receiver my wallet no data now the amount of tokens and if I using something like um when I'm meting nfts I me must increase the gas limit and I'm paying the fees you using the link token here we are I'm calculating here the feast and I must have more link then I must paying fees I must have more usdc that I'd like to send and here I miss sending the message is this let's see what's happen with your message it's here it should be uh like not this but totally finalize it let's refresh my page yes success we we did it how can I say how can I be how can I be sure here one usdc it was sent from Fuji to seia 7 minutes ago so I going in my metamask now to sepolia I should show you before that I have some I remember that I have I think 22 asdc yes and now I have 23 is this so this was just sent now from the other chain that I did this is really amazing I every time that I do this I love it yes I need to tell this and before we are almost finishing I like to show you that I can do this with other things as well for example NFS that are the arbitrary messaging and this is the nftg that I can from one chain to another chain this is my nft that I have it if you'd like to see my collection is over there depends of the cersi chain this came from uh polygon uh Mumbai this came from Avalanche Fuji that came from ethereum sepolia and the this is based on the Bitcoin price so I'm using data fit to get the Bitcoin price and if the price is going up since the last time that I me the nft I be happy or I be sad or I'll be neutral and I did youf one minute ago let's see this life because my time is over I know that I did this now we have something now woohoo something of this like this is the Z I think this is the last the last one I finished okay I know I know no so is this I just did this now in the details you can see that it was 18 minutes ago I was here so is this thank you everyone if you'd like to do this with me now live coding with your computer we can go to the C build in the other side and we can do together thanks so much

Automatic transcript — names and jargon may be misspelled.