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

Loading player…

Workshop: Build Cross Chain Applications With Chainlink CCIP - ETHGlobal Sydney 2024

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join Solange Gueiros and Harry Papacharissiou of Chainlink for a workshop titled, "Build Cross Chain Applications With Chainlink CCIP." 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. This workshop took place at ETHGlobal Sydney 2024, the first major Ethereum hackathon in Oceania, hosted by ETHGlobal, May 3-5 at The Venue Alexandria. ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Music] okay let's go so I'm here again probably you see uh myself here in a few minutes ago creating the first match content with you but now I'm here with Harry to talk about H chain link and how to build secure cross chain applications with chaining ccip so my name is I am a developer Advocate I teach developers the basic of smart content and also how to use all the training services and you can call me so you can find you around so so came all the way from Brazil to be here and my name's Harry I manag the Devo team at chain link and I came all the way from Adelaide to be here so definitely not as far as Soul so is this this is our bounties here our prices if you are would like to use a CCP uh the two best projects you W uh you win 2,000 and 500 each and also we have if you'd like to use all the other chaining services like functions data feeds data streams proof of Reserve VF automation all of this we are getting the three best projects this amount is so hard to say I cannot say that but uh you can R of one of that as well okay okay and this is the presentation so this is the most important slides for you so get this now I know that I have more care codes but you can forgot the others but not this yes and so first of all what is a Oracle we used to say that a Oracle is a way that you can connect with everything that's outside the blockchain or even when you talk about CCP to have connections between blockchains so Oracle can be like a temperature or the weather that is nice to be a hacker this weekend or the sports or everything related to data as well and I don't know it's so big I me uh C it's cutting some part of my code okay only to you know uh but is this uh when I talk about oracles if you have only one C getting the information from the outside world this can be risky because this can be compromised that can manipulate this information so the best solution is to have a decentralized Oracle Network it means that you have more than one operator one node getting the information and getting a consensus on that in order to save this information inside much content so the most important part is to be sure that your inart content is safe when you are input in a smart content uh and when you talk about chaining we have a different services like when we talk about data feeds or data streams we are talking about especially codes like how is the price of it in USD this can be one of this information uh when we talk about functions this is so amazing because you can create a JavaScript code to call any external web to API and then bring the result to your smart content and use inside your content and also if You' like to use vrf it can be used to Generate random numbers because if you add the rule to generate the random number inside the smart content this is so risky uh because can be manipulated as well or if you'd like to use automation imagine that you have a function in your smart content that must be executed uh with some conditions your business rules so you can create uh another function to check this business rules and automation can do that for you and execute what you need to execute and also the proof of Reserve is used to proof of reserves that is outside the blockchain or imagine that I am on eum I have the rapid Bitcoin and I'd like to know the reserve of the issue of this that the bitco on the Bitcoin Network or even from a real Bank to know the balance of an account okay all of these that I told you are in our developer portal so if you go to the developer portal you can get all the information related to each of these services and it's important to you know that blockchain is Block Chain Link is blockchain agos chain link is not a blockchain chain link it's a set of services and we have these services on Bas we have this services on other networks as well AUM is the base of everything but we have others as well and feel free to implement what you need to have and let's talk about CCAP this is the cross chain interoperability protocol and I'm starting doing a demonstration with you and after that har you explain better what I did okay and we need this time in the middle so first of all remember that the blockchain it's isolated the blockchain and they cannot communicate each other in a natively way way and uh think about a high level architector you are the user and you are interacting with iart content that I you deploy now with you H and I you use uh fion on this moment I try to use Bas but I didn't have time to set up everything I know that we have a Bas here so if you deploy yours using chain link and Bas you can own both prices can this can be good for you and I creating the smart content now my smart content is interacting with the hter the hter is a smart content made by chain link and then this is made H is made the communication making the communication between the other network my goal is to send some usdc from Avalanche Fuji and this usdc you appear on this is what I'm doing now with you and when we talk about CP I me transferring a token now but you can send any kind of message and imagine that this message can be uh calling to call some function in another smart content so I can call uh nft and Main NF in another contract or I can call any function in another smart contract that is in the destination blockchain and uh managing this I can send a token and say what I'd like to do with that token the destination blockchain this can be really amazing and is this let's use CCAP to transfer usdc and I'm doing from fuj to seia you have my presentation so you have all the requirements you you understand how to get the usdc now I must do more demonstration I must be fast sorry and this is theart content that I'm using now and at the end I show how this is working on the CCAP Explorer so here I am I am a remix now this is my smart content it's done and I deploying this is M cont now but I wrong I am on SE so let's go to uh Fuji change here and go to Fuji here I am now I can deploy my smart content and the best way to prove that this is working doing live with you it's a dangerous way but I like that so I have this much content now when I doing this kind of transfers I must pay fees and I can pay fees using the nativ token or using the link token I me I will use Link token and all the fees I be paying only on the cersi blockchain so imagine that I have a transaction on seia but I may pay everything here on Fuji so first all I sending some link to my smart contact to be sure that I have I can pay the fees so tokens I have a link over there and send five links to my smart content is that okay now I'd like to transfer WDC so I must allow my smart content to use my usdc that add in my wallet now so I'm getting the address of my contract going to Explorer and I am exactly on the usdc coin here I have I can go to this right as a proxy and with my wallet connected I can approve this I did this a few minutes ago to another contract so this is my smart contract now and this is the value that I like to have this is one usdc because I have six decimal places over there so one and six zeros and it seems that this was the last one no I think I can do this now let's be sure that it's another it's 6327 uh 63 yes it's the new one so right so remember that I'm improving my smart contact to using my usdc to transfer from my to another place okay and when I have this two done I must wait this then I will be ready I think it's done now then I be ready to uh C this function transfer usdc to sepolia and over there I use my own address this is my address again the amount to be one and the six zeros 1 2 3 4 but this and transact and confirm that and I'd like to get this transaction now failed why it's failed o what I did wrong I did something wrong he would like to explain your part and then I discover what I did wrong because something's wrong sure um but you're not going to bring up the diagram though are you yes and here what yeah thank you so our soul has a look at that I'll try and explain what this cool but and oddly satisfying animation means and and how you as a developer interact with ccrp so basically you as a developer you have a a smart contract or a wallet on your source blockchain and you want to send in this case some usdc to your destination blockchain so on every blockchain there's a thing called a router contract which Soul mentioned and that's all you ever need to interact with so here we have a router contract on the source router on the destination um and then everything between is the inner workings of ccip which I'll just briefly go through but you don't actually have to worry about it um it's all kind of abstracted away but essentially when you want to send data or tokens or both such as usdc you interact with a router contract router contract will interact with this thing called an onramp contract which will also potentially interact with a token pull set of contracts so in this case usdc so in Soul's example the onramp is going to burn usdc on the source chain and then it's going to emit some events to to to the blockchain there and then we actually have three different Oracle networks that monitor ccip so we have a high level of security here so first thing that happens is the committing decentralized Oracle Network we have a look at what was written here and it will um bundle things up together and create what's called a mercel route on the destination chain it says hey this is what happened here but it doesn't do that until full finality has been reached on the source chain so in some cases it might have to wait uh a few minutes or a couple minutes depending on what the chain is once that happens we have this separate thing called the risk management Network so this is basically another Oracle Network that oversees all of ccip and make sure there's nothing dodgy going on in any of the transactions and it has the power to either bless transactions or curse them so when it blesses them it's like hey everything's good you're good to go if it notices something bad it'll curse it and that can potentially pause everything so in this case it'll see what was written here in the Merkel rout it'll re rebuild all the transactions here do a bit of a comparison and say yep all is good I now bless these transactions once that's done the executing Dawn will basically take the transactions again and it will do its own checks as well and create what's called a Merkel proof and once it's done its own checks and it says yep everything's now all good it will actually execute the transaction on the destination chain for you so it will go to the offramp contract potentially burn uh mint some tokens in this case it will mint usdc and then it will go to the router contract which will then call or send the tokens in Soul's case to her wallet address so that's kind of the end to- endend flow yes let's come back uh a minute and then you'll talk about the simulator because I don't know if it was only uh fail it because no now you fail it because I didn't so what I must do now I you do this again uh and now I authorizing more I'm authorizing like $10 to transfer you can see that and probably I must wait a bit between this and the other but what I I like to do now I have some I can see here the AL so the problem was the the AL you can see that that it was not authorized now it's authorized M also I can see my balance here and I can see the balance of link I don't have usdc here this is good I should have usdc here let's see yes I have so now should work let's try again and then have we talk about the other the local simulator because now you must wait for me and uh three yes this is right cross fingers okay confirming probably I did so fast and it wasn't didn't confirm it yet yes now it's right so you can see over there that I have this transaction I me copying the transaction ID and if I go to the CC Explorer I can check no not that I can check check the transaction and the SE is finalized and is going to fush to seia 20 seconds ago and while we are waiting this har we talk about how can you do this locally to not to wait like I'm waiting now sure so as I said before because of the having to wait for finality and CCP you know you might be waiting 5 minutes for a transaction in some cases so or more uh what we actually built a Dev tour recently that we just released called the ccip simulator which allows you to build with ccip on a hard hat or Foundry local network or even in a remix VM so it transactions will be instant uh you still use all the same apis that you would use on a test net and allows you to iterate and build on your code quicker so if you want to use it and test it out go to our GitHub GitHub smart contract kit or Google chain in GitHub and it's pinned here called chain in local uh yeah definitely recommend checking that out exactly because I'm in Curious sorry yes we are still waiting so let's come back it's blessed now like Harry told before now is blessed and uh I think out of this you can see later some parts of what you are doing this is are some use cases yeah cross chain defi is very popular at the moment um lots of opportunities there if you're looking for something the defi space especially if you combine it with data feeds as well you can be eligible for two prizes cross chain gaming starting Bubble Up Too sharing game State between games uh and really anything where you can kind of Imagine something that having a shared State across uh with an application across chain AC cross chain governance and things like that as well so how was this token how this working with the token with the usdc or in tokens in general yeah so ccrp supports uh a few different token transfer mechanisms so you can have burn and mint where tokens are burnt on Source chain minted on destination which is what happens with your d c or you can have lock and mint where they're locked not burnt there's also a third one which is not officially supported on test Nets yet which is why it's not here which is lock and unlock it's this and how we I me paying this so you generally just have to pay once on the source chain and you can as Soul said you can pay in Native the gas token or in link perfect and this is how the heeren is related to what I did yeah and just just to finalize on the prizes we're we're finishing now cuz I know we're at time uh best use of ccip 5,000 and then 25,000 each for the next two best and then for any other chaining service that you use if you need data API calls automation Randomness proof of Reserve we have 1666 for the three best projects so uh yeah if you want to combine Chain Link services you'd be eligible for for both prize pools so if you have the time I think that'd be a great idea yes let's see how he trans now cross fingers yeah success yooo so let's let's show the result for you so I going now toose seia again and my wallet was empty I could show you this before to you but if I came to the tokens part I know that uh I have two asdc now oh so I did one when I was waiting over there and now I did another here exactly here and this is really amazing because you can see that I have my uh usdc on seia now and if you came back to the transaction here and you can see that it was 1 minute ago how good and I transfer one usdc and this this do you have more time I think no yes no okay thank you so much thank you we are in the booth if you need something and we can answer questions outside w [Music]

Automatic transcript — names and jargon may be misspelled.