[BUIDL Asia 2022] Anoma - an intent-centric architecture for fully decentralized dApps

BUIDL Asia 2022 · August 2022 · 29:52

Adrian Brink, co-founder of Anoma, introduces an intent-centric architecture for fully decentralized applications. The talk traces blockchains from scriptable to programmable settlement, explains why counterparty discovery and solving still depend on centralized servers, and shows how intents, privacy-preserving threshold decryption and atomic multi-chain settlement enable private auctions, batch trading and multi-party bartering.

Speakers

Topics

From BUIDL Asia 2022, hosted by Kryptoplanet.

Transcript

thank you ellie so i realized i didn't properly introduce myself earlier so once again my name is sebastian um i'm the host of a couple of podcasts that some of you may be familiar with epicenter which has been around for a long time and has uh greatly contributed to my knowledge and understanding about crypto and another podcast called the interrupt which i launched recently which is more focused on the cosmos ecosystem which brings us to our next guest adrian brink who is the co-founder of enoma they're building a general purpose chain to allow folks to trade on right

yeah uh on intense so uh please uh give a round of applause to adrian for uh first talk here on cool all right i was told to stand over here so that's still correct okay cool um hello welcome thank you very much for coming i'm adrian i'm one of the co-founders of anoma and today i just want to give you a brief introduction into what a norma is because

it's it's a at a very high level it's a unified architecture for full stack decentralized applications and i'll go more into depth what that means so i want to start with a brief historic recap of sort of where we started from where we are today and i think where we are going to go um and i think a lot of other people look at the evolution of blockchains very differently than i think we do adonoma which is they sort of think of consensus improvements for evolutions to blockchains but i want to present a different view or different segmentations segmentation to look at the evolution of blockchains so the first evolution really of the first generation was

really bitcoin and scriptable settlement and here the main part is scriptable settlement which was non-turn complete some programmability is accessible you can have some smart contract some multi-six you can start hacking around with applications that you may think would look cool like colored coins on namecoin but the first generation was very clunky um like building colored coins on bitcoin is incredibly difficult um and as a result it sort of never took off really um and we ended up getting ethereum same for namecoin right like namecon is the original ens really but it required a fork of the bitcoin client

because fundamentally scriptable settlement just has downsides it is not as flexible it is not as easy to use and so as a result we ended up with ethereum and the funny thing is actually um vitalik talks about this in the white paper how scriptable settlement wasn't enough uh and so ethereum the second generation gave us programmable settlement and all of a sudden we didn't have to be okay with just having colored coins we could have erc20s and they were very easy to develop they were very easy to integrate with and all of these nice things we also instead of having namecon we got ens but importantly we also got a host of other applications that we didn't consider when ethereum was created right like we

looked at what is currently being built on bitcoin and can we make this better and so we end up programmable settlement but we didn't think of sort of all the future kind of applications that would fall out of having a very general programmable settlement architecture so we got dials we got new kinds of assets like nfts and sold one tokens we also got a bunch of like other modern applications um that we didn't think about when ethereum was created but with sort of like as an and as a result all of a sudden became doable um and so i think one of the good examples here is like modern dexes amms nft marketplaces but i think in the same way that

colored coins on bitcoin had trade-offs nfd marketplaces indexes like the modern applications on ethereum have trade-offs as well which is predominantly that they generally require at least one if not more centralized web two components in order to make them work right when you think on and most people don't think about this very deeply but when you think about what openc does openc just accepts a bunch of signed messages does some compute and then ends up settling this on ethereum but like you fundamentally as a user you're sending these signed messages to a centralized web 2 server running on a single ip address run by the openc team and so this is like the centralized component kausap has the same thing there's a centralized solver

most of the role actually all of the rollups whether optimistic or zero knowledge have this as well you send some sort of signed transaction to either the optimist integral or the optimism solver optimism sequencer or you send it to the stark stark net solver approver sorry so and of course we had a bunch of other things that people traditionally refer to as evolutions of blockchains but i would say they're like second generation plus plus they're still programmable settlement um we made advances in civil resistance we got some advances in scaling we made advances in privacy we made leaps and bounds in terms of underlying consensus mechanisms like tenement avalanche and eventually eth2 single slot finality but it's still

fundamentally programmable settlement as in the underlying model that is exposed to developers doesn't really differ whether this is on ethereum or near it's always a imperatively executed vm that runs in a different color and maybe the color like near is now green and ethereum is yellow and the color determines like speed and finality but in the end you're writing the same kind of smart contract um you're building the same kind of application uh very similar to like how you had a long tail of bitcoin forks how we had a long sort of a vast swath of scriptable settlement chains um right yes

so i want to start with that settlement is not sufficient and this is what programmable settlement does very well programmable settlement does settlement but just settlement settlement is only applicable once parties know who they are with whom they want to coordinate and exactly what they want to coordinate on when you actually look at pretty much 99 of all interesting applications they need counterparty discovery um like openc you don't directly interact with a protocol like you don't directly interact with ethereum because you don't have a finalized state transition you have the idea that you want to hold you currently hold let's say one cryptokitty and you are willing to hold zero cryptokitty if you hold some ease

right but you need to find a counterparty with whom to settle this on chain or you need to find multiple counterparties and so we need infrastructure that can help counterparties discover each other and also agree on what to settle specifically um we see this in a ton of places we see this in the marketplaces where you need buyers and sellers we see this in the quadratic public goods fund and we have project donors and funders we see this in the dows we have voters that all need to coordinate to then have a sort of resulting state position state transitions being settled we even see this in roll-ups because what is a roll-up like someone signs a message they send it to a server that server does some compute and then the resulting computational output gets settled on chain this is the

same between optimistic rollups or zero knowledge follow-ups um it's always this model that we fundamentally need somewhere to find counterparties and agree with these counterparties on exactly what to settle um there are like a very few exceptions like if you want to send money to yourself if you like have some ease and want to have some private eats then you maybe don't need a counter party because you can just directly go into a shield pool and go out to yourself but even if you are thinking of i know like buying a bottle of water there's a counterparty discovery step where it's like you have to figure out who's selling a bottle of water and how do you agree on the pricing so pretty much all of human interaction requires

counterparty discovery because very few things happen in isolation um so what have the contemporary approaches to counterparty discovery been well sort of the current thing we're doing is to do it on a blockchain um this is what an amm does this is uh this is also an on-chain autobook does i have to say though this is very expensive because you have to put everything in consensus and you have to pay gas for this and you have to step you have to pay for the privilege of establishing a total global order over all those messages um and it's actually really silly because there's almost no point in sorting all these messages and establishing a total order for them

um but i have to say amms are sort of the best answer to this question on how do you currently can how do you currently do decentralized counterparty discovery and yes you chug it all in a smart contract on ethereum and that smart contract does all the counterparty discovery and solving for you the other approach is you run a single operator database this is outside of unisop and the amms by far the most popular way because it is very easy because you just centralize the entire thing you say oh i'm open c i'm going to run a single server that accepts all messages then does some compute over let's say 100 messages and only settles the sort of

matching messages on ethereum this is what the 0x3 layers did this is what flashbots does too like the pattern is always people have intense they send it to some counterparty that then they do some compute and then you settle the resulting state transitions on chain um roll up sequences already spoke about this but the important point to remember here is these are trusted parties um in the best case they can't steal your money in but most in almost all cases they can end up censoring you because right they can just block the ip address you're coming from and not relay your message not taking the message into consideration you also get very few fairness guarantees on let's say five of us are sending a message to a

to open c there's almost no guarantee that openc isn't front running all trades because we don't get any sort of ordering established that is relative to each other this is not about the total order this is about a relative ordering between our messages and then the third approach right now is sort of you build an app-specific sovereign chain dydx is doing this at the moment a bunch of other things have done this as well the problem is they're also trade-offs you lose composability all of a sudden the signed messages aren't composable with each other which is one of the very nice features of actually programmable settlement on ethereum is that smart contract calls are composable with each other but so if you put this on an app-specific sovereign chain you lose this composability aspect where

i can't reason through the intent that i've sent to openc and the intent that i sent to xerox and i can't compose and settle them in the same state transition also this requires a ton of depth work because effectively you're building your own blockchain so i want to use what i would consider the third generation of protocols um and a normal as an architecture this is important to understand a normal is an architecture with many different deployment models uh you can deploy anoma to ethereum to as an l2 you can deploy a normal as an l1 and a half to decentralize a specific dapp on ethereum or a dab on some other system or you can deploy the enormous architecture as an l1 as a sovereign chain so yeah to just repeat this

enormous unified architecture for full stack decentralized applications and now i'll sort of take the remaining time to go into what this actually means so in a nutshell it's a proto it's an intent centric privacy preserving protocol for decentralized counterparty discovery distributed solving and atomic multi-chain settlement i'm not going to go through all these words um in the next couple of minutes i'll very much focus on a focus on intent centric and the privacy preserving part as well as a counterparty but uh atomic multi-chain settlement is a whole other beast um if you're into consensus mechanisms i recommend to check out heterogeneous pack source or

our implementation thereof which is called typhon it allows you to do cool things like have the ability to have two separate blockchains that have an overlap and it's in their validator set um to form a virtual shard at runtime so that you can have atomic transactions between those two blockchains even though for most of the time they're running as separate sovereign chains so the key design principles driving uh the design of the unknown architecture are intent centricity and homogeneous architecture heterogeneous security so intent centricity is really that users express what they want not how to get it this is very different than

every existing blockchain is constructed because every every existing system has the primitive of a transaction this is sort of the fundamental base unit there's a transaction that executes some state change on a system this is not what users have users have partial transactions they have intents they have like i want to hold one less bitcoin if i hold 100 more eth right like a simple trade they can't settle themselves they need to find someone else that matches that inverse and importantly also um currently users express like what a transaction does on for example the evm it authorizes an execution trace right

like when a user submits a transaction on ethereum they're not saying that they are fine with some future state like they are fine with holding somewhat tokens if they hold some less tokens of some other thing they are saying that they are okay with this entire execution trace of like smart contract a calling smart contract b calling smart contract c and this is terrifying from a user perspective because to be secure in these systems you need to reason through the entire execution trace because any intermediate proxy contract can change arbitrary amounts of state and you never said what the what state you are fine with you only said which contracts you are fine with doing some compute on your behalf this means that honestly if you want to use these systems securely

you need to audit every single contract call that is in your transaction in order to be actually certain what it does whereas with intents people just define what resulting state they're fine with and then it's the job of the system to figure out how to get them that state and the end step is not the that you've authorized some execution trace the end step is that after the system has figured out what state changes or what execution trades to take every user's validity predicate just verifies that like their state changes weren't violated that they've that the state changes they authorized were actually implemented so intents are binding programmatic commitments to state preferences this is

really the way to think about this um the really nice thing about intense is that intents don't have to be globally ordered so they don't have to live in consensus because they're not fully fledged state transitions that have to be reflected globally there can be an p2p intent gossip network that can can have a hundred billion intents and not everyone in the world needs to have the same view of this network as in i can have a different view of a subset of the network and someone else can have a completely different view there may be some overlap but it doesn't that doesn't actually have to be any overlap as in every person that views this network can filter for their own kind of intents that they care about which makes it very scalable because you

can have an intent gossip network that spans multiple blockchains at the same time um so now we have all these intents right we have 100 million intents now there's a component called solvers solvers effectively look at the super intense and they see which ones are compatible um and if the solver finds let's say two intents that are compatible they can bunch them into the transaction and submit the submit them to the settlement layer um but it could also be that they take 5000 trans intents and settle them into a transaction and create a transaction settle this on chain this is really important because uh it allows us to do very cool things like ring trading

where it's like use some user wants a for b someone else wants b for c and the third person wants c for uh b for c right like we don't have to trade the entire circle we can just net out the changes on the intent level combine them and settle only the resulting state changes because users didn't authorize the specific execution trace they authorized what state changes they were fine with and intents are composable so that the intents that go to the 0x solvers and the intents that go to the stock net solvers and the intents that go to the openc solvers i can build applications that reason through all of them like i can build a new application on top of all these different kinds of intents uh and maybe he actually to i should

have said this in the beginning intents are just code they are an intent is just a predicate over some state change it is some code that gets run to say whether you're fine with a future state change um so they're fully programmatic they can be arbitrary whatever you can write um you can express this as an intent this allows you to do trades like i am willing to um sell bitcoin for ease if the weather is nice nice and soul and if the weather is bad and seoul i'm willing to get ether classic things like this or you're willing to get different rates they are fully programmatic as long as you can express it within the gas bounds you can create this as an intent and yeah then in the final step transactions

are then settled on settlement there this kind of intent centric design is necessary to enable decentralized counterparty discovery and this is curiously where everyone is currently ending up anyway where openc is sort of a specific implementation of this pattern of this design pattern so xerox so starting it so is optimism what the normal architecture really does it it generalizes this pattern people have intents we want to then take multiple intents run some com decentralized compute over those intense and then settle them on chain um yeah and this leads to the security paradigm for decentralized applications where instead of authorizing execution traces you authorize specific state

changes which honestly is probably going to be a must for like mass adoption simply because like my parents can very easily reason through i now like i'm authorizing to hold some less bitcoin if i hold some or ease they will never be able to reason through i'm authorizing these five contract calls to get me the thing that i need um right and i know this results also that it's a blackbox architecture users author and submit intents then magic happens where the system figure figures out how to satisfy as many intents as possible and then users just need to check the updated state users users never have to worry about what the magic what the black box actually does

because they've authorized what they're okay with right i won't go through all of this but very briefly this is sort of the high level overview of the architecture of a normal on the far left you have counterparty discovery and counterparty discovery is effectively users have intense those could be transparent shielded or private um then the client generates some intent this may involve the generation of a bunch of zero knowledge proofs um or even the use of fully homomorphic encryption but that's still far like further out um then they submit these intents to the intent gossip network solvers can look at all intents um albeit that is going

to be very hard uh generalized solving is most likely np hard and hence we aren't going to see generalized solvers for a long time to come practically speaking what's most likely going to happen is that solvers pick a subset of intents that they care about as they select maybe they're only interested in fundable token trades and then try to compute solutions for that um so then solvers now computer solution maybe they take five and tens that are set up on chain uh they're also incentives for intent gossip and so on and solving um at that point uh these could be front one right because it's way cheaper for me to say oh i look at someone else's solved intense cycle and i resubmitted myself so all in the consensus part solvers actually all

transactions are encrypted against uh a dkg against what we're calling fervio it's a single shared public key controlled by the validator set uh all transactions are encrypted against this then submitted to the mempool the mempool just establishes an ordering over arbitrary byte strings at that point then in block n those arbitrary byte strings are fixed into a total order then you run consensus now you have a finalized block with encrypted byte strings in the next step then in the next block so at n plus one the values had jointly decrypts all those encrypted transactions at this point everyone can see them clear text but they can't front run background or

sandwich them anymore because the ordering has already been established and then they just execute them the nice thing is you also don't have problems with commit reveal schemes we need economic incentives so people to reveal that transaction data like the unencrypted text because the validator said can just decrypt them themselves and then in the last part you get into execution verification where um it comes to the unified execution environment that can handle transparent children and private state and validity predicates which is effectively then all state changes are applied and all validity predicates are involved invoked and all verifiers are invoked to verify the zero-knowledge proofs and then in the end users just check whether their thing got settled or not

okay i want to take the last bit to talk about homogeneous architecture and heterogeneous security generally speaking protocols can be benevolent monopolies as in everyone wins from agreeing on the same protocol everyone wins from agreeing to use tcpip um there are some improvements we could be making to gpip but the counter factual losses are really marginal like there may be a slightly better version of ip that we could be building but there's a massive benefit in standardization however also like to make this more tangible this is what allows mobile phones to work like i i bought my phone in europe and my phone works on the cellular backbone

in north america and in asia it's magic right like you take your phone and just magically works it's because we agreed on the protocol for the cellular backbone but importantly security domains shouldn't be monopolies because they can extract rent they can steal funds they can freeze funds and different people fundamentally will have different preferences to what security domain they're comfortable with maybe some people really want to hold all their assets on global ethereum and that is totally fine right this that should be their choice uh maybe they consider this to be the most secure um but maybe someone else that lives in a village of 200 people that they've lived with for 200 years wants to hold all

their assets in a security domain that's controlled by the people in his community and that's also fine we should just make sure that all these different security domains are interoperable so if you have the same architecture but heterogeneous security you can enable this where your phone can roam between different security domains without losing uh sort of the benefit of having a homogeneous protocol right and this leads to the separate uh this leads to separate protocol and architecture from the security model this comes then to the deployment patterns of anoma so a normal as an architecture can can be deployed as an l1 so it's a globally sovereign chain it can be deployed as a community-operated chain maybe the people in seoul want to run all their local commerce and that's fine right that's a different security

zone for deployment um you can deploy this as an l one and a half where use are normal to decentralize uh a specific l2 for example like starknet or optimism or arbitrarium where you just focus on decentralizing the intent gossip and solving part or you deploy this as a fully fully as an l2 where every even the underlying settlement happens on ethereum and actually in that case you end up deploying the unified execution environment as a two theory right so yeah the first case was you can use intent gossip network only you sequence and settle elsewhere or the second one is you decentralize also the solvers not just the gossip but you also decent process solvers

this you can do to like decentralize things like cal stop or xerox yep or you can deploy a normal as a fractal instance right so what components do dabs on omaha have um they have intent formats as in everyone has to agree on the right and on the um on a standard for the intents they have solver algorithms that can look at multiple intents and combine them and then lifts the validity predicates which provide settlement and variants that users care about this is for example uh settlement variants that the protocol as well as users care about for example this is the invariant that um if you have bitcoin floating around in the system anoma can't create new bitcoin so the settlement and variant of a bitcoin

transaction on our noma needs to include the fact that no bitcoin can be created or destroyed this kind of very integrated architecture means that you get end-to-end security license and privacy guarantees that you can reason through and that your applications are portable across different security domains resulting in not having vendor lock-in yeah so what can you build with the normal well you can build a bunch of existing apps but with full stack decentralization uh some fundable tokens like xerox and cow swap non-fundable token trading like wyvern openc or amms um you can build you can decentralize rollups using onoma you can decentralize the uh multi-stick that git coin uses for public goods funding

um but as i said earlier when ethereum was created we also didn't know the entire scope of kind of application set could be built in the long term that only came after we had a generalized architecture that allowed a very novel thing to be done um so here are some ideas we're having on what you can potentially use on normal for so you can build private dials where the votes are private but the results are transparent you can do private auctions which is actually really cool because anoma comes with programmable threshold decryption meaning that transactions are encrypted against a single shared public key this means that 15 people can come together and submit all their intents that are still fully

encrypted and then in 10 blocks the protocol decrypts all those 10 or 15 intents and at that point you can run a solver algorithm that determines the sort of let's say the correct voting result or thing or the correct auction result or things like that enforces some fairness criteria between the different intents um yeah because you can it's like if you think what kausav actually does cow swap enforces the fairness card here that everyone gets the same price and the way it works is or the way you build this on a normal is that all intents are first submitted to the chain uh the cow swap dab onanoma or the cause of village predicate then says well a batch is 10 blocks so after 10 blocks protocol

please start decrypting everything in the previous 10 blocks now we have a batch of decrypted and available data that then solvers can look at and go i can't inject extra data because this is the batch so you can't front run these batches anymore and then the validity predicate on onoma actually can see what is the best possible solution where everyone gets the best price you can build private games and i think the thing that i'm most excited about is multi-party multivariate private bartering any asset can be traded for any other asset and as long as you find some sort of path through maybe 500 different trades you can get exactly what you want and you don't have to worry on like figuring out exactly the 500 hops

or you can build on-demand runtime roll-ups um right what is a roll-up a roll-up is just your roll-up a bunch of computation if you have a state transition and on if you have an intent a b c with a state transitions a to b b to c c to d you can just roll them up on the intent level um and you just get an on-demand runtime roll-up yep so anoma is built by these are my two other co-founders arewa and chris ours running around here as well we also have a booth upstairs there are printed white papers which aren't no actually since today they are publicly available but still there are some copies with the updated whitepaper you can also check out the entire team at helix dev team

and yeah thank you very much anoma is a unified architecture for full stack decentralization and i hope you like the talk [Applause]