Crosschain Governance and Messaging with Chainlink and QiDao
Stable Summit·Mon, Oct 9, 2023, 12:00 AM
"Topic: Crosschain Governance and Messaging with Chainlink and QiDao Panelists: Pablo the Penguin (https:twitter.com/@itspublu), Core Team, QiDao (https://twitter.com/@QiDaoProtocol) Sam Friedman (https://twitter.com/@proof_of_sam), Solutions Architect, Chainlink Labs (https://twitter.com/@chainlink) Hosted at the inaugural Stable Summit in Paris. Websites: https://chain.link/ https://www.mai.finance/"
Transcript
[Music] thank you all right sounds good so we'll be doing a little short-ish 30 minute talk about cross chain building and cross-chain protocols Etc it's going to be uh me I'm a core contributor of cheat out from Pablo the Penguin and Sam Sam Friedman because right here he'll be hopping on another in a minute so overall uh this is a little quick outline of what we're going to be talking through effectively what are we in terms of Define Landing protocols and different kinds there's a ton of different assets and a lot of not all lending Protocols are kind of built equal and kind of go from there into what is the cross stream protocol and how can we make them work and then a little bit of how we are interacting today and then how we're using ccip the chain links Crossing interoperability protocol to be able to interact between the different chains based on the initial architecture that we have and then a little visual explanation on that so for starters when you're building on Cross chain you have to look at different uh features so a feature is something like a swap a lending a borrow that you do that affects the users lets them do something you want to make sure that it's uh it punishes dishonest activity and that activity could be borrowing too much or borrowing too little now that could come with different array of effects like if you borrow too much you can't liquidate your particle goes into bad debt then people come yelling at you that you took that money and Etc or too little and the protocol has a lot of dust that isn't able to be controlled or managed by the Dow because it's just ineffective to transact so a couple of examples are slashing in proof of stake and over collateralization in the landing particles as you can see the little buffer is what provides the bonus to encourage the process of liquidation otherwise if there's no bonus there's no reason for somebody to just take that collateral so all of that falls into the game theory and the design of your protocol so you're looking at different parts and seeing how they can interact one of them major one is the arbitragers so a liquidator comes in takes a collateral pays back some that denominated and die or my depending on the protocol and they're able to take that collateral now this is being evolved at least in the last few months you know you've heard of CRV USD pretty awesome protocol at the end of the day what it does is take away one extra step instead of needing an arbitrary and a liquidator you just need another charger by plugging it directly into the amm out of the automatic Market maker so now when we go into lending you have a variety of different lending protocols we got different uh synthetic types of assets where you have positions that can be taken within the protocol and those positions are synthetic you can't touch them so for example on gains or DMX you can take a position 50x on each you can't take that 50x and drop it somewhere else say on Ave and earn liquidity for earned interest but on AVID for example you can deposit e take your CC and you can take it on LP on unit swap that's the difference between a synthetic and a genuine position and then you have bold and isolated where old means that all the assets are kind of in one General group C of it where all the e all the UCC how we die is technically pulled together versus another protocols like synthetics and cheetah where the poles are separate and isolated so when you borrow one thing that's one loan and it's not grouped together with your multiple loans so then we add the other dimension which is kind of what we're here for across chain so in Cross chain there's many flavors and a lot of people like to kind of categorize them in one way or another but it really kind of boils down to how much interaction happens across the chains you got simple simpler deployments which are independent of each other such as Avion compound where your position does not necessarily affect uh between the different chains so if you have a loan on ethereum and alone on Avid or on polygon they are independent of each other they don't interact but you're still able to take the acid and move it around now when it comes to cross chain there is this connection so you could potentially borrow my on polygon then take it to optimism and repay your loan that effectively makes the protocol itself cost you there is the potential of omni chain which isn't really been explored about except in marketing speed to make a protocol truly committing and when I say that it would be you have collateral and optimism and collateral and Phantom and you use that to generate a loan that maybe is represented in optimism that's kind of the future we see that a lot with the plants without lymphatic with the value layer of the internet with base chain and optimism it's gonna be a lot more cross-stand interaction and that's when we'll see a lot of that play out but until then there's not a lot not any that are fully available so a little bit about Chio where a cross chain protocol for stable points where you can borrow mine minted through depositing other collaterals here's a little preview of the different collaterals you can access how much exposure you can get per asset and these as I said before they're isolated and the mechanism we use is overcollateralized lending so effectively you have to deposit a little bit more than what you're borrowing and you can now have access to that my while you have an asset earning yield that's different than this your typical Avid position where you have native or vanilla dye and borrow against it here you can borrow something like DDI which you can gains earning and interest but now you have access to the underlying and maybe you want to do something with it an easy way a lot of people do Financial advice but you can deposit this keep it as uh kind of a savings account and then take the my sell it for you CC and you still have extra working capital um the robustness of the system was proven a few months ago with the V2 version which we launched last year where you'll see CD Peg bringing down all the stable coins including DDI and people were still able to liquidate to a different mechanism now those mechanisms are all backed by chain link we use chain link and everything because it provides a nice base layer of trust there's liquidity management there's uh tracking of the prices on every single chain that they can be on which is big enough that it's way harder to attack on Trump as you can see all these variables here are generated through the chain link Oracle you can there's a lot more data than a regular user may need to see but it's really able you're really able to see exactly how much you owe what's the discount based on the my price if the my price goes up or down you might be incentivized to repay we show that as well and your ratios so mine is the stable coin that we meant through any user commands to the cheat app and it's uh in general there's the engine there's the canonical token and lastly the governance model so in most chains that were on about 23 24 we are at level one which means there's liquidity for mine and there's a way to bridge sometimes two or three and the second part is the lending engine using uh chairman oracles to enable users to Mint that mind and the third one being once you're big enough within a chain we're able to deploy our governance modules and effectively let the user start controlling directly the chain so as I said with level one token bridging is a very integral part of this strategy because you want to have mine and you want to have it anywhere you go you want to farm it on a random chain you're welcome to you want to farm it on optimism you can't you want to trade it or leverage it or do any professional positions you can but to get there you need bridging and that was something that initially we we decided that it's not something that it's in a purview or a business so we came up with a solution called the canonical token bridging which enabled us to be on multiple chains without relying on a single grid you may hear when you talk to a bridge they say go with us we'll launch your token on another chain now the underlying issue and the second order effect of that is they control your limit so if there's an other bridge that you want to integrate you can't that bridge controls limit and burns so by being able to create my on every tune ourselves and them providing synthetic liquidity to the grid we're able to close that wrist so if in case something happens for example in multi-chain we're able to remove that liquidity then we can talk to other Bridges such as axillar and Stargate which we did in the last six months or so and we're able to move a lot of the liquidity to these new Bridges and able to upgrade the system which enables us to continue working which a lot a lot of different protocols weren't able to do so it didn't have the ability so now they're forking or doing airdrop to kind of move away from that model and yeah a little more reiterating the importance of breathing if you want to survive more than five years you gotta know how to upgrade and what can you do to upgrade because if you don't and you don't plan for that it's not a good time so the role of cheetah just metering a little bit about what we do and the stable asset nature that we want to provide users don't necessarily have the ability to access usdc on certain chains they can't mint it directly that opens up a lot of issues because now if you want to have your CC on your layer 2 you have to go to ethereum implement it through Circle and then grade it now it's available in a few other things like polygon but still not available everywhere which effectively is a bottleneck or a lot of chains to Kickstart their capital and enable better money markets and now going to the governance side helps you down uh a lot of our governance is going through snapshot and we use that to collect all the signatures get people voting behind the scenes is a voting escrow key so effectively you're locking Qi for a period of time minimum a week or two up to four years and that enables you to have a higher voting power so with that comes the more disease so we have three main models that exact control the different aspects of the protocol for starters without the Guardians the Guardians controlled the vaults the vaults are the each isolated lending Market on every chain and also be my contract which interacts with the bridge pools the bridge pools could be acceler it could be something else like Stargate and other Bridges depending on something happens we can remove it from there put it elsewhere and the key contracts so all this is managed by the Guardians which then the fees generated to get put into the Gmail treasury which is technically uh in one or two contracts protocol and the idea is to separate the management versus the ownership ownership being you know do we need to change the oracles do we need to update any Vault parameters uh all that is separate and now how do we bring this and make it more uh anti-fragile you know we got a bunch of multi-sticks what happens to something goes wrong with a signer they lose some Ledger they lose their seat phrase how can you continue running so that's where we can bring in ccib so we've explored the idea of how to break a multi-sig in modules a few months ago effectively trying to bring the time blocks into the multi-6 so if there's one signer at least one of them alive they could submit a transaction and take a predetermined amount of time say two weeks you could that have that one sign of rescue the funds of the multisig and basically have administrator control after a long period of time so that in case something happens to the signers you're still able to access the funds and continue running the protocol now that opens up the door for attainment which we'll bring in a second the idea is that with chain link you're able to now send a message to the other chain with different deployments and basically interacting the same model of the timelock but using ccip which simply tells us a little bit more about thank you all right I'm a footnote the human footnote um thank you so I've got about five slides I'll cover chain link cross chain interoperability protocol at a high level also a low level any developers here yeah okay awesome I've got stuff for everyone so chain link ccip um has been in development for over a year finished Alpha Testing at the beginning of this year um cheetah is one of our Alpha testers and a launch partner and then we've been beta testing since since February of this year all kinds of use cases what ccip is is a way for protocols to build costing capabilities into their processes whether it's token transfers or message passing on support use cases like governance or balancing liquidity Etc look over the excuses in a bit um the way it works is a sender on a source chain which might be an externally owned account or a smart contract can send a message to an account on a destination and that message can include either tokens or data or both and data is just encoded bytes so it might be a simple string like a message like hello world or it might be some operational code or instruction that instructs the receiver on the destination chain what to do with the tokens when they arrive or what to do with the data when it arrives a little bit of code I'll go kind of quickly the way the sender's experience is every chain that ccip supports will have an immutable router contract on that chain smart contract on that chain and that contract has a function called ccip sends and it takes two inputs one is the ID of the chain of the destination chain and two is a message and that message is a data structure that includes the receiver so the address of the receiver the data that's being sent which is optional you can just send tokens with no data getting it optionally includes an array of tokens so token addresses and the amounts for each token um then the fee token so see so users pay to use ccip and payments can be made in either the native gas token the wrapped native gas token or the link token and then lastly there are some optional arguments that the user can set that determine how uh if all messages are delivered in sequence by default but if strict sequencing is set to true then if a message gets stuck then future messages are held until the stuck message is fixed so we've got workflow around that and all fees for ccip are paid by the sender there's no fee extraction from the receiver which means the sender needs to be able to estimate how much gas will be spent on the destination chain and that's one of the arguments that the sender can set so that's the whole sender's experience one quick item is if you look at the name of the structure of the message structure in this case it's evm to any message evm means this is from an evm family of chains and to any any means any other type of chain doesn't have to be EDM so the sender's experience from an evm chain is exactly the same independent of what the destination might be so if you're sending from ethereum to Avalanche or ethereum to Solana sending the message is exactly the same on the destination side if the message only contains tokens and there's no need to process an incoming message then when the message arrives on the destination chain the tokens are just sent to the receiver's account however if the receiver wants to process a message because maybe there's data in the message or there's data and tokens and the data are is instructions on what to do with the tokens then the receiver is going to be a smart contract and it's going to want to implement Our receiver interface and the ccip receive function the router on the destination chain calls the receiving smart contract with a message call ccip receive on the smart contract receiver smart contract with a message and that message includes all the stuff you would expect a lot of it all of it which came from the source so one is the message ID which was calculated on the source then the sender The Source chain ID the sender's address any by any data if the sender chose to include data in that message and then that array of tokens and then it's up to the receiver to put whatever logic they want in their ccip receive function so that they can maybe process data or do something when the tokens arrive all right so a little bit of a deeper dive um into our architecture with a focus on security so this is really the same slide as this but I'm opening up this black box right here so on the source chain we still have the router contract the immutable router contract which goes to an on-ramp contract there's a separate on-ramp contract for every supported destination chain and then there's a token pool contract for every token we support and the token pool contract will start with their on-ramp contract the on-ramp contract would just check things like was the receiver's address specified in the correct format for this destination chain the token pool contract would have rules like what's the token handling mechanism are we burning the token on the source or locking the token on the source it might also have security rules like rate limiting maybe this token issuer doesn't want to allow more than a hundred thousand dollars worth of value to be transferred over this particular Lane Source destination within a small time frame like one hour so the token issue can set rate limits and protect themselves against things like infinite mint attacks after the source chain transaction has been finalized and an event has been emitted then we have some off-chain work the first thing that happens off chain is there's a committing Dawn Dawn is a decentralized Oracle Network it's the same application architecture and network that supports our price feeds our automation functions or other Oracle services the committing Dawn takes a snapshot of all the finalized transactions within a certain time frame for a particular source and destination chain I'm going to get a little technical here creates a Merkle tree and posts the Merkle tree roots in a smart contract on the destination chain and for those that don't already know a Merkle tree is a data structure that lets you summarize all the elements in a set with just one value like a hash um and it's cryptographically secure so the committing Dawn posts proof on the destination chain of all the transactions that are finalized on the source chain after that happens we have a separate Network called the active risk management Network that does the exact same thing and compares the Merkle tree roots that it calculated with the one that was published by the committing Dawn in the commit store if they match that's great the active risk management network will bless that Merkle tree root or bless that proof after that happens we have been executing decentralized Oracle Network that can relay all the messages from The Source chain to the destination chain as long as it has a valid Merkle proof of that transaction so we have three different networks of nodes of Oracle nodes all involved in [Music] um securing the network and two of these decentralized Oracle networks the committing Dawn and the executing Dawn are the exact same technology that's been securing our price feeds for the last four years are automation Oracle or functions Oracle or proof of reserves Oracle so there are no new trust assumptions when using ccip the architecture is the same as all the other products the technology is the same as all the other products that we've been supporting over the last few years securing trillions and transaction value in D5 on the destination chain when the executing Don submits their proof with a message um that message goes to the off-ramp and if the message contains tokens is checked against the token pool the token pool again would have rules like rate limiting token mapping this this token address and the source chain maps to this other address on the destination chain rate limiting and um the token handling mechanism so are we unlocking a token on the destination chain or are we minting a synthetic version on your destination and then when that's completed the message goes to the router which is that immutable smart contract which sends the tokens to the receiver and then optionally calls that ccip receive function all right that's it for architecture so some guidelines security guidelines when we designed the system one is we're using the same Network architecture processes to secure and build ccip as we have for all of our other products so there are no new trust assumptions when using ccip if you're already comfortable with our price feeds then you should be comfortable with ccip technically um two we have a new components of the network called the active risk management Network the active risk management network was developed by a separate team at chain link Labs using different application architecture different programming languages different software libraries to minimize or eliminate any risk of a supply chain attack so if there's a vulnerability in our architecture that hasn't been detected over the last four years it's suddenly detected the active risk management network is not vulnerable to that type of exploit it's a completely separate system um two we have several built-in features to protect value and token transfers so one is a token issuer can specify rate limits for a particular token and Lane and two we can set rate limits in aggregate for total value of tokens sent over the network in any Lane um and then uh chain link Labs does not own all the contracts the owners of the contracts are the decentralized node operators independent node operators that run the nodes that secure the network or run the network chain link can propose changes but the owners again which are not shaming Labs can veto any change um and then lastly the system is designed to to favor safety over liveness so the active risk management Network in addition to its proactive it's uh let's just say in process role of blessing Merkle shoe roots or or making these proofs available also proactively monitors the network and detects any sort of anomaly or abnormal circumstance and can place curses and pause the network if anything bad is detected so ccip can be used for all kinds of things if you're just transferring tokens payments liquidity management token transfers or use case all by themselves if you're using just the data or arbitrary message portion of ccip then cross chain governance is an excellent use case also managing State across cross chain apps like cross chain accounting nft projects that have components of the nftn multiple chains games that span multiple chains and then programmable token transfers can be very useful for Enterprise Enterprises or traditional Finance doing delivery versus payments or DPP type transactions where payments is made in exchange for some sort of asset through an escrow contract that can be done cross-chain and all kinds of cross-chain use cases are unlocked whether it's cross-chain field optimization cross-chain lending Etc that's it I'm available if anyone has questions afterwards thanks Sam so after that we have a little bit about cheetah what we're doing on ccip which it all begins with uh the single chain execution so basically what happens here is you have events happening on ethereum and these events can be propagated to other other chains the other deployments using ccip so these changes could be triggered in a variety of different ways you can use something like Uma and as an oracle or reality.e and basically pull the data from snapshot execute it show it in the multi-stick and then transfer that payload to the different chainsaws uh SUV as we wish and then the second one being multi-chain governance which is way better and cooler from our perspective as it allows us to be more flexible every Hub every deployment is a collection of contracts is able to enact unproof changes to the other deployments Now using some of the programmability that ccfp provides us we can create a pseudo-consensus algorithm that enables the different deployments to understand what a quorum is how many votes are coming from each chain and be able to then execute a change based on the time lock and give us a true kind of any chain working environment and so the future role for chain link as well can be in very simple things like a ferry so enabling people to kind of group all their payment all their cross streams cross train transfers to different chains and basically he charged a lot less fees or even free subsidized by the protocol but maybe at the cost of higher latency and other things like consensus style things where you want to do a very custom circulating market cap require on one chain you can now use this to force that liquidity to be there on a specific chain such as saying we're only going to provide x amount of bridge liquidity which would enable x amount of capital to remain within the chain programmatically rather than enforce it through a multi-sig um yeah cool thanks [Applause] you can check us out on my.finance all the other links here foreign
Automatic transcript — names and jargon may be misspelled.