ENS 🛠Identity in Your Apps
ETHGlobal·Mon, Oct 9, 2023, 12:00 AM
Join Greg Skril for workshop titled, "Identity in Your Apps". Some of the most skilled web3 developers, designers and product builders from all around the globe came together for a weekend-long hackathon at ETHGlobal New York 2023. ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
foreign [Music] I am Greg with ens and today we're going to be talking about all things in us so before I get started raise your hand if you have any NS name okay awesome a bunch that's good um sweet so I'm gonna be going through a few things first of all what is ens why it's important so if you guys sounds like we'll know this stuff already then we'll get into more technical details some of which you might know some might not how do people use it today um our bounties and all of that stuff so first of all what is ens NS is a decentralized permissionless naming protocol that lives on ethereum and is built to scale to the entire internet right DNS solved the problem of IP addresses to human readable domain names and we all use it today ens solves a similar problem but was even worse for crypto because ethereum addresses are impossible to remember and so ens abstracts those IP addresses away it makes it into human readable names cool and the idea is anywhere you read or write an address today you should be able to use an ens name instead so you'll see over here I have Luke daddy sending something to gregsgirl.eath and then I have Greg scroll that he's sending something to a long uh random address which has to get truncated because nobody's gonna remember it and if you ask me the name to name is just a more enjoyable experience for everybody on shade and here's another example of using ins out in the wild if I'm sending ether to somebody in metamask or any asset in basically any wallet I'd rather send something to a name that I know rather than a long hex address that I'm not going to remember and so this really shows that ens started as a web 3 username right instead of an address use the username but over time it's becoming more of a web 3 profile and in order to do that we have two different types of resolution so forward resolution is what you just saw in the minimask example I go in I type a name and that resolves to an address but the thing here is I can have multiple names that resolve to the same address and so I can register a name today that resolves to some of your addresses out in the audience but uh really what makes it a portable profile is the opposite reverse resolution or having a primary name and what that means is the controller of uh the address basically sets a name that they want to be their Global web3 profile and so in this case my address ox179 uh will reverse resolve to Greg scroll.eath because Greg's girl.heath is my primary name so what this means is when I log into different applications across web 3 I'm kind of greeted with this Universal web 3 profile right I see great show the Greg scroll.e I see my avatar and it's just like follows me around um and this is another view of that profile I have a name I have an avatar like you saw before and I also have all of these other text records as we call it so text records allow you to store any arbitrary data on an ens name we'll get into exactly where that works later on but it's just leaning into the idea that this is really a universal Global web 3 profile and all these websites on the bottom are just third-party websites that people have created that um kind of identify me as my ens name that is my again portable web 3 profile cool so now we know what ens is but why is it important so it's cool it's fun it's portable extensible multi-chain public good it's a it's decentralized and most importantly it improves the crypto user experience right and so if we look at ethereum over here the ethereum logo DNS the entire ens branding and logo is just a nice friendly wrapper on top of the ethereum logo because it's a nice friendly wrapper around the user experience of web3 so what are the different types of ens names and I think this is where we're going to get into some misconceptions so a lot of people assume that.
heath is ens's only uh type of name right but that's that's actually not true and so you can use any almost any DNS name as an ens name as well so this means.com dot xyz.io or anything else and then the metamask example that I showed before would work with any DNS name so for example you can go to metamask and try and send something to ensferry.xyz which is a DNS name and it will resolve to an ethereum address just like any on-chain duddy thing so there are a few differences between these two things first of all dot eth is really the only blockchain native TLD in the ens ecosystem so it lives on Main ethereum it is fully decentralized the only way something changes about eth is through an NS Dao uh proposal and successful vote so there's no single entity that can change any of the ens.eth core contracts and Dottie themes have a small annual fee each year to prevent name squatting and basically promote a healthy ecosystem so this means if names go unused then eventually they will be recycled and somebody else can pick them up so this is.
if kind of the Top Dog in ens in terms of decentralization next we have DNS and DNS as a protocol respects existing internet infrastructure and it's like the realization that DNS works pretty well you know all of us use it all across the web every day and so we want to allow DNS name owners to use that in the ens world as well so using DNS themes in ens has no protocol fee although in the past there has been a pretty substantial gas fee to use this and the reason is because you're submitting a proof unchain saying that you actually own the dnsa soon you'll be able to use DNS names in ens completely for free including gas and this will be powered by something really cool which I will show you in a second um and it's powered by Enos themes that are off mainnet right and so this is all powered by a cool standard called ccip read and before I dive into that um with these off-chain names there is no ens protocol fee there is no gas fee um there is Ultimate flexibility because the developer can really do whatever they want and read from any data source and like I said ccip read is a ethereum standard not just an ens standard to securely retrieve off-chain data from Smart contracts and it gets verified on the front end level and again we'll dive into exactly where that falls into the ens kind of flow in a few minutes and just to point out that these off-chain names powered by ccip read are already used in production today by some pretty large teams like coinbase lens Eco and so on and so here is a simple example of what that might look like in the wild and I'll go back to the QR code after if you guys want to try it out but basically uh let me make this bigger cool um so this is what it could look like to register a free off chain es name I'm just gonna say testing like that and so I'm going to have testing dot off chain demo.d and I'm going to set my description which is basically an ens text record um and so this would normally be on chain and cost gas to be hello I'm going to Press Register here and just sign a message so nothing on chain at all I'm not paying anything whatsoever and boom I just created an estate and so if I press view in ins manager you'll see that testing with bunch of G's dot off chain demo.eth just like works right and I can copy this name and go into metamask and if I wanted to send ether to this name then it works right away and that was free for me as a developer free for the user and overall a great user experience so let me go back um I'll point out here that the docs on how this works which I'll mention in a minute and the exact code is linked in the footer and so I'll leave this up just for a second if that's interesting to anybody and you might want to do something similar as part of your hackathon project this weekend cool so oops um with all that how does ens work and where does this ccip read off chain stuff fall into the mix so ens at its core is just a registry on Min ethereum and in that registry stores a name alongside a resolver a resolver is also a smart contract which basically stores everything all the data for a name so these text records that I've been talking about the address that it points to and so on is all historically stored in a resolver um so you'll see that the same name can have multiple multiple but the same resolver can be used for multiple names so I'm Greg buddies and we have Rickman in the audience over here we both use the same resolver ox 4976 and so on but also you can have custom resolvers and anybody can develop their own custom resolver which has uh whatever custom logic they want and so you'll see off-chaindemo.if has a different resolver than the others and that's what allows it to do cool things like have that off-chain registration so if we look at the default on-chain resolver again ox4976 is on um basically this stores all the data for a name in just internal storage so if I wanted to set the ethereum address of correctional.ie I have to make an on-chain transaction to this contract saying update my eth address from ox179a to whatever else and same with the text record and so on it's important to note that address and text are basically like objects and so you can add so text records for example support any arbitrary key value pair and address records can be set for multiple chains and so that's another misconception that ens is only for main ethereum it's really for any layer 2 or even other networks so you'll see right here Rick mood.
heath has set an eighth address and a Bitcoin address and so if you were to go to a wallet that supports the standard and you type in Rick mood.heath then it would allow you to send Bitcoin to recruit and so that's pretty cool and something I think most people often miss but now what is different about the off-chaindemo.e resolver and the answer is basically everything so instead of looking at internal storage for addresses and text records and so on it reverts with this off-chain lookup and this river is exactly what ccip read is it's a standard that defines a custom error in solidity and it tells the client to do something different so that's something different is basically look off chain at a data source of your choosing this can be a database like how coinbase does in coinbase wallet if you're to sign up as a new user you can claim a free cb.id sub name and that uses exactly this and you can also use it to look at a layer two and stuff like that which I will get to in a second ccip read works really well in conjunction with ens ip10 ensip is just an ens Improvement proposal and 10 is the number for Wild Card resolution and so what that means is if an if a client attempts to resolve a name that does not exist on chain then it will go up to the parent and basically ask that parent if it has a record for something below it so the name that I created before testing with a bunch of G's does not exist on chain and so the front-end client would then go to offchaindemo.eath see the resolver of optiondemo.
death and then make a request from there basically to get the data wherever else it might be stored and so again it is a matter of internal storage versus reverting off chain to get the data from somewhere else and that is powered by ccip read and ens ip10 so if we just take a step further how can ens work with layer twos which is a common question that we get and really the answer is the same right uh this is exactly the slide that I had before off chain demo.eth revert with option lookup for each type of text record that we have and what I want to point out is that that option lookup again can be anywhere off of mainnet including a layer 2. so how do these different approaches uh kind of change the resolution process the first one is what you might know as ens today meaning everything being on chain a client will go to the ens registry and find a resolver and that resolver will have internally stored the data for the name and just return it right very simple but somewhat limiting because it's just a main ethereum contract the next would be using ccip read so a client like a front end goes to a resolver contract the resolver contract says actually I don't have the data but if you go to this Gateway it will tell you where else to get that data and then that Gateway pulls in the data from a centralized database so again this is what coinbase wallet does because they're not treating users as people who are obsessed with decentralization and need everything to be totally permissionless you know we have options for that but not everybody is of that mind and so it's okay to have a database for a good user experience and then the database Returns the data on chain and that resolves the name or returns whatever data you're requesting the next approach would be basically just replacing the database with a layer 2 contract so same process front end goes to a resolver on mainnet that goes out to a Gateway the gateway then pulls the data from a layer 2 contract and Returns the data so on the problem here is that the Gateway in both the second and third example are basically fully trusted so if the Gateway wanted to just not read from the layer 2 resolver even though they said they would they can do so um and so again that's okay for some use cases but not all and so the kind of coolest approach to this as something that's being more actively explored recently is adding a verification to that layer 2 State on mainnet so again the client would go to a layer 1 resolver the layer 1 resolver would go to a gateway a Gateway would go to the layer 2 contract and then once that data is returned to the client by the Gateway a contract on layer 1 verifies that that data is legit by checking uh the basically the proof that the layer 2 deposits on layer 1 every X period of time depending on Layer Two And so what this gets you is a trust minimized Gateway that cannot return bad results because you have a contract on me verifying these results each time so in the first case it is fully trustless um but expensive in the middle two use cases it is basically fully trusted but free and then in the last use case it is both free or I guess you pay Layer Two gas but it's cheap and uh trust minimized so the worst that the Gateway operator can do is just shut it down and stop operating which of course isn't ideal but they can't fully attack you by like changing any data um and yeah so those are the basically the different approaches and why you might want to do each one and why the last option is a cool one more recently so now we have a good understanding hopefully of what is ens how does it work um why you might care and different kind of extensions to make it work Beyond ethereum and so it's really just like how do people use these names uh like I said before it's really a portable web through identity this is how I represent myself on Jane and my usernames places my display name on Twitter is gregsfield.eak because this is really just what I lean into and everything that I store in this profile is kind of officially me on chain you know next would be communities uh communities have really taken a liking to ens subdomains as a way to feel part of a community right so pcc.eth is a popular nft project that only allows nft owners to claim subdomains of pcc.
it and so if you look on Twitter and you search pcc.e you'll see a bunch of users that like rep this name as their display name on Twitter and they feel part of this community and it's proving that they own an es name and part of your identity next would be immutable text records so like I mentioned before ins names can store any arbitrary key value pair in as a text record and so unit swap somebody made a proposal to the uniswap Dao to establish v3deployments.uniswap.eath and on this thing they set a number of text records for basically official deployments of their unisop contracts across different chains and so any user of uniswap if even front ends get hacked or anything like that the only way that this name could get changed is by a dial proposal so it's really like an immutable record an official list of their deployments and so it's a very different use case for ens but something that certainly makes sense you know it's just a generalized data store that can be used in any creative ways that you come up with next would be naming contracts so a lot of this has been about identity and paying people personally or representing a single person on Jane but also like we deserve to have good user experiences around contracts as well and so you'll see here under ens study we actually use this ourselves to name a bunch of the ens protocol related smart contracts so if you were to go to etherscan and search registry.ens.
heath it will bring you to the ens Registries smart contract that I was talking about before which is kind of like the home base for everything ES and this would allow wallets to basically display that Greg scroll.heath is interacting with registry.uns.heath that is so clear and it makes so much sense and you don't need arbitrary labels per block Explorer and so on um again it's just a way to improve the user experience of ethereum and web3 overall by way of ens next would be usernames so ins as a profile in us as a username uh really is just like the most obvious example I think and forecaster a decentralized social protocol recently took this and kind of did exactly that instead of having their own centralized username space they allow you to bring your own decentralized ensday and use it as a username across the protocol and so I can go to different forecaster clients and I can see that a username is an ens name across the board and it's a cool example of like connecting protocols across web 3 for something that actually has tangible use and people have seemed to really enjoy this so usernames are definitely one of the more obvious and just like cool examples of ens I think and then last but certainly not least web3 messaging so our friends at xmtp are also here this weekend and they utilize ens for a number of things this is what xmtp looks like inside of coinbase wallet and you can see I am messaging other addresses like celebrityth a friend and you can imagine how if I was messaging ox1234 so on it would just look ugly you know uh NS names make the user experience better by having human readable names for all types of crypto addresses so now we have a good understanding of hopefully many things ens and let's give you some resources to uh move forward so first we have a front-end quick start guide this will allow you to very easily get started with an ens app on the front end side in just a few minutes it is a full dock running you through things and also there's GitHub repo that you could just clone as a template and Get Off to the Races um I'll point out that there's a QR code on this slide and the next one if you want to scan that but you'll see here that it's really just a few lines of code with any popular web3 library and you are off to the races next is the Thorin design system so this is actually a little bit detached from ens protocol but just a cool developer tool that we've been working on and it makes it easier to build cool looking ens applications very quickly or just cool looking applications quickly it's a react component Library um that I've had a lot of fun using and I think you might too so really quick the last thing I want to do is highlight the prizes we have a range of them 2500 to the best overall use of ens two thousand dollars to the best use of ens sub names that could be on chain off chain Layer Two like I described the the option is up to you two thousand dollars to the best implementation of ens with account abstraction so think combining certain ens transactions to the initial contract deployment and a thousand dollars to the best use of Thorin and then 500 to 5 honorable mentions so open to your creativity it could be sub names it could be account abstraction or anything else it's up to you so thank you I hope this was helpful we have a booth if you have any questions we'll be there to help um or message Justin Discord and we'll be able to help you out
Automatic transcript — names and jargon may be misspelled.