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

Loading player…

Chainlink 🛠️ Build Secure Cross-Chain Applications With Chainlink CCIP

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Solange Gueiros and Harry Papacharissiou from Chainlink for a workshop titled "Build Secure 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. By diving into the details and a demo of Chainlink’s Cross Chain Interoperability Protocol (CCIP), you’ll discover methods for sending messages, instructing transfer tokens, and initiating actions across multiple networks. Paris is the city of light and birthplace of many revolutions. Therefore we are thrilled to be back in one of the most buzzing and free-spirited cities in Europe for ETHGlobal Paris 2023. A lot has changed in the European ecosystem since the last time we hosted a hackathon in 2019 and we are excited to meet all the new talent this July that we have acquired since! ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Music] Welcome to our presentation so today we are going to talk about building secure cross-chain applications with chain link ccrp so we're very excited to be here today my name is my name is Harry Papa crucio I manage the developer Advocates at chaining Labs today I'm joined by my colleague Sol Earl Solange and also uh with co-founder and CTO Steve Ellis so we're very excited today because we launched a new product on Monday called chaining ccrp it's been in two years in the making and we're very excited to talk to you about it today but first we're going to talk about the bounties because that's why everyone's here for so we have two tracks in terms of our bounties we have a track specific to ccrp so two thousand dollars for the best three projects that use ccrp um in their submission and we're going to talk about ccrp in just a couple of minutes however we have one thousand dollars for the four best projects that use another chaining service in their submission right so if you're building a defy app you can use data feeds if you need Randomness you should look at vrf if you want to do API calls you should look at functions and um you know if you need to automate your smart contract calls Etc you should look at automation so we're not going to talk about those services today because we only have 25 minutes however I urge you to go to the chain of docs at docs.chain.link and check them out so let's go so introducing ccrp so before we introduce ccrp yeah that is a bit bright um I want to talk about the cross chain smart contract because when everyone talks about smart contracts it's usually in the context of a specific chain but what a cross chain smart contract is when you have Smart contracts deployed on multiple blockchains two or more and they each they all talk to each other across each of the networks at the protocol level to create a single unified application right that is the cross chain smart contract and that is what a cross chain protocol such as ccrp enables you to do so what can you do in ccrp so the Cheney cross chain interoperability protocol launched on Monday it's now live on testnets for you to use in your submission right now so polia arbitrum optimism Avalanche polygon and you can use it for any of cross chain s or messages so uh yeah so you can use ccrp to send messages from one smart contract on one blockchain to another smart contract on another blockchain you can use it to send tokens you can send tokens from a wallet on chain a so wallet on chain B wallet on chain a the smart contract on chain b or smart contract on chain a to wallet on chain B and you can do what are called program programmable token transfers which is basically combining a message and a token in one let's move on so what are some cool things that you can do with ccrp you could send tokens like we said If You're Building defy apps you can use collateral on one chain and send it to another chain and make it available on a D5 protocol or a D5 smart contract on that chain and what ccip does is it enables what I call true web 3 defy composability right so when we build defy apps and we talk about money Legos it's always in the context of one chain so you have composability on ethereum Avalanche optimism but with ccrp you can take all the D5 protocols and have composability across the entire web3 landscape where D5 decks on polygon you can combine that with a lending and borrowing protocol on arbitrim right so D5 composability across the board you can do cross chain nfts you can mint an nft on one chain make it available on that address on multiple other chains you can combine the cool features of account abstraction and you can add a blockchain abstraction layer to that as well have a think about that gaming is really cool you can have game assets available on multiple chains and when I play games at home on Xbox a lot of the games I can play against people on PC web free games should not be any different like let's say you're building a turn-based game that's not real time there's no reason why me on arbitrim shouldn't be able to play a game against Steve on polygon this is what ccrp enables so now you know what the cross chain smart contract is you know what ccip kind of is and you think well I've never built something that's cross chain before why should I try now right so um I'll give you a couple reasons the first is you know we have bounties and that's why everyone's here we've lost the slide yep that one yep um second reason this is the most important to me uh in my opinion right so we've all had a great week at FCC and it's now culminated to the eth global hackathon here um but guess what everyone here is in competition with each other and everyone would love to be have their project declared as one of the finalists right so there's going to be a lot of great projects I'm sure yours will be too but um you need an edge you need something to stand out above everyone else and application cross chain application that you deployed on multiple chains that talk to each other across multiple chains that's a big deal that's going to impress the judges not just us and if they're looking at two projects that they love and they're not sure which one to progress and one of them is a cross chain application and one of them is not guess which one they're going to choose they're going to choose the cross chain one sorry go back one more time and one more point I'll make is when you use chain link in your project it shows you're serious about security and decentralization and Trust minimization because um that's kind of synonymous with the name chaining right default protocols have issues they have flash loan attacks price Oracle attacks and they come to us and say hey can you help us out we've had this issue and then they use our services and then things work fine and then the community says okay cool they're using chaining now things are safe so when you use chain link your project automatically inherits those properties security trust minimization reliability not just at the technical level but at the social kind of level as well because you're showing the world you care about security uh and and that you're now powered by chain link yep and again so ccrp we think it's the easiest cross-chain protocol to use as a developer you can go forward again um we've taken a lot of time to design it so that you can easily just uh with just a few lines of solidity the billing is really easy and seamless and in terms of developer experience and friction we've tried to make it as good as possible so that you can use it and this is important because you guys are on a limited time so um we're going to talk about a bit more about that in the demo let's move on so now I'm going to introduce our friend Steve Ellis here and he's going to talk a bit more about ccrp thanks Harry uh uh yeah so not only in we it's not we think you should choose CCP not only because it has the simplest developer experience and the easiest building model for to integrate with quickly but longer term uh it is the most secure and so if something comes of the sackathon project you want to turn it into something else it will easily be able to scale up use this uh on like on a production level application so just to walk you through some of the security that we have baked into this uh so there's essentially uh three different steps that this goes through uh there is you first send your message the on-ramp at this point you kind of stop worrying about it you just send a message actually outer and the router then routes that it will get picked up by one of our decentralized Oracle networks these are what power all chain link products this is uh the the base level of security for everything that we offer uh after that it gets uh it uh once the chain has finalized that the message gets written on the other side the arm network uh will then confirm that message we'll talk a little bit more about the arm Network later but the arm Network checks that message uh and then essentially unlocks what the next oh blesses the message so it can be passed over on the next chain so the chain that's then unlocked on the destination chain and the executing Dawn picks it up and delivers the message for you on the other side uh so pretty much once you lots of security baked in behind the scenes you just have to send one message to the router gives you easy pricing quote um and just to describe the arm Network a little bit the arm network is our security it is a complementary second Dawn it is a second client implementation written in Rust different language written by a different team completely separate so for sure that none of the same bugs will like no no bugs are going to show up on one side and then uh and and they'll be caught by the other so this watches monitors the network brings an extra level of security and but hidden behind the scenes from you you won't have to worry about it your options can scale up to however much TPL you want uh and so I'd recommend both easy use and long-term usage I think this is a great way to start getting involved with CCA thank you Steve we're pressed for time so we're going to move on next slide so if you want to use token transfers in CCP we've got two deployed erc20 tokens on all the chains that are kind of generic tokens that you can use one of them is a lock and Min one is a burn and mint so the lock and mint token you can go to the uh deploy contract and mint as many as you want and it locks up tokens on chain a and then mince them on chain B and then when you go back it kind of does the opposite it burns them and then unlocks if you want to use the other deployed generic ESC token for whatever purpose you want um the burning in one it'll burn on chain a uh mentor on chain B and then you know backwards going back the other way so uh Messing already talked about I'm just gonna once again say you can send any kind of message you want it could be instructions it could be logic or whatever for the receiving block uh contract to do anything for essentially and programmable token transfers once again you can send tokens as well as a message to say hey here are some tokens and by the way here's what I want you to do with them now in the other smart contract on the other chain so just last point for myself um the fees is gas Cost Plus premium you pay in link on the source chain and you pay once you can pay link or in Native tokens for that chain or the wrapped version so you pay on that initial transaction ccrp will handle the rest it'll make sure that the um the other smart contract gets the transaction now we're going to see a demo from Seoul hello yeah well uh I love to do a hangzone workshop so I love to do you doing with me but I know that I cannot I cannot do this in 15 minutes so uh are you cop and paste a lot of comments for you are you cop and paste a lot of uh links and then you can do this later and our first you'll be around to help you okay I may move on from this and here we are if you'd like to get uh how that I'm doing I I will be here in this collaborative path so take a picture of this go to this link if you'd like to follow me now or later okay understood like to add your name and Country here could be good answer and I first of all I read copy and paste so many requirements for you so to add differential metamaski because I'm doing uh how today from Fuji to sepolya okay this was my choice we have other possibilities I choose this and if you don't have a fuzzy here you can add foji tomato mask you can get uh tokens uh on 4G you need to have it you you don't need to have the link token but because you can pay fees on using link or using uh the Fuji but are you paying links so if you'd like to have link tokens as well is this and my goal is to show you two or different ways to do this first using our head the head started kit and then using Remix They eases three okay they have the has started kit is this here okay and from there oh I forgot to one thing yes let's be sure that this is working yes this is the head hat starter kit it's good enough and then from here I'm going exactly to the example tree it's not 3. I'm not transfer tokens I'd like to go to example five no well but I is it must be open because uh I'm not I I am in a computer that is not in the network of training yes but he is you be shared with this so I'm doing the example six here we are okay let's edit this for you as well okay and what's the idea of example six is only to send some texts some messages and if you'd like to see another a bit complex example doing the the same thing but not a message but uh I did two days ago in HCC and it's record I transferred it uh I minted a token on Fuji and the token appeared on sepolya so in the same way that I can send a message I can send a comment to another chain so this is another uh good idea for you so to do this now again now you only copy and paste the instructions for you uh because it's this you get clone compile and we have some uh so important parts to show you related to encrypted environment because uh chain link created develop a new way to have your environment variables uh in the encrypted file and how you can do this first of all you need to set up a password and every time that you are open your uh your repo you need to set up this and I think this will be too small here I need to set up my password again and because I did this before I need to use the same password every time that I came in here yes I think I mean right and after this you need to set up it this variables okay uh these three variables and like get your private key I'm going from average for you to separia it and you run this command and set up each of it okay and following my my cop and paste uh like if you'd like to get uh the URL directly from chain uh changelist.org it's good it's easy okay this is another trip trick for you and I have in mind then I can show here because it's encrypted you can do nothing with this and this is the example what we need to do is this part so if you can follow me we are here so I will deploy the basic message center on 4G and I already set up pages okay you can see that Jesus is not my contact yet we need to wait a bit yes this is my contact okay and I can share with you because maybe we'd like to see my content later well hear it let's go to Disney okay uh no notice I can see my my keyboard so dark okay and this is done let's go to the next step that I have here in my step is here uh you need to send to fund because I'm using link I need to fund with feelings my contact let's fund it uh you don't need to send the one link can be less but to be sure now I'm sending my links we are using less than 0.

1 so I'm I'm in the right account and I'm assigning to this address not a wax but the link token and only in our starter kit you can do this in a comment as well I'd like to use metamasking this point okay now okay I have this saying that I go to the other chain and deploy the receivers here yes I have the comment done spending some seconds that you have the address of my receiver and I can copy the next comment for you as well because after this we are sending the message okay and that you like to get my transaction let's prepare this for you it's the same and let's see what's happened here um yes almost done wait a bit come on I don't know if it's my internet I have another receiver that I did before maybe I can use it should be fast I use this receiver before and the like after after I have in my uh like after I send and after I receive I have the singer and the receiver I can send the message to send the messages I need to fill the center this is the same there and I need to fill the receiver let's see if my new receiver is here and not yet let's use the audio receiver because I cannot wait now this is the receiver and this will be my my message I change my message my message it'll be hello it's global try this and I need paying fees in link let's do this oh I need to wait oh okay so I'm awaiting this let's do another Point as well because I told you that I'd like to do another contract reusing remix so the remix part you'll be this uh we have the this tutorial in on remix okay the cross chain tokens and we have a lucky Harry said before we have a special token that you can use to test and to transfer to all places I have it is as well and this is some parts that we need to have I create a special contract to use this that I did some part faster for you I added my content here because it is not on the documentation and you can use this content you can copy and paste this conflict because I put out the information that we need the how there's everything is here as well and I have the right interface and this content that it is here what I'm doing here I'm using the how to do the transfer I'm using the chain link client the link token interface and another uh interface for the uh the token that I told you before okay and everything is set up here right this is the Hotel this is the link token this is the address of the CCAP test token and the destinations change selector when I go to this is important to you to understand where is this like this is the supported Networks and here you can see that for example if you'd like to go to understand sipolia this is the change selector to go to sepolya this is the how we go to support their links I mean on Fuji so this is the I'd like to go from Fuji to sepolia and I have with these tokens that I can use in this time okay and what's happened here oh finally okay oh two minutes I know uh are you not are you send my message but uh we cannot wait my message to be in the other thing because it you used to have four minutes to to move from one chain to another unfortunately next time this guy you're not talking before me I I start myself and then you talk later yes and this is my receiver now can I add my receivers here this is my new receiver and I assigned this command and then we can check the translator in some place this is the message and when I go to the transaction I can check this in our ccip Explorer uh yes this transaction will save my life but this is only a part of the transaction this is one part and we need to get to the other part that is here and okay this is my Transaction what will you do with this now I'm going to the ccip Explorers and to conclude my presentation and iOS is Steve only to talk uh what are you waiting here now is if tell me uh now we are waiting for the for finality on the source chain and then once that uh Source finalizes then we will the arm network will sort of bless it to pass through and it'll get picked up so yeah right now we're still waiting for change by alley this is the security mechanism just to make sure tokencasters don't roll back yes and we have three status here it's Celsius finalized black said what is blessed uh blessed is when the arm Network the second implementation the second client has said has also verified that this uh this is a separate Dawn Network that essentially or decentralized Oracle Network that checks the one if they don't have access to move any funds they're they're purely a security mechanism okay great and uh the last stage you'll be the finalized when you really can check the other chain and the see whatever you'd like to Silver that can be the message for now remember that I added this for you so enough in two minutes you can check here and see that the message is over there and why we need to wait so long time and why is this time uh this timing comes from the blockchain's finality uh so yeah in this case um it is just how many blocks deep uh Avalanche has to be before uh it is okay yeah so with this I know that you have here the all the contents that we need to check it now but I know that yeah I couldn't finish what uh if I have you one more minute I have one minute yes okay I have another minty I'm so happy I can go here and using the content that I shared with you and the other average setup it I would apply the content just now here we are I have others deployed but let's deploy a new one and okay this is I'm is my contact you can check my contacts later uh no this is not my conflict my concept is here so this is my content I need to fund my content as well with link so let's go here send uh signs from not sure how tall no no no I'll sign the 2G said to this and send the link again remember that I can pay with avex as well and once it's funded I can see I can send the message let's use the order that I did before this is my example transfer and let's switch this transaction be confirm it contract interaction confirm it this is the block Explorer so if I go to I will explore it and see gist this is the other transaction that I did now and we are waiting for this transaction as well and this I already mint tokens in one chain and this will be uh minted in one chain Bernadine chain and appearing another chain this is how the process let's see I the first is then oh I'm so happy because now we can see let's go let's come back here to finish our Workshop here I send the message and I can go to the receive address and can see this okay let's edit this for you to be sure that you can see with me and this is my receiver address that I changed what my new receiver address because I changed the messaging we serious what I do now uh here is there is receive address and let's see our message and the hello which global patties thank you everyone

Automatic transcript — names and jargon may be misspelled.