Principal Solutions Architect for CCIP - Sam Friedman (@chainlink)

ETHMilan 2023 · 23 Nov 2023 · 19:43

Sam Friedman, a solutions architect at Chainlink Labs, explains why cross-chain interoperability needs a standard and how the Cross-Chain Interoperability Protocol (CCIP) is built. He describes liquidity fragmentation and bridge hacks, then walks through the message flow from router and on-ramp to token pools, rate limits, the committing and executing oracle networks, and a separate risk management network. Examples include cross-chain governance, token transfers for Synthetix, bank experiments with Swift, and cross-chain lending.

Speakers

Topics

From ETHMilan 2023, hosted by ETH Milan.

Transcript

hey guys thanks for staying late I know I'm the last one my name is Sam fredman I'm from Shan link Labs I'm a Solutions architect I work on a couple different projects at chain link Labs one is we have an incubator with 77 projects I'm the technical lead on the incubator if you want to learn more about that just uh contact me afterwards and my second role is as principal solution architect for CH for uh ccip cross chain interoperability protocol it's a product we've been working on for several years and launched on testet at ethcc in July in Paris and launched on mayet uh sorry launched on mayet in July in Paris I was on test net long before that in uh

January of this year um and I'd like to share more information about that so one is I'll start off with um why is interoperability important or why do we need a standard for interoperability so in this I worked hard on my slides but I I probably could have kept it a lot shorter if I just scroll through crypto Twitter but right here if you read closely you'll see that curve Finance is explaining how to participate in three of their pools either you want to trade in their pool or you want to provide liquidity and to do so you have to use two different Bridges um and one of the bridges you have to use two different ways one

through the UI one uh directly through the Explorer or something else um also there's a good uh admission that even with explanation it's really difficult to use it's not obvious really impedes adoption and um lastly just another admission by Brian Armstrong um that it's really confusing for the users and I'll show you some evidence of this right now uh more complaints on crypto Twitter by the way this is there's 's a lot of consensus on crypto Twitter about this and I think everyone in this room probably agrees this is not a contentious point at all uh liquidity fragmentation is a problem it makes things confusing it makes composability

very difficult it makes liquidity management very difficult um but more evidence so a lending protocol on Avalanche has usdc and tether but there are two different markets for each of those assets liquidity spread out um almost evenly uh one of my favorite is also an avalanche usdc so a couple stable coins or Peg coins usdc usdc BTC BTC tether tether so the problem is everywhere dex's lending protocols um so why does this happen um there isn't a standard for

interoperability um there are multiple Bridges out there different assets support different Bridges different protocols support different Bridges this is very painful for Developers they have to maintain separate code sets depending on which Bridge they're using and uh leads to a lot of complexity which leads to lots of costs um liquidity fragmentation uh excessive trust assumptions if you're using multiple systems to do the same thing um impedes adoption because it makes things difficult and uh overall inhibits growth which is why we're here to solve that problem um so it's not just enough to solve the interoperability standard problem we have to do it in a secure and

reliable way and there's plenty of evidence I think both of the presentations prior to mine um hit on this point as well these are not all of the big bridge hacks from the last year or so it's not even the most recent ones unfortunately I prepared my slides too early and I'm missing a couple of big ones but these are pretty big numbers for our industry all right and then when we design an interoperability standard or an interoperability protocol there are lots of things to consider so there are interfaces that users interact with are these contracts immutable can they be changed who owns them they're supporting contracts are they upgradable who can

make changes what's the process there offchain components like Rel layers or oracles and um is there any kind of verification or transparency or understanding of how these systems are composed who owns and operates them are they secure are they reliable so I I work for chain link Labs we're in the cross-chain interoperability protocol space why would we do that people say hey you're an oracle you're an oracle shop why cross chain well Oracle solve a basic problem which is they make offchain resources available onchain and a lot of us know most of us know chain link for

data feeds or Market data um that's an orle that provides data offchain data onchain but uh data is just one type of offchain resource we might want to make available so our price feeds provide price data or index data commodity data for crypto products equities Etc but we also provide computation as an offchain resource and make that available onchain we have an automation Oracle we have uh uh functions Oracle that connect smart contracts to JavaScript and the internet so offchain computation is just another type of Oracle and then when it comes to cross chain that offchain resource just happens to be another blockchain so all of these products fit very well within

our uh product set or portfolio of products solving the same type of problem we make offchain resources available on chain now there are a number of ways you could design an orle system and we've seen lots of different examples of this we've seen single entities with a single server um we've seen these fail um catastrophically just in the last few months we've seen systems set up multiple servers but owned and operated by the same system we've seen we've seen organizations set up a network to run processes um but a single Network and it's the the node or components on this

network are often owned and operated by the same entity and then we've seen organizations use multiple networks to secure different components of a system or different feeds and at this fourth level with multiple networks very accurately describes chain link oracles that provide price data on chain so each price is supported by a different Oracle Network each node in that network is owned and operated by an independent node operator with cross chain interoperability we took one step further and we used these existing decentralized Oracle networks plus a a second type of network called a riskmanagement network and I'll describe

the function of that riskmanagement Network in a moment but the key point right now is the risk management network was designed by chain link Labs but by a separate team using different application architecture different software libraries and programming languages and a different consensus me mechanism so chain link has been developing decentralized Oracle networks using them for the last four years to secure trillions in transaction value and that decentralized Oracle Network architecture uses something we called OCR offchain reporting this is a Byzantine fault tolerant offchain consensus mechanism so all the nodes in this network again each node is

independently owned and operated not by chaining Labs but by uh node operators that are kyc have gone through a vetting process etc those nodes communicate with each other and come to consensus offchain on an answer one of the nodes creates a report with all the signed answers from each of the nodes in that Network and then one node publishes that report on chain ccip is a plugin on top of that Network just like price feeds just like automation just like functions just like proof of Reserve there's all the same architectures are existing products so there are no new trust assumptions and then while you can build things like token Bridges with ccip um it would really be a disservice

to call ccip a token Bridge that's just one of many different use cases that uh it can it can uh satisfy with this architecture so we've seen our users build token Bridges um satisfy cross-chain governance requirements um embed ccip in wallets or other protocols um to support all kinds of cross chain use cases that we never thought of now the last component you see here on the right is the risk management Network which I explained uh is a completely different architecture and I'll explain its role in a moment at a very high level CCI enables an account on a source chain to send a message to an account on a

destination chain and those accounts can be externally owned accounts or smart contracts and those chains can be public chains or Bank chains or private chains uh and those those uh messages can include data or tokens or both data and tokens now sending data only that would describe a couple different use cases by one of our launch Partners a a has two different governance use cases that use the data handling mechanism of ccip one is they enable able a token holders to on uh remote chains like Avalanche and polygon to to vote on Main net proposals

without having to bridge their tokens so votes can be cast from remote chains and ccip delivers that vote count or accounting back to the main uh main net uh the Second Use case that a has is also governance and uses the data handling capability and that is also um related to governance and when main net proposals pass the payload is sent to the remote instances of a and other chains as data in a ccip message for token handling I can point to another launch partner synthetics that built their own token Bridge called uh synth teleporter the synth teleporter enables synthetics or snx snx USD

holders to send snx USD between ethereum and optimism where snx USD is burned on the source chain and minted on the destination chain that can go bidirectionally uh synthetics built the UI and some supporting contracts to embed the application or the token bridge in their in their decentralized application but they use ccip to burn and mint the token and send messages between those chains and then a use case for including both data and tokens might be exemplified by work we did with A&Z the bank in Australia that sends stable coins between an avalanche subnet and a public chain to settle uh to to um

handle DVP or delivery vers payment use cases so you can send stable coins with instructions to swap those stable coins for security just a a few examples all right and let me uh talk a little bit about our architecture and our defense in-depth approach to security so I've already explained that ccip Ena an account on a source chain to send a message to an account on a destination chain that message goes to a router contract this is an immutable contract on every chain that ccip supports the router contract will send that message to an onramp there is a separate on-ramp contract for every supported destination

chain the on-ramp contract checks that the message is compatible with the destination chain so the message might have uh destination change specific parameters on evm chains for example that might be a gas limit if the on-ramp contract validates the message and that message has tokens then the message is checked against a token pool contract every token that ccip supports will have a token pool contract and the token pool contract primarily does two things one is it checks a rate limit so every token issuer can Define their risk exposure in terms of a rate of token tokens that they will allow to pass between any

source and destination chain as an example synthetics set a rate limit of 100,000 snx USD per 10 minutes so if any message surpasses that threshold it will revert the second thing the token pull handles is the token handling mechanism so are we burning tokens on the source or are we locking tokens on the source and then on the destination chain the the token pool contract would handle either unlocking tokens or minting synthetic versions or native versions of that token after everything on the source chain passes an event is emitted and then nothing else happens until Source chain finality most of the chains we've integrated with today have a finality

flag and ccip waits for the finality flag to protect against reorgs in cases like polygon then we wait uh a safe number of blocks so the first offchain action is handled by the committing decentralized Oracle Network Network the committing decentralized Oracle network is the same application architecture as the decentralized Oracle networks that secure price feeds so no new trust assumptions the committing decentralized Oracle Network or Dawn creates a Merle tree of all the transactions between a particular source and destination chain and publishes the Merkel tree root in a commit store contract on the destination

chain and if you don't know what a Merkel tree is it's a data structure that's used to support a cryptographic proof or cryptographic process so after the committing Dawn creates the Merkel tree and publishes the Merkel tree route in the commit store contract on the destination chain then the risk management Network snaps into action and performs the exact same task so secondary validation except done from a separate network with different application architecture a network AR architecture different software libraries different programming languages creates the Merkel tree or each node in that Network individually

creates the Merkel tree and then checks the Merkel tree route against what's already on the commit store and if they match then those nodes cast blessings on the commit store and if they don't match they cast curses on the commit store once that Merkel tree route on the commit store has re received a threshold of blessings then the third decentral or third Oracle Network or decentralized Oracle Network comes into action and that's the executing Dawn which can submit transactions from the source to the destination chain along with the Merkel proof which has been validated by two separate decentralized Oracle networks it's a lot all right so a

couple points um I mentioned that the router contracts are immutable they'll never change but are some supporting contracts like the on-ramps and the token pools those are upgradeable but they are time locked chain link Labs does not own those contracts at best chain link Labs can submit proposals to upgrade those contracts and the owner can uh veto or has 24 hours to veto those proposals um one there are no new trust assumptions with the committing Dawn and the executing Dawn those are the same Oracle networks we've had in place for four years securing trillions in transaction value and then the the second type of Oracle Network we use is a completely different architecture the

node operators in all these networks are not chain link Labs they're independent and The Operators and the risk management Network do not overlap the operators in the other networks token issuers can set their own rate limits and uh the risk management network has one more role so in addition to creating those mer trees and blessing the Merkel tree roots it also constantly monitors the onramps and the off-ramps on the source and destination chains for anomalies or abnormal transactions when it detects something abnormal it'll cast a curse on that Network and pause ccip operations on that Network so the system is designed

to favor safety over liveness all right so very high level architecture and flow for ccip this is a standard we think we're well position to set um what we did for security we'd like to do for interoperability and bring composability to the space um but we can't do it alone we have to work with Partners so I've already mentioned a couple a adopted us for governance uh synthetics adopted us for token transfers between ethereum and optimism uh uh some of you may have seen the news the summer we completed our second proof of concept with swift where we connected Banks to to uh bank accounts or Banks blockchain accounts on

private and public networks and enable Banks to send messages um tokenized assets like bonds between private and public networks we've also been working with the member banks of Swift like A&Z also uh published their report and dtcc also published their report where we're connecting private networks and public networks and sending tokenized assets and then lastly we have a network of Partners that we work with so I mentioned earlier my role in build or incubator so several of our build Partners um being part of build have been involved in our beta testing of ccip but have also started adopting it on test Nets and M Nets preparing to go

live folks Finance they're here today I I don't think they're in the room but they're at the conference they are using ccip to build a cross chain lending protocol where users can lock collat Al on one chain and then borrow against that collateral on a different chain so that's most of ccip um we we are I think everyone understands or expects that there will not be one network to rule them all there'll be lots of heterogeneous networks we want to be the standard we want to bring security or what we did for security on data feeds and and computation we want to do for cross-chain interoperability and bring about Ultra composability have the banks use the same technology that we use and

grow solve real world problems that's it for me thank you

Related talks