Aave: evolving slow systems in the age of speed
DeFi Security Summit 2024 · 9 Nov 2024 · 26:04
Ernesto Boado, co-founder of BGD Labs, gives an inside view of how the core maintainers of the Aave protocol decide what to build and how to keep it secure. Using two features introduced this year as examples, he explains how changes are scoped narrowly, reviewed by established and newly introduced security partners, and shipped through onchain governance. He also describes how Aave's decentralized structure of independent contributors aims to match the resilience of Ethereum.
Speakers
Topics
From DeFi Security Summit 2024, hosted by DeFi Security Summit.
Transcript
okay hello everybody so yeah and I'm Ernesto B I'm the co-founder of BD labs and this is the first it happened to be the first session like of ab morning like because after me there will be like a mil also like from from from the ab side like so um today I wanted to to talk about uh well first maybe I can talk of what is from where I'm coming from BD like so yeah as I say I'm the co-founder of BD labs and we are like a team contributing to the a protocol like for
core development security and a bit of basically everything on on what relates like with the with the existing a protocol B3 B2 like everything around and yeah com back to the title like of the talk like the the objective today is just to tell a bit shortly um how it works how inside like we could we could call it inside like and certain details related of how we how we think about security and and and yeah some some kind of inside view of the of this system and its maintainance so uh yeah about the team I already mentioned like so we are well I
will elaborate later like but a is pretty pretty decentralized in terms of organization ER yeah following a model that hopefully someday will be similar to ethereum and so our team it's called B Labs it's not called but because we are completely independent like from the founding team even if I was part of that founding team and yeah we we work that way so erh yeah as overview like first I I will I will show what is up at the moment like then and the core of my of my thought will be of putting two examples like of how do we move features like
ofab how do we think about those features how we evaluate them security wise and and some other details and then at the end we'll yeah we'll talk about this security procedures that we applied on those features and some other things and how maybe they are a bit different than than other systems or or maybe not so different so H about the the title of the of the talk um yeah I think that right now like if I reached the point on where everything moves relatively fast in terms of like developments like if we compare like with Early Times H so yeah I think then it helps that the tooling is completely
different like in than it was in 2018 or 2020 on where yeah technical limitations were actually a thing when you wanted to do something and and especially when you wanted to do something safely so that definitely has helped a lot like on yeah ab and this ecosystem being pretty big nowadays um we have new types of in what relats more with thei have new types of assets that are appearing all the time like yeah like it can be liquidy staking tokens or reaking tokens and and some others this yeah now at least I have the feeling that this lsts are have existed
forever like but I think in 2020 they were still an asset as a asset class that was was growing and liquid restake to is like one year old so but in terms of of size now nowadays they are pretty huge um then it also helps like for this speed that nowadays like there is factually way more entry points into the fight than there was back in the days back in the days mainly was ethereum and and some alternative l1s now rollups I think it's pretty clear that they they CAU some yeah some some boost like so so you get you get
yeah a lot of like base like arbitrum like you can name it like but there is like real use cases there and and users entering even directly to those to those L2 and not only to ethereum and then maybe going to to some other place um and well I mean the conclusion is that for from all all the preview like new protocols appear like every day maybe looked like slow down a bit last year like but like in practice there is actually a lot of of new ideas getting getting created in production like and and well yeah lot of
innovation so uh yeah the slow part which is kind of a yoke is AB because I think it's AB is quite quite perceived nowadays like as the stable place like the like this kind of beot like but maybe it's not so low like because AB is in 11 networks at the moment the the3 protocol with 13 instances there is also still three instances of no yeah this is wrong there is three instances of B2 of B of B2 in in three networks assets there are like yeah I put more than 100 but I I don't I
don't even keep the count at the moment AB also has a stable coin it has like cross chain messaging system it has like uh governance system based on storage proofs like yeah basically you name it and probably AB has like some some infrastructure related with with something so uh yeah it's a slow system but it's also is pretty big like so yeah this number is something that I took yesterday today I think is more or less similar but AB is is pretty big like with some some billions in in Market size and er well with with this and with all the previous infrastructure of
course er er stability is very very important and something that especially on on my line of contribution and and the team I'm part of like this is kind of the key like of yeah we are the technical team that needs to make up appear as like seamless and things work like completely well behind the scenes ER so something that maybe like people doesn't I mean for sure is not so so public is like how is the procedure of like adding features to have it like how we decide like yeah to add something to not add it quite frequently to how we decide to remove them like so in in in that direction like one of the things is
that we We Believe pretty hardly like that the all the systems should evolve because it's I mean quite natural like yeah so the idea the idea of pure immutability is I mean is nice but even like on the base layer like let's say ethereum like well things change over time that is one of the strengths we think of of of the ethereum community like so on AB we try to kind of reproduce the same but like on the smart contrast lay so um at the same time like obviously whenever like you you add new features like or or any type of change well the attack Sur face on a protocol on the five protocol like a
like it it increases like so the more you add the more potential issues that that you can have in all senses but the ones that really matter are security wise so something like very very important is like to when you are like the development team of of a system like this is to find a good point of equilibrium like of this like because well you cannot remain too static meaning yeah you you you put a system out there like and and you wait two years like until you probably die no you need to move a bit and continuously but you need to do it with certain order or as much order as as possible so uh yeah I want to just put
the examples of of two two features that we introduced like actually this year both of them so because a right now like it's not the protocol is ab3 but technically like the protocol that is that everybody uses that probably some of you at least use in this room uh on chain is right now b3.2 so there was yeah some minor version then 3.1 3.2 and and some extra coming soon H so yeah how we do and how we think about those features so the first one is um liquid modes I will just explain a
bit maybe some of you already know what is like the ABI modes but ab3 introduced like a mechanism which was called e modes which comes from efficiency mode and what that mean is that like in you have listed assets on a but then you could have like each asset could belong to any mode was called which had like higher risk parameters whenever like those the assets on D mode were correlated like so the main use case of this for example was having s e the LST of e and e on on a singly mode so in that case you could have like quite quite high risk parameters because they are correlated
like so the risk of liquidation is is pretty low and that enables strategies like high leverage or things like that so what we introduce on on ab32 was what we call Liquid modes and and this is kind of um technicality but it made quite some difference before like each asset listed on on an pool could only be on an emote like so the moment that you add let's say e in in emote one it could not be in any other emot and this was limiting factor even if the normal emotes like help AB to to grow a lot like this this was kind of
limiting like especially during this year like when what I mentioned before when new assets appear like the the system was not powerful enough to cover all the use cases let's say with lrts so what we did like with this liquid otes is to allow that each asset could be multiple otes which seems like something pretty trivial like but it actually enable a lot of use cases so for example right now there is like an instance in main which is the the li3 pool which is heavily using like this concept of liquid modes with yeah subgroups of assets and each one is for a particular use case lrts against lsts lsts against
normal asset stable Quest un name so how do we thought uh how how did we think sorry about the the introduction of these liquid OTE so usually this is kind of there are some other steps probably like but high level we think this way so first we think that if the feature makes sense like because it's not only about like introducing technical technical aspects without thinking high level how much CH it makes then we always think on on how is the complexity other to have because well it's we are not creating a system from scratch we are changing the code or something that is like billions size like so the complexity that gets added or not is a
deciding factor basically even to to move a feature or not and then also we think quite a lot on on how difficult and and how how long will be like the the security procedures associated with the feature which frequently they are different between between each other so in the case of of liquidy modes well if the feature makes sense is what I explained before like it really made a lot of sense because abb3 was being limited like with with use case like liid staking tokens against others so yeah we needed to do something and the Alternatives were yeah not so good in in terms of
user experience then how much complexity it add this feature to have not really so much like it really looks like a complete change of Paradigm internally but the reality is that when you go to the details uh the changes were not so so aggressive like so you could isolate the logic like the storage affected like was I mean was not so not so bad like and and it was generally a pretty small footprint for the the power of of of the feature itself and then yeah the third question how difficult we estimated the security
procedures was that well it was pretty review friendly that is one of the advantages of a because even released like quite some years ago a is quite modular code base like so sometimes this is not so good but sometimes like for the reviewers this is extremely good if you follow like if you do improvements following the same patterns like so this was the case here like the change was relatively isolated and and easily understandable which also work like with quite well like with an idea that that that that we practice that is like we we try to introduce like new security partners and firms all the time so yeah of course we
work with our typical security Partners like the ones that we we trust from a long time ago but also from time to time we trying to introduce new people because well I mean you you bring fresh ideas and so so on so it makes sense so yeah we evaluated this um um and and that's it like then during this implementation however like we always need to think okay how how powerful we make this feature how far we go like so um yeah usually it's very important to understand that it's not about being as generalistic as possible is about enabling what you want to enable and even if you know that you can improve certain things just stopping
there um what I mentioned before of like following similar architectural patterns in a system like G is very important because sometimes just by following like the the the organization you will not let say shoot yourself like with unexpected bug and also thinking very careful about Integrations like because AB is well I mean the users integrating is not end users is other protocols like so we need to be pretty careful with with that uh yeah the the other is like another feature which is quite different in nature is virtual accounting this was actually before liquid modes and what we here is that like AB was operating all the time from
inception dynamically in terms of checking I say how much available liquidity there is using balance off of the tokens and how it work is like at some point I will pass to the to the typical questions but at some point we noticed like that there were more and more exploits related with inflation attacks and any type of manipulation related with with balances so we did like some introspection in the team like in in the protocol we also involve like extra security researchers like and and then we decided like to to implement this um this virtual accounting so
yeah when we analyze like about the complexity add to have it like actually was not so much um mainly because it's kind of incremental defense like or we call defense in depth too meaning that there is not really much you can destroy like by by by introducing this the only thing that that could cause is like maybe over protection of the system but is I mean of course if you do it wrongly not but it's not so easy like to to actually introduce a very big bu like because of the nature of the logic itself and then also yeah it was review friendly like the the code footprint was relatively
small I would say which but that it had like high level implications like because certain invariance of the system that before they were understood by by using balanceof like on certain smart contracts like is not anymore now they involve like a storage variable like which will be the the virtual balance and for that reason this particular feature we thought that it was good to to have a security contest too like because it's well quite non a specific like so in this specific case like the like having more eyes and fresh eyes like it could give value while in certain other a features like having
certain expertise on a or or a lot of expertise on AB really gives like way more value than than coming from scratch so yeah the same as as with the liquid modes still like we we did this last question of how how far we need to to go on this like so yeah like the main priority here was to make it as long invasive as possible the feature um then evaluating all the effects and like potential consquence that that could arise like because of what I mentioned before of not being so Dynamic anymore not using balance off but having internal accounting and especially like
something that is recuring um let's say challenge like on AB is that every time that we do an upgrade of the code you have production data like of thousands and thousands of users like of capital so H you need to be very very careful like whenever you re ini ize that data or when whenever you do any type of so-called migrations of data so in this specific case obviously this virtual accounting didn't exist before but the moment that upgrade happen you need like to just initialize like a the whole thing so yeah yes to to end like U like a small small overview of how are the
how we I think that maybe are the the a security procedures are slight different and mainly the ecosystem around more than the procedures so yeah I I will not repeat but obviously we do the say typical stuff like testing review formal verification fasing like you call it probably it was done at some point in of of the chain in AB but I would like to highlight this which I think is a practical example of of of something that is not not not so so common like so in a I say like that we have organizational defense like what what that means is that similar as with ethereum I think that like like the
resilience of ethereum sometimes is because there are so many teams contributing to ethereum because there is I mean there is not really like a Bo with full full Authority like in in the road map of ethereum or like almost any aspect so yeah as I say before like in a we we try to achieve the same like so at the moment a is I mean is really fully decentralized controlled by like onchain governance contract best example is that like my team like is just engage with the Dow like which release certain budget and and and authorize via Smart Contra Services agreement let's say um so this natural consequences that there
are multiple also technical independent entities involved with the with the development of the the security of the protocol so yeah I mean it's of course us there is I put also C which contributes independently on the on the security side even of obviously we collaborate closely there is also like aaps I mean and there are multiple others actually um and then even yeah we have also like independent emergency entities which is can be in the shape of multi6 or so on for yeah emergency functions of a bug is detected and if the systemless needs to be ped so yeah this this gives quite a lot of
value another another point is like that the all the changes of fa need to happen via the governance or the I mean the 99.9% of them and they are not even created by the technical team of fa like what we do is review those changes but at the moment there is like I think regular four or five entities out there some of them are not even so so technical which are creating governance proposals for whatever like listing new assets on a changing parameters I don't know proposing new deployments on new networks like yeah countless thing like so there is a some
repository where people just do PRS we review them then there is even another layer of review by seror and and then they get voted on chin and if everything goes well it gets executed on theist uh yeah right now we are even like trying to decentralize like the organization on on GitHub which is a bit challenging but so like the other protocol lives in this in this saow and and progressively the idea is that multiple contributors like will be having the repositor that they maintain which is associated with the Dow so is kind of everything is property of the Dow and then you have like the yeah the maintainers or steers of of
that and and yeah well I mean we maybe treat a bit different like of like the relation with the Security Experts like so this is more about like U our team but for example we we like quite a lot like to have continuous communication with when we do security reviews is not are not so much into the business of like giving some code review and coming back back at the end we prefer just to talk quite a lot with the auditor because it's it's pretty good both for us and for the auditor to get better understanding ER it's true that also like in some cases certain isolation is desired but we are quite I mean we think
quite a lot about this these topics like so depending on the feature even maybe we want to have more communication and in some other features not ER and yeah well we we try to put a lot of focus in documentation which requires like some improvement to still like but yeah we think that one of the problems of on the communication between developers and and security firms like is that well it's not well explained what the developer is trying to do like so that just creates like a snowball effect on on everything else and yeah that kind offish an overview if any any
question thank you so much Ernesto um maybe while ailio sets up a quick question for me um so I think a is seeing one of the biggest uh Evolutions which is the first non evm deployment of uh of it happening how does how do you evaluate that type of of decision with regards to the framework you presented I mean like is a slightly more challenge like because obviously we have Frameworks to evaluate like the evbm deployments by themselves um but those Frameworks are unavoidable I link like to ebm characteristics like so in the case of the one know evbm like this
changes changes a bit but I think that we can adapt because at the end of the day like it's more about having the procedures and the steps well defined and then if you need to adopt some of the steps I mean it's it's just fine but hopefully it will be yeah in the next months I think