ENS on Layer 2
ETHCC 4 · July 2021 · 38:12
Makoto Inoue describes a plan for Layer 2-agnostic Ethereum Name Service integration. He explains how dapps could resolve names consistently across chains while users choose where to register and update their records.
Speakers
Topics
From ETHCC 4, hosted by Ethereum France.
Transcript
okay hello my name is makoto and this is talk for ens uh thank you for coming and i just did you know raise hands ems name and there i think more than half the people have ens names so oh omit what ens is this is usually the first slide i said ah there's a hexadecimal and this is matokun.e so send me east that's how i start but i'll skip all that and yeah so we've been doing for almost four years we just had a four years anniversary and since then we have about uh almost like 300 000 names and we have over like 100 thousand users and more importantly this is the hardest
part but we have over 250 dapps wallet and the exchanges which integrates with ens and the ens is very simple smart contract and it's uetty only like multiplies when more daps and the wallets integrate so if you are the you know builder or if you are working on any of the crypt project uh make sure your enns is supported thank you and uh we are we are around the like oldest smart contract as i mentioned at the start of the talk uh he fast launches that may the force you know may the force be with you so everybody can remember at 2017
and it's been very kind of stagnant like in the people using but when the kind of lost bull market and there's an nft craze you know ens is nft and the one of the easiest thing like people can say your friends or like you know acquaintance said hey i want to do crypto what can i do fasting getting ens name is one of the first thing you could do so it's one of the most affordable things you can do before people go you know ap into like d5 you know that kind of crazy stuff this is the easiest thing so and it's growing fast this is a chart from the esa scan that according to their they recently integrate reverse record into their platform so that like now if you look at your transaction history
you can actually see if the sender or receiver receiver has enos name resolved for using reverse record you can actually see who's sending to food which in fact enhances the usage and i'm glad like it's from abe in his past days talk he was talking like you know uh ens left from right and almost you can use that ens as a kind your own chain reputation identity so i'm very pleased that it's it's kind of like you know adoption is happening but especially this last one month you can see like it you know hockey stick cub but there is a kind of gotcha that until april may as you probably know gas price
was really really high so a certain point until d5 summer starts it was less than you know to register ens name you only pay like five dollars a year but and the gas cost used to be like a couple dollars but during the d5 summer at the highest people have to pay like 150 dollars just to register name that was ridiculous but amazingly still like about 100 people a day of registering so i was quite amazed by then i think during the may when like we hit down from the all-time high and everybody gets slashed and liquidated that's the opportunity for ens lover that like you know yes i can buy more enes name so that's when gas price
went down enos name went to the moon so i hope gas price goes that stays low and people can start using but we can't just rely on you know ecm gas price happen to be you know cheap so we have to do something so this is the main focus of my talk today let me just check time so today's agenda is uh this is relatively technical talk i have some slide but i don't expect you to understand the whole line by line there's actually youtube videos and stuff so if you are interested uh there's a point i'll publish the slides so you can actually watch
the youtube video like three five times until you understand but this is just try to understand the gist of what we're trying to do and also this is kind of still kind of open-ended we have some prototypes but the implementation could change based on your input or feedback so if you are you know layer 2 operator developer or dap who's thinking about using you know issuing sub domain to you know your user or something just talk to me so we can discuss and depending on whatever chain of your favorite we will try to think about it okay so that we're gonna talk about four topics first the ens layer to design consideration like
we have very unique kind of sets of things we have to think as opposed to any other people doing this kind of layer to sidechain friends enemy integration and also we do have a one step ahead on it oh yeah we have some idea called roll up agnostical to integration so this is where a bit of calls come in but again don't focus too much on the coding logic because i don't fully understand the full logic yet so i'm same with you guys and also then number three is something we've been discussing for last it's especially a couple of few months when like our market dynamic quite changed that like you know you can't just support l2 roll ups and then just get
get it done so we were just trying to think about how we can accommodate these and if i have time i'll do i saw about like there's some faq i came up so i can answer and we might have time for faq okay so yeah l2 design consideration so majority of most kind of l2 evm change strategy is like a step one uh copy your own code or you might want to copy someone else's code if the license permits and that you know you just deploy to your favorite chain and you ask your user to you know change the network so this is a case of the i think this is yeah sushi swap that like you know hey
this is kind of interesting like a couple years ago this was a similar ui of like you know hey you want access to the dap which way you want to use and you have like metamask and all sorts of five ten different wallets and the people get confused which one to connect dude now we have new problem of like which network to connect to should i go to polygon phantom bsc xdi and now there's a roll up abstrom also optimus drum and then we have lms which everybody got their money and whatever the trust community stuff yeah you're earning lots of money i think after the talk you guys should you know change each other but like you guys are already experiencing l2 right
but like asking this is quite problematic for ens but not just for any d fighter like a it's a com before even when people are using uh people have many different ways to interact with uh ethereum and yes metamask is a kind of dominant usage but there's lots of wallets and they're all wallets especially like you know if you are on the conference you're going to use mobile wallet some people use i might use like metamask mobile but some people might use like i don't know trustworthy alphawallet.com stuff and they all have to keep up with all the how to switch to the different network which is very very hard so this is kind of
things that we have to think about palakki i think most other device apps like you just like you set network and if you want to drive traffic you just you know mean like a drop matic will drop like sushi so that hope like people goes to this network so this is a usual approach but i already mentioned some of them but like yeah so the biggest let me just go this one faster so no switch network in case of ens ens is everywhere es is in metamask ens is in uh issa ens is in open c and if we ask people to use ens for satan network you have to depend on all the underlying uh daps to integrate to make
sure they integrate with the specific network but that's very hard to have everybody have the you know support for specific chain so we don't want that that's kind of a big part because unlike d5 which is like you know as long as you make money doesn't remember what the word is in our case you want to be accessible if you tell me what's your e address i wanna say matokun is and no matter what network you are interested interested you still want to get your isa drives back so this is a fundamental difference of the design consideration which is different from any other d5 and i think this is kind of similar to any other uh other people that you know there's so many things happening
right this year's uh yelp like uh scaling right there's a optimism when uh it's rbi trump everything and we don't know which one's going to win yet and also we wants to be the public kind of service for entire acm ecosystem and eventually we might have to pick on some network but at this moment it's too early to just use ens only you do this we try to avoid that as much as possible and another thing is so minimize additional trust assumption let me go back to this slider initially we first started the design discussion when vitalik posted a blog said i think he was in a post in his research
or his magicians that he posted that something titled a general purpose l2 friendly ens standard and i think in this context he was saying like a roll-up is here to stay roll up soon remain even l2 comes uh you know east 2 comes in so we have to design where roll-up is everywhere and at that point he actually suggested to have some sort of like a bonding mechanism that like if you want to resolve a ens name in specific chain you should have some sort of bonding to a test that this name which is resolving in l2 is correct and if it's wrong it is slash or something that was kind of his initial
suggestion then after that we had about two three meetings with various like l2 pro uh operators like we got i think we got lots of input from especially arbitrary team that when we are talking about yeah i think it's like a i think harry of harry someone i don't know how to spell but from arbitrary he said like well if it's l2 or roll up there's a uh ways to you don't have to have your own like a ens name validation network to attest because lt already have the ways to verify the state
of the uh data of l2 in l1 you know like roll up and the l2 security of l2 into l1 so you have the basic mechanism so why don't we incorporate that that was kind of suggestion came from the harry and basically the discussion with nick johnson who's the founder of the ens and harry from the cto of the app drum so that kind of steers our design and then we came up with kind of design i'm going to explain later but through this discussion yeah oops so one thing we said like we don't want to keep adding additional trust
assumption so if you are going to use specific l2 you are fine to trust that l2 but you don't want to keep adding new things so that's kind of design principle some of the solution it works some of them doesn't but i'll explain later okay so roll up agnostic lt integration so far it's okay yeah yeah okay good so uh before i talk about specific implementation so this is this is the way it gets a bit uh more technical how many people do like solidity okay 30 yeah other people if you can understand that's great if
it's not don't worry so this is a fundamental of the basic structure of ens is ens is one of the simplest smart contracts like the core of the architecture the model study back in 2017 that there's no like you know known pattern and stuff and at that time like a so we have a base smart contract called ens registry which is almost like a proxy pattern which everybody uses nowadays but without using any delegate or fallback or anything it's very simple the ens registry is a dictionary of the name of ens as a key and which value which returns
another smart contract called resolver and so fast like you say hey what's my ecm address you're asking in this registry and it returns the resolver smart different smart control address and the client asks second call to the resolver and the resolver has actual logic of what the data is so even when when you are doing like a lookup on the metamask it looks like it's showing the resolving in one name underneath it's actually doing the two requests in the ecm network so that's a base and the reason we did is basically easier ways to upgrade that when we want to add a new feature into the resolving
mechanism prime example is now we not only resolve the ceremony address we resolved 200 different coins that didn't exist back in 2017 because they are one two hundred uh like you know coins right then when we added it we can ask users to just switch the resolver to the new one so you can opting up to opting upgrade and also resolver we provide a default resolver which does the basic thing but you can actually write your own resolver that like any name you look yeah it all goes to me or something like that you know you can't do it and so that's the basic model
and what we are trying to present is called l2 gateway model which is a it's not necessary for ens but we try to make it kind of generic way that for example back in the day everything was on chain but when nft comes in it kind of became a hybrid right like a one does things uh people new to the uh ecm system get confused is okay is my nf teams in blockchain no it's it's just like references exist and all the metadata in smart contract you have a reference as a uri function which refers to so that was a elc 721
specific way of saying like this is where you get off chain data we want to have more uh standard way of doing that so i was supposed to put the link but there nick johnson recently created eip 3668 which i'm gonna tweet later so you don't have to remember and he created a name called during uh i think this is load of the ring are there a lot of the rings funds a lot of ring fun do what's doing sorry i couldn't hear sorry for asking
i heard that that's some gate to some world yeah like he's into this fantasy all the stuff he played dmd all the time but anyway i'm sorry asking that question i just confused myself but during means some sort of a gay way hence we wanted to generalize we want to name is important so we just said okay what names you want like you know these guys all do like geeks like so we yeah all the gigs into you know a lot of the rings no one knows so sorry for picking the wrong name i keep typing dorian
and the nikki no no no d-u-l-i-n then type checking into dorian but probably we should call dorian maybe yeah yeah okay thank you guys rest sorry uh so but now i think people are sticking to during during durian which is good eip366a so we have we defined and he actually used defines a kind of generic way not just for ens that if you have a if you want to source data outside of layer one you should basically call the function and that
function returns the error type which is a new i think basic construct of the solidity that when you do before he was using revit and message but now you can specify generic type so we suggested creating kind of what was it look up something something error and if he returns uh he returns uh it looks into yeah i'll explain what's the code actually uh oh no i i think that's the latest when it's not in the code but anyway i think i keep confusing myself but important thing is rather than resolver returning the address directly this during model returned the gateway http url and gateway
is just a web services anyone can host and you ask this gateway to go to fetch data from whatever the layer two or three or just know your normal database give me the data back to it but most of the uh layered layer like roll-up model they have a basic construct that like you know they write the their l2 stay in i think uh core data periodically and they each uh chain layer two uh roll when i say layer two i just infer that that's a roll ups you know which doesn't include like station or anything so just whenever i say that they are two it's a roll up roll up has a ways to
verify the state of l2 inside the l1 so they just return the proof data as a proof and you you write a resolver in l1 which verify that uh in l1 so like gateway just get the data and you just prove and once it's done uh you're okay so by doing that all the dapps integrates ens you just keep like accessing to like ens on layer one and then you never have to switch network as long as you are reading the uh ens data when it comes to updating it's uh it's whole story you you have to switch
but majority of the case in ens is like reading data is probably 90 90 90 of the daily use case so we want to make that thing as easy as possible so this is a design principle and yes i mentioned that there's a l2 gateway uh optimism demo and there's a youtube video nick is doing stuff so if you're interested there's a youtube url i'm gonna list you watch like five times until you understand but i will briefly go through the code or to explain what i try to say is uh yeah can you read good yeah so i think when you're in the
l1 and the user in the contract there's a address function and instead of this address function returns data it's doing an encoder with selector optimize resolver stuff which is creating this function signature as a some sort of prefix with the gateway url and then the gateway goes to resolver on l2 and the reservoir on l2 has whatever the way this is just again as i mentioned just a key value store so it just returns and once it's done so you have a oops
yeah so before it was an address but now you have an address with proof and you pass the i think proof which you got from the gateway and here this is a layer to specific code and in this case i'm i'm very honest i don't fully understand this code but like this code does the optimism specific ways to verify the state will prove and once it's verified then it's kind of decoding the uh data from the state and that you just redone it so this goes in that three steps that that's kind of basic concept for how we doing in layer 2 and in this way uh
yeah you can update data on l2 but without compromising uh the security you you know you use the same security model for the l2 which is l1 so that's what we were kind of experimenting up until march may april then this happened that well it kind of started happening from february that all the side chains actually took uh off so this is a tvl on other evm chains like a polygon and the bsc kind of you know like competing each other and we are i think maybe it's safe to
say side chains and the evm compatible and now there's like a you know near cello avalanche what other evm chains moon beam and single phantom you know there's so many chains so we have to kind of think about it so we've been brainstorming for last couple months and this is still at the design stage so if there's any better way we we welcome your feedback but like rather than creating the l2 gateway we kind of came up with three different gateways bridge gateway app gateway trusted gateway
this one i just named it a couple days ago so it's only in my head so if you ask nick what like he might say what's trusted gateway but so he so i use the same diagram that instead of so does anyone so who has used side chain like or like a polygon x die okay so as part of it you guys use a bridge right so and i think it depends on the bridge but you guys are aware that security models bridge is different from the sidechain itself right so like sidechain they might have validator or like
whatever stuff bridge has its own unique sets of i think some some bridge says relay some bridge says like a very fire that kind of stuff but they have their own it's basic assumption is more like a multi-sig that if you want to cross the asset from chain a to chain b you lock the asset into this bridge contract then it's locked and you mint in the other chain so this one is actually your entry truss assumption not necessarily this layer the side chain itself so our kind of compromise idea is that and it depends on the bridge but i think
easiest example is like x die i think x dice side chain is almost like a multi-circle of the area of like three to five signers and they sign and if you get like uh two or three uh signatures and then you you kind of [Music] approve the transaction and also their signer addresses is on l1 so what we are going to propose is like a gateway can get whatever way you could use graph or something and get the data and we ask these bridges bridge belayer i call it i think operator operator to unif unify the terminology but bridge operator two signs uh the signature
just a test signature says yeah this this came from this chain i'm bridging asset and uh on l1 resolver as long as uh you can recover the address and if it came from this set of signers we'll just trust us so rather than trusting the data we just say we trust the bridge signer so this could be could work in the sidechain model and let me compare pros and cons so process it kind of retain the same security assumption with bridge not necessarily a side chain but cons is
we as an ens we don't have we can't do it because we we are not the relay operator so we have to ask bridge so i was talking to some people who does a bridge and then yeah they were saying oh so almost like bridge acting as oracle which is really good uh analogy so they it has they do have all the same uh basic construct to do it but what's missing is most of the bridge is based on the events that when someone send the transaction they respond to the event do something so they don't really have a basic contract of just replying the random data whenever people ask so they have to extend which could be the blocker so if we want to use this in a like polygon or x dial or
phantom i had to walk with a bridge operator so that's that's just a bit short stopper so then we saw is like okay so if you are keen on for example have a dab in polygon or something rather than the bridge still doesn't support why don't you as a name owner to sign message what i mean is instead of bridge to sign the signature when so this and the important thing if you refresh back is that you can set the
gateway depending on the resolver which is assigned to specific domain name so matukundo is can have my own set gateway and i can have gate i guess i have a gateway by myself and i can have basically the private key or something of the address which is the owner of the name and i can host a gateway server and i can sign the transaction i sorry assign the request to say yeah this one i attest in that case you are actually trusting not even the gateway as a bridge but you are actually just trusting the person who said the domain name to trust so that's kind of compromise so
now uh yeah verifying the name ownership not data so this is kind of next level and if you compare uh pros and cons yeah so now you can stop on your own downside is you as a name owner has to own uh host your own gateway this could be okay or not like if you're like a game developer and if you wanna issue subdomain to all your game users this could be a good way but yeah cons is now like you're not even trusting the bridge i can even trust further that if you're doing if only thing you trust is yourself
do you even need a blockchain so this is a ultimate that's why i call trustee gateway just put in the database it does it right even like many nft like openc puts into their service so depends on your user but this one is the same way as the app gateway but you just use database this is the easiest one and let's just compare pros and cons is pros no yeah so you don't have to deploy ens on registry so one one of the problem i didn't really discuss is like okay assuming you can points to ens to some blockchain then how do you know in l2
for example comes says como s wants to you know issue subdomains into l2 in polygon oh sorry not into polygon the first has to claim that the commerce dot is is mine claiming l1 but there's no way to validate that in l1 and o2 so you have to do something special but in this complete trustee thing you just use your database so you don't even need that so this is the easiest way to do but back side but like downside is now there's nothing on your side chain so one thing like such as nfd and then probably nfd is like you know once it's tokenized you can
transfer freely that can't be done right so that's a kind of cons so if i sums up this kind of different truss model the so this is a kind of new banner way we want to get to but no one can get this soon and also again we have to deploy the uh ens into uh layer two we have to think about way of like bridging the asset so it takes a bit of time so if you want to kind of exp but experiment you could actually go with this trusty gateway approach and the good thing is that you can always upgrade to the different models right so you first do this and
see if this model works and when these are ready you can kind of go to optimism or you can do bridge gateway or app gateway so that's kind of things i'm we're thinking and yeah one uh benefit of this complete trustee one is a gas cost is completely free because it's not even blockchain and so how much time left anyone time keeping i think i've talked like 30 minutes 10 minutes okay so i'll go to faq then if you have a question i can open up to audience here that yeah so back to the question like you mentioned
like the growth of the ens goes up and down because of registration cost of dot eth but this one doesn't really solve the registration cost of eth itself it's more likely that it solves the cost of the update cost of the data like if you want to keep adding like 100 different coins and stuff the gas price is cheap because resolver is on layer 2 or side chain but ethereum yeah dot is parent domain resolver is 0 l1 so it doesn't fix and yeah so i just answered and registry to yeah registry contract
will probably more likely to remain on one very long time and you only move for resolver so the ideal use case is again like if you had adapt developers and then if you wants to issue some domain cheaply that that's kind of the use case for really solving the registration because we have to move the entire namespace but good thing is that we can move part name and if he wants to exit to l1 you can also do that just by changing the resolver to like non-non-gateway version that's the fast answer yeah and the canine create sub-domain on l2 and the cell as nft uh yes it can uh so it depends on a feature
called wildcard which we haven't implemented yet which we need to implement but this doesn't this is more of the front-end change that for example we do have gets a request like you know you if you have like 100 different like sub domains and we don't want to have a resolver and they had called the logic there so you could the way we are thinking is that if you like you know if i have who don't matteo is and the fuel is not resolved doesn't have anything you ask the resolver of the parent domain like matuku.is to resolve and if this resolver is in l2 they can do whatever the logic so this has to be implemented but once it's done uh
subdomain may not exist in the l1 but you can query you can create subdomain in l2 and ask gateway to return so in this way it's possible and yeah and how do i yeah then last problem i touched that point yeah how do i if commerce wants to go to polygon or whatever the l2 how can i have the ownership of the name on l2 when i only have the name ownership on l1 which is uh we are thinking about so firstly yeah again as i said ens is nft
so you we should be able to transfer the the name to l2 and we could create a registry which allows you to meet names on l2 on the target chain only if your asset is done so you have to do this kind of stuff so it's possible but like we have to build lots of things and yeah this is it uh so we have the repository for l2 using optimism gateway demo and yeah we have a like this course and we can also have a discussion on this code and i think the takeaway is yeah so this is the kind of way we are thinking
what we need the most right now is the first part of how to do uh things on l2 we have a concrete idea but the latter half is still in that kind of idea stage and i really need adapts who's interested in issuing sub domains and if you are going for we want to solve the scaling part use cases that we don't want to create a solution which in a chain which no one wants to use so if you have your favorite chain and if you're thinking about deploying to that the network and if you want to use a use case of issuing sub domain to the user i'd like to talk
to you so that we can build a case on top of it and also the app trusted gateway seems a bit but like it's kind of pragmatic transition from just trying in a completely trusted way then gradually integrate into like you know trustless way so i think yeah that one we want to build a case so if you're interested just talk to me i think that's about it five minutes left thank you very much uh maybe we have space for a couple of questions any questions
no that's good uh yeah after that talk you can just catch me anytime today i'm wearing these t-shirts so you can just easily find me okay i thank you thank you thank you you