Declarative Decentralization: the final rails for Web3 by Adrian Brink
Ethereum Denver·Mon, Oct 9, 2023, 12:00 AM
Speaker
Ethereum provides decentralized, permissionless and censorship-resistant state settlement and dApps make extensive use of that. However most dApps also need counter-party discovery and solving capabilities in order to provide users with interactivity to discover others with whom to trade/settle transactions. This talk proposes an intent-solver pattern and explains how dApps from OpenSea to CowSwap and L2s such as Optimism or Starknet can use it to become truly decentralized. Adrian Brink Co-founder Anoma Adrian is Co-founder of Anoma. Prior to Anoma, Adrian co-founded, scaled and eventually sold Cryptium Labs, an infrastructure operator that provided PoS validation from bunkers in the Swiss Alps, while simultaneously building Metastate, an R&D company that upgraded layer-1 protocols valued at over $4bn. Adrian was formerly the 3rd core protocol engineer building Cosmos and completed a graduate thesis on censorship-resistant e-voting systems as a means of helping the Catalan people to gain their independence. https://twitter.com/adrian_brink
Transcript
[Music] all right perfect yeah thank you very much and let's get started because there's only 20 minutes left in this talk um so I'm Adrian I'm one of the co-founders of anoma and today I'm going to talk to you about declarative decentralization the final rails of web 3. and really the way to think of this is that um some of the declarative decentralization implemented as an anoma allows you to have one architecture of a full stack decent invest applications and I'll go into depth what this means today um so I want to quickly go a little bit into the background here um because I think most people keep forgetting this especially so if you're in the DAP World um we had generation one and generation one like systems and I really call this generation scriptable settlement this is Bitcoin and Bitcoin like systems this even includes things like zcash Monero they all had roughly the same API that was exposed to application developers and you could build some applications on it that's true you could build things like color coins name coin the global Bitcoin Stock Exchange like if you've been long around long enough you remember then like 20 14 or so there was like an unregistered security exchange run out of the US called the global Bitcoin Stock Exchange on which you could actually trade tokenized shares um it worked but it was clunky like none of these applications are composable with each other um you had to Fork Bitcoin core in C plus plus running your own network in order to make this work um and this pretty directly led to ethereum or what I would call generation two systems that have programmable settlement and all of a sudden you didn't have to worry about running your own chain to run colored coins you could you moved colored coins to your sc20s you move things like name coin to ens and you got all a whole lot of other fantastic new things that you couldn't be building before like you could get dials you could get solvent tokens um things like nfts generally speaking sort of the level of complexity in terms of what was possible with regards applications increased by like an order of magnitude roughly um and so as a result nowadays you can build dex's amms nft marketplaces and so on again this works but it's still clunky clunky kind of because you need to build a lot of backend infrastructure to make a thing like a 0x protocol work or something like openc work because ethereum just does a program of settlement and I will go into sort of more detail in a bit on there is probably 80 of the rest of the application that can can't currently be handled on ethereum um because generally speaking all existing applications require at least one centralized component because the modern design pattern of dapps is really that users don't have transactions users have signed messages um because if you want to for example do a trade I don't have a transaction that's executable on chain I have a partial State transition that goes from A to B I don't have a thing that also takes the other side and there's directly executor on chain so for example in the case of openc the way this works is that the user has assigned message they sent us to the centralized web 2 server run by the openc team in San Francisco on AWS that centralized server collects a bunch of these messages different people call the sequencing because or solving it doesn't really matter or matchmaking this the pattern also applies to things like optimism for example it's it's again the same pattern users don't have transactions they've signed messages they send them to some centralized web 2 server that does some compute over a set of messages which and then the computer settles sort of the net State changes as a transaction on ethereum um and I notice of historically everyone keeps talking on that all these systems like near Avalanche teza Solana whatever that they're like polka.com that they are really generation three are the next generation of blockchains um I I think I hold a very controversial opinion that this is not the case they're like incremental improvements over ethereum because structurally speaking the kind of applications that you can build on something like Avalanche near or Solana are exactly the same things that you can build on ethereum nowadays with a slightly different consensus with a slightly different speed but fundamentally from a development perspective the API is that you have access to the guarantees that the application gets are exactly the same um I mean we've had a number of returns very weird like advances civil resistance moving proof of work to proof of stake we had scaling Solutions like sharding roll ups or just fast single state machines so there are many improvements over time but there are sort of incremental improvements that didn't fundamentally change what was possible from an architectural perspective so I will consider all these systems sort of generation 2x kind of like programmable settlement plus plus um one of the big insights though that for most modern applications settlement is not sufficient um and so I'll start here with some historic contacts again on like why we ended up in the settlement-based world it's because everyone like this all comes back from Bitcoin it comes from the idea that Bitcoin was supposed to be used to buy milk in a store and if that's the use case then you have a transaction as a fundamental unit because you have the counterparties are physically in front of you you have the thing that you want physically in front of you but most applications with an induction space didn't play out this way they're like we try to do global settlement systems that allowed you to trade Bitcoin for ease with someone halfway across the globe and here settlement is not sufficient because settlement fundamentally means that pies already know who they are and what they want um most actual applications need counterparty Discovery because they need help to find sort of the other side of the trade um good examples here are dexes with marketplaces having buyers and sellers even quadratic public goods funding project donors and fundus falls under this Dows falls into this category any roll-up faults in this category because fundamentally in these systems users don't have finalized State transitions that can be settled and executed on chain they have partial things that need to be combined with other people's partial intents in order to follow for to form a fully fledged State transitions um I just quickly want to go into like what are the current approaches to counterparty Discovery um there are roughly three approaches to this one you do it on the blockchain um this is what unit saw what university M's do um it's kind of silly and Incredibly expensive but it is the most decentralized way to do counterparty Discovery in current systems uh sort of I would consider that um I think a lot of people believe that amms are sort of a global Optimum optimal design they're not like they're they're local Optimum created for sort of the constraints within their like within ethereum they are not perfect in any sense um because they are the most expensive way to do decentralized counterparty Discovery within the current systems um you can also do the other thing which is you run a single operator database Things become very easy if you just have one server doing all the coordination this is pretty much what every decentralized like and I'm using Echo to deliberately decentralized application does when you look at something like openc Optimum optimism stock net outram they're all single operator databases that's like one web 2 server and if that web 2 server wants to censor you they can in some cases the web 2 server can also steal all your funds because fraud proofs aren't implemented yet um but so these are sort of that's the second approach and this is what most people currently use between like openc0x flashbots roll up sequencers ZK approvers these are all trusted trusted third parties that you as a user have to consider in your trust model the third approach is you can also do an app specific Sovereign chain which is effectively you go back to step one but you do it on a custom blockchain so you pretend like the fundamental scaling limits don't exist because you can dedicate all your throughput to this one thing fundamentally it's exactly the same thing though because structurally you made no improvements you made no changes um and one of the big problems here is that above all you lose composability between applications so when you consider what happened when we moved from Bitcoin to ethereum all of a sudden applications started becoming composable at the settlement layer so my contract could call into someone else's contract and I could build applications this way and so we got about an order of magnitude more composability this way um here a signed message sent to openc to arbitrum or to optimism is a developer can't build a new application that leverages existing signed messages on existing intents so we're losing the composability because really like from a user perspective it doesn't matter which optimistic role I might roll up I'm in I just care that I'm In Sum that has roughly equivalent security guarantees like to an actual user it doesn't matter whether an optimism or arbitrum they just want a fast cheap optimistic roll up this is currently possible because none of these applications are composable at the intent level yeah and so now I'd like to take so the last couple of minutes to go over the evolution of protocols towards Generation 3 architectures that allow you to build full stack decent verse applications um and I mean so we've called the architecture Noma a unified architecture for full stack decentralized applications uh I have to say this is not to say that a Noma is the only thing that can possibly exist it's more I would expect that all future blockchains sort of being built from now on will follow a roughly similar design pattern because it is the design pattern that solves the structural issues that exist within generation 2 architectures and it's one architecture that provides intense centricity composable privacy decentralized counterparty Discovery distributed solving as well as multi-chain atomic settlement and the the talk is actually titled um The Clarity of decentralization the final rails of web 3 and here I'll sort of go into what this actually means and why declarative paradigms are the things that are going to exist in the future um and I'll start with a quick overview of how this currently Works currently our systems are fairly imperative when you think of what an ethereum transaction is it's an execution trace it is a user science over a function call and an entry point there and then sort of arbitrary compute happens a user doesn't sign of a specific State change so they sign over the how to do how to achieve their state change not exactly what state change they want to achieve and intents are completely different here intents are fundamentally that users sign over what they want to achieve but don't specify how to do it and I would argue that this is going to be absolutely necessary for Mass adoption of decentralized applications because it is fundamentally safer and more scalable like my parents can understand the model that like if they sign over a message says I'm trading one Bitcoin against 100 eth that's that's the state change they're authorizing my parents will never understand how to audit every single up code that could be possibly involved in their call stack when they sign an ethereum transaction um and I mean there's some other advantages here once you have once you switch your mind to this idea of declarative decentralization you get a lot of advantages like um you get decentralized counterparty Discovery almost for free because it's very easy to um I have an intent that says I want to trade like one Bitcoin and one Bitcoin against 100 eth um and to me at that point it doesn't matter whether there's one counterparty whether it's a pool whether there's a thousand counterparties across the globe because I just specify with straight change I cared about not how to get it um again this is kind of where we hit this local Optimum with amms in ethereum that like instead of figuring out how to do decent first counterparty discovery and declarative decentralization we figured we can just make one large counterparty as in the pool is the counterparty and everyone just interacts with the pool right um the other cool thing is intents are composable so that if I trade a for B and you trade B for c um someone else two days Isaiah can trade C for a and we can take these three intents that are not individually settleable without having to go via a centralized counterparty and just settle them directly because as a group they all get fulfilled [Music] um yes so this is really how this architecture as a result looks um with a declarative Black Box architecture that users really just create intents that specify what specific State changes they care about this could be I want to be in a roll-up I want to be in a multi-sick this pretty much generalizes to all existing systems because fundamentally the base unit that people actually have is intense not transactions they submit them to some settlement system or to some execution system this could be a number this could be others and then the system sort of figures out what is the best best path to execute and fulfill and settle the state change or this intent and in the end a user just has to check the updated state so what's actually in the Black Box because sort of this was the conceptual introduction to why declarative decentralization is going to matter um but what you actually put into the black box to enable this um and here really on the far left we have counterparty Discovery so here users can issue transparent intent intents that are either transparent shielded if you use their knowledge proofs or private if you use fully homomorphic encryption they submit those intents to the intent gossip layer which is a globally non-consistent sort of P2P Network as in different intent nodes can have different views of the network because none of these intents are yet contents is critical um these get gossiped around solve us look at this and go okay which ones of these are compatible with each other which ones are combinable for example two nft trades that match each other are two compatible intents and the solver would find these and say okay let me put them into a transaction actually settle them on chain this could also be that there's a roll-up sequencer that says well these 15 things now pay me enough fees to justify running the roll-up computer running the ZK approver for my ZK roll up and then takes us the sequencer or the solver takes those 15 intents computes the ZK approver the ZK proof submits the updated State Route 2 ethereum um oh to ethereum or two are normal actually two like some settlement system um then you have the consensus part and here really uh once the solver has found a solution they submit this as a encrypted transaction that is not front runnable because once you start redesigning protocols from first principles front running is actually not a difficult problem to solve you can just use something like Fabio to provide programmable threshold decryption and encryption that that all transactions are initially encrypted against the shared public key of the network then encrypted byte strings are stored into blocks and on the next block once the ordering has been fully finalized those transactions are decrypted and then executed at that point no one has an unfair information advantage that they can use to front run background or sandwich you um yeah and in the end if you want very good privacy guarantees and Incredibly cost efficient settlement you want something like tiger which is our unified execution environment that handles transparent Shield as well as private state by the way all of this is like open source code and you can just look this up later on on github.com um one of the cool things here is that a normal is an architecture it's not a specific um it's not a specific deployment model you can take enormous architecture and deploy this as an L1 as a globally just like globally decentralized L1 run by a global Community you can decide to take enormous architecture and deploy this is a proof Authority chain to run Commerce in New York you can decide to deploy this as an L2 to ethereum or to some other existing settlement layer um but the nice thing is you still get total composability over all the intents because you have one Global intent pool that connects all these different deployments of one architecture um for the benefit of time I'm going to quickly skip over these um you get a bunch of Novel Primitives you get like tiger for privacy you get Fairview for programmable special decryption which is actually enables you to do programmable batching on chain so think something like cow swap but fully decentralized where users encrypt their individual intents against the shared public key of the system but those intents are stored on chain and only after the application defined batch has been is over do the validators jointly decrypt all the intents within one batch and then solve Us in the same sense that solvers exist in cow stop nowadays can take those intense compute an Optimal Solutions submit this and then on the application side the application can enforce a sort of optimality criteria as in everyone gets the same clearing price in a single batch uh yeah this is actually the example for this but um the other thing when ethereum came out in 2015 we really couldn't spell out all the applications that it would enable because everyone was like well this seems just like Bitcoin but slightly more programmable most people didn't yet realize how much more composable a serum was going to be and it's kind of the same thing here with anoma as an architecture um I know I was probably going to make things about an order of magnitude more composable than existing things on ethereum uh not on ethereum actually like existing architecture so this isn't a on existing architecture because just like they are going to be new architectural advances um yeah you can build contemporary applications here you can also build a bunch of Novel applications and I'm not going to go through these in depth I think some of the most intuitive one is you can build private openc where individual users are completely private um even to the solvers that solve the traits so you can privately trade um your nft for some eth um this is currently impossible to build to be built on existing architectures simply because of how the Privacy guarantees are structured in existing architectures [Music] um maybe just like one last comment here is fundamentally the direction we need to be moving into the space is toward homogeneous architectures but heterogeneous security models because not everyone cares about the same security model like my parents don't want ethereum security my parents want like local Village People Authority chains run by the local Authority and we should just always consider how do we make unified architectures available to people no matter what security guarantees they actually care about this leads also to factor scaling to tighten as a new consensus architecture and yes thank you very much this is anoma one architecture for full stack decentralization I don't have time for questions so find me next to the stage foreign [Music]
Automatic transcript — names and jargon may be misspelled.