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

Loading player…

Keynote: Gateway

ETHGlobalSun, Oct 9, 2022, 12:00 AM

Join Jared Flatow for the Summit Keynote Talk titled, "Gateway," all part of the Compound Grants Summit. The Summit is taking place during ETHOnline, a month-long virtual hackathon with over 1,000 engineers, designers, and creators building new protocols, learning at summits and workshops, and gaining valuable feedback from ecosystem professionals along the way. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Music] [Applause] [Music] to our next talk and our next speaker is jared and jerry's going to be talking about gateway so i'm super excited about this thing but i'll let him uh tell us everything about gateway welcome thank you uh thanks for having me um let me just share my screen here uh let me know if ever you can see it hopefully you can see it um but yeah yeah hi everyone thank you thank you for having me um it's great to be here my name is is jared um and uh just a little bit about myself so i've been at compound for um about two and a half years uh pretty much joined starting work uh designing and working on the v2 protocol um which is it you know we now know is the compound protocol um and today i i want to talk about gateway um so gateway is is um compounds blockchain project that we started last year and yeah just um hoping to sort of explain what it is um why why we're building it and give you a little bit deeper understanding maybe how how it works and sort of what like the current statuses and things like that um so yeah jumping jumping right in um i guess the uh you know why are we building gateway what's what's the motivation for gateway um in my mind there's there's always been uh like two two kind of uh a confluence of two reasons that um which are building gateway um one is the is sort of like the v3 version of the compound protocol um and um you know going back a little bit to sort of last last summer um at the end of last summer so uh the beginning last summer we started we began distributing our governance token on ethereum and we experienced like the the summer of defy and and what that explosion was like and um there was you know a real feeling of uh product market fit um the protocol went from like growing um sort of 10x per year to growing like 100x per year um so like basically from like moving from like 20 million in assets to 200 million assets in uh year one of its life the protocol and then like from like 200 to 20 billion um sort of beginning with last summer um and um i think what became uh pretty clear at least but you know if it wasn't already clear was that um ethereum was kind of like unusable for for the average person at that time like gas costs were getting extremely volatile um and mostly just expensive um and still are the network was congested um and we started to think about like scaling how to scale compound beyond the boundaries of three minutes or um reach um uh you know a broader set of users um and so that you know part of part of gateway is certainly thinking about how to how to scale uh compound and not like be constrained by the underlying network um at that time we sort of took a look around at the next generation of blockchains l1 zl2s side chains roll ups all things and like what became clear and it you know was that it it was still going to take some time to see how how things would actually play out um but we knew that we wanted to build a v3 that sort of would work for for users no matter like which which um technologies that they were experimenting with um and we sort of concluded that having uh having a chain would uh would like ultimately let the compound governance have um like more control over the economics of the protocol and also um would be a way to keep uh fees slow in in the long term and um the promise of there was this promise of um polkadot which was that uh with substrate you could build a chain uh which was targeted to either run as like a standalone chain or um or as a power chain um and the idea with this constrained power chain is that yeah it's more constrained but um you don't have to worry about the security of the validators you're sharing the securities with the other para chain you're sharing the security of the relay chain with the other parrot chain and um and the validators and the consensus layer are shared and so um you really need to only worry about the availability of being able to process transactions and not um having you know servers available to process transactions and not whether um they're executing things faithfully or reliably um the problem is that like yeah i mean i guess polka dot was kind of has still yet to launch pair chains on on mainnet and like this whole time we've been working on gateway uh is you know has been an active development itself um but uh you know we also the idea was to sort of take the lessons from the past two and a half years get rid of the constraint um coming from the underlying network and um builds build a protocol that was sort of streamlined and to focus on on like our specific uh application uh or what we consider it to be um and yeah i guess for continuing on that like the other part of why we're building gateway is um in my mind is this cache token um which i think these these adjectives um they're pretty uh descriptive so i'll just unpack them so portable um you know it's it's it exists on many different chains um and can be transferred between them um it's it's a little bit uh special as far as assets on on gateway is concerned i'll talk a little bit more about that later but you know one one way which is special is it's interest bearing um and it's also a unit of account and so um you know they combine these things the v3 protocol cache token um you know we so the hope was is really was really to just focus on um building out um certain application uh layer and and leverage a blockchain framework um to help us deliver that um you know in reality i think we spent a lot of time dealing with um idiosyncrasies of the framework that we're using and um sort of re-architecting things a bit but uh you know this is kind of the original thinking behind behind things um and yeah i guess moving ahead um get back into some of that discussion later but so the how so what does the architecture for gateway actually look like um you know starting with maybe like more of like an end user point of view like the the um so the vision for for gabe is you know actually pretty fairly simple um in this simple diagram you have you can see like the stars on these um representations of like connected chains to gateways so you have a chain for gateway and then you have like other chains which are connected through their star ports so in this example like ethereum and tezos um and the idea is that the star ports are the main point of contact between gateway and these other chains there's there's something like a smart contract um on on each chain and um whatever the analogous concept is of a smart contract on that chain and um and gateway has like a superset of all the addresses which exist on all the connected chains um and so you could like you could transfer between um an ethereum user and a tezos user by um maybe for example you could you could upload each on ethereum so you lock ethereum in the in the ethereum start board um that emits an event and becomes part of uh gateway and now that the user on ethereum can borrow well they could they could send the e to the uh to the test address but then they wouldn't be able to extract um to a tesla's address because the ether itself wouldn't exist on antezo so we don't have any kind of wrapping of assets at this time so um you know the the easiest thing to do is it's like you can borrow cash against um against the the eth on um on tesla from the user point of view all they have to do is um like lock the heath and then they can they can transfer cash um which automatically borrows against uh their ease which i'll talk a little bit more about in a second too but um you know from the tezos point of view um you basically talk to uh gateways and say i want to extract this cache that uh that i've received and um you get a notice that you take to test that lets you actually pull the cash out of the starboard on the test side um and you know there's i guess there's from like the architecture point of view there's maybe a few things um to note here uh so first of all there's like there's only a few there's a few protocol actions um it's pretty small surface area as far as the protocol is concerned um you know what's not shown here maybe is like there's also a mechanism to um synchronize the so because this cash token exists on on these different chains and because it's interest bearing there there's um there's an interest rate and um there is a mechanism to synchronize the the rates between the chains but um you know overall pretty pretty simple um mechanisms and then like once assets are inside gateway or updated to the star ports um you know it becomes a lot like a typical smart contract on another chain um where things come a lot easier you're sort of working with with assets that are all in one place um you know maybe the harder part no not shown here is um like how we ingest this data and emit these notices get a little bit more into that as well um yeah so like talking a little bit about what the surface area of the protocol looks like so i mentioned there's there's only a few functions there's the functions which exist are basically lock um so upload lock which is basically lock transfer um extract just basically download and uh and liquidate um you know if you're familiar with the v2 protocol these are very similar what you'll notice though is that there's no barring barring and repaying or supplying and withdrawing um barring is actually now a state and not an action and and this is because of um another improvement um we made which is to instead of having two signed balances or two unsigned balances which are the supply and borrow for a user like in the vp protocol um we don't even have the ability to represent um sort of undesirable states anymore uh where you're you're borrowing the same asset and resupplying it um which is never really uh is something that people do but doesn't necessarily make sense for the protocol so um basically make that that state those states now unrepresentable and borrowing becomes um a state where you have a negative balance instead of being a separate action um with a separate balance associated with it and um yeah i mean it's kind of cool because you can you can do things just like upload ether and then um and then transfer and you're and when you try to transfer your your balance so you could upload ether and then transfer cash like in the previous example and if your cash balance happens to go negative that's fine as long as you have enough collateral to cover it it's just automatically borrowing cash from the protocol and by the way cash is created by variate from the protocol i guess the the other things to note here are that um there's we also as compared to the v2 protocol um sort of upgraded the the risk engine um in the v2 protocol there's collateral factors which apply to like one side of a balanced equation um on the collateral side uh we're currently um using now factors on both sides so adjusting bottle balances by by these uh calling volatility factors now um and using them on both sides but uh it's it's something to help with the the ideas to help with the capital efficiency of the system uh and and um representing the risks more um in a little bit finer grained way um but yeah i mean i guess the larger idea is with the gateways also to be able to do things like upgrade the risk engine now completely um and do more sophisticated things that we weren't necessarily able to do um inside the comptroller contract on ethereum um but yeah i guess the last thing to notice is that there's like a change to liquidation as compared to the v2 protocol um so in the v2 protocol liquidators always repay debt and then they basically repay borrow and then seize some collateral in in gateway uh liquidators can uh basically transfer debt so they can assume the debt of the borrower without having to necessarily repay it and um this is kind of an improvement and and we introduce it because um gateway is it's a separate chain now and having to repay or supply an asset before liquidating would be an extra step and um in general we've always tried to to keep the liquidation system in compound um you know with pretty like quick turnaround we think that um speed is sort of uh a big advantage when it comes to liquidations and so uh removing the requirement to upload collateral first in order to be able to to um to liquidate somebody sort of opens up the set of possible liquidators can that can that can form the liquidation and doesn't really hurt the protocol so um it's it's kind of a nice feature i think of gateway that we change liquidations in this way um talking about cache a little bit more so um i mentioned that it was portable and interest-bearing um portability as i said it comes from the fact that it um it really exists on every on every chain that gateway is connected to um it is it is interest bearing so um all cash in gateway oh sorry all interest in in gateway is um is paid in cash or is earned in cash um and actually it's done uh getting well into the weeds but unlike v2 it's cash is sort of accumulated linearly by the markets in in asset markets and then um for all compounding kind of happens in cash itself um also compounding now happens over time instead of uh over blocks which is a slight difference from from v2 but it kind of um it's uh you know just to think about what you what that means a little bit um uh it's kind of nice for something like an nft market or something where you can't necessarily pay interest in the underlying um because you can't uh you know maybe there's only one of you know one one token which constitutes the underlying um so but you always have an asset which you can pay in uh interested just a little about cache and then um starting to get into more of uh uh zooming in on the architecture and and some of the different components in the system um and how they start to fit together and um we'll sort of zoom in on on how these fit together more as we go here but um from the from the high level 10 000 feet um there's like there's really just a few entities so maybe like three layers and like four entities um like the runtime layer which is uh sort of the state of gateway which is is basically the yeah the state of the uh of the chain and it's the um it's what gets executed on in substrate uh which is the the framework we're using for for building the blockchain um it's so it's really the authoritative state of the chain and then we have the um the oracle layer which um you can think is composed of these both these oracles and archivists which the archivists just make uh are it's like archivists as untrusted from role which um which the oracles are starting with the oracles the oracles are really the trusted role they have keys which which in aggregate uh can be used to sign signed data going either to the runtime or to the star ports um so either events coming from the star ports to the runtime they can sign the block metadata and the events and those are persisted by the archivist and made available to the runtime and vice versa for assigning notices coming from the runtime which are then posted to the star ports um so like very high level um view of what the uh information flow in between between these high level components and giveaway looks like um to me in a little bit you start to see like more exactly what the interfaces between um between some of these components are um i think uh you know this is actually a pretty fairly precise um diagram so you um get a pretty good idea of really how how information moves moves in gateway looking at it but um you know so there are runtimes has all size things like prices um and it can accept requests coming from end users um and the oracle's uh fetch notices from the runtime by a number um and yeah i mean there's there's a lot more details to get into here but um essentially this is this is the things that can be done in gateway um and then zooming in even more um to sort of like the the exact um or like the implementation in substrate so um substrate is organized around these modules called pallets um pallets are sort of individual units modules within within a substrate blockchain which can have associated state and um events and uh in errors and extrinsics which they call them which are basically functions you can call and the first so the the what this is the first column is showing like which functions are in which palette um and so there's a gov palette which has um like a pseudo function which which um people can propose and vote um to call other functions in the chain basically through the gov palette um then most of the functionalities in the cache palette actually in the first version of gateway all functionality was in the cache palette and then um over the summer we um started to re-architect things um you know mainly to separate the to deal with some of the security concerns we had and separating the functionality of the oracles and really isolating them and and also being able to to um more well defined these boundaries between pieces of the system um so we had you know i was just saying we had everything in the cash pellet and uh things were pretty tightly coupled and it was it was getting already pretty hard to make changes so um one of the another goal besides the security of separating oracle's of the refactoring was to um was to make the dependency graph clear and not have things depending back into substrate um and and um you know yeah we have these defining boundaries between things um but yeah i think what you also you can see from from this diagram is well what what you can do in cache um so it has the ability to ingest blocks and execute requests coming from the users the users can do things like extract liquidate and transfer um to get a sense of what the notices are the extract notices are what's brought to the star port in order to actually extract assets from from gateway um we would give support uh the ability to change supply caps on the star ports because gateway has supply caps um which are implemented both at the start port and in the gateway runtime um and then change future yield as part of that interest rate um sinking mechanism i was talking about also the ability to change oracle's the set of oracles happens through the runtime um and and then finally the ability to um we'll add and upgrade a star port so there's a function to add a star forward and then there's also a notice to support upgrading them once they're added and then finally i guess we have the uh there's another palette which is the the prices palette which supports posting prices using uh the open oracle format that um compound had previously defined which the v2 protocol was previously using but um not exactly using anymore um so yeah hopefully that gives you a better idea of um maybe the implementation of things there's obviously a lot more that can be said about that too um but it's moving moving ahead quickly um you know i think so like i guess the road map and as far as the timeline are concerned so um you know obviously the gateway is um an ambitious and challenging project um you know we knew that we knew that much coming into it um i think we we still believe it's uh like what we believe in the future of d5 for sure and like i think you know most of the innovation that um is going to happen in this space is still yet to come um and you know the goal is really to build a robust platform like um a long-term foundation um that's like economically reliable and which compound and governance of the community can build upon um as like uh you know a real engine of like growth for um for innovation to happen on and so um what i can't say about the roadmap is is like we're basically you know safety first we're not rushing qa process we've already um you know as i say over the summer when took a few steps back to re-architect um some things and you know get get more comfortable with with the security profile and um we'll continue doing that uh obviously i think the the products and the features are quite well defined um but you know we're in this process now of of um implementing things really carefully and um you know i'm not prepared to to put a date on when we'll be done with that process but um you know we will continue making steady progress on it um i guess the other thing to mention is that uh you know gateway's not the only thing that we're working on at compound so we do have a lot of other exciting projects um yeah you know i guess it's a good problem to have but um fortunately you know many i think some of those projects are growing more rapidly than we um anticipated and um you know we're still a small team so um if if gateway is interesting to you or other things that compound works on it are interesting to you um especially you know we're hiring um we're hiring engineers we're also hiring in other parts of the company um so you know please please get in touch if um you're interested in learning more about that um and yeah i guess the other thing to maybe mention and keep in mind about the roadmap is is you know hopsider's law has um certainly come into play and probably continue to come into play and i guess if you're not familiar with with that it's um you know basically the recursive law that says that um things always take longer than you think they're going to take especially when you take into account hofstetter's law um yeah i guess uh you know finally i'm sure i think a lot of information moved pretty quickly um if you have any questions about gateway or about anything else related to compound you can always um find me and others in the discord and also on the the forum on com xyz um are also um i'm on twitter if um if you have anything that can be helpful for anything feel free to to reach out um but yeah happy to answer any any questions i think we're about out of time so i'll wrap up here thanks everyone thank you so much jared and that was a really good and uh defeat overview of how everything is structured and is working on gateway um we are out of time but i lost one question just before we move on to our last talk um how does composability work in this world and um what does that look like and how should people think about that yeah great question um i think i mean a lot of it is still unknown like a lot of it is remains to be to be seen but um you know one of the ideas with with cash token as well was to be um for that to be one of the composable pieces um and you know you can think about cash token as like maybe the um the tip of of v3 um and it's like cache token itself can be like embedded inside is a part of v3 but it can be embedded for instance inside inside of like v2 um as like a c token um or you know there could be a market um so there's lots of interesting things you can do with the cash token there is the ability also um to initiate trx that we call trx requests which are sort of the requests that users can initiate they can send them either directly to gateway or they can submit them through the starport um and have them you know bit through a contract or something and have them um executed on gateway chain um so we think there's there's um a lot of interesting things to do there are you know unlike the v2 protocol and everything happening on ethereum it is a little bit trickier right like some things are asynchronous um and you know so it's not totally clear how how um how it might affect like certain design patterns uh for composability that exists um today but um you know we've tried to to create um opportunities for for composability absolutely i think uh it's a it's a very giant experiment and just to some sense because you have to sort of test it out and see how to evolve so it's very exciting um everybody who found this interesting obviously you can check out the links uh jared posted uh on how to see more about what's happening with gateway and uh thanks again for the presentation thanks carter great to be here um look forward to the rest of the conference [Music] [Applause] [Music]

Automatic transcript — names and jargon may be misspelled.