New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

ENS 🛠 Identity in your dApps - Luc van Kampen

ETHGlobalSun, Oct 9, 2022, 12:00 AM

Welcome Luc van Kampen from ENS for a workshop titled " Identity in your dApps". ETHOnline is our biggest event of the year! Collaborate with thousands of developers and creatives from around the world and win over $300k+ in prizes! We're bringing in 30+ of the biggest teams in web3 to give you access like never before. Learn from ecosystem leaders and build your biggest ideas as the merge nears reality. The future of Ethereum is being written right now, and it's time to make your mark. --------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com #ethereum #web3 #blockchain

Transcript

[Applause] [Music] awesome okay we are good to go hello everyone good morning or afternoon or evening wherever you are um i'm krie from eath global um we have luke here with us from ens one of my favorite people um he is gonna do his workshop on identity in your deaths super excited um if you have any questions we'll have maybe five minutes at the end to do like a short q a so just feel free to drop your questions in the chat box or you can raise your hand at the end with that little emoji but yeah uh we will let luke take it away and yeah enjoy the workshop all right sweet um well you took my took my opening there i was gonna do the whole good morning good afternoon or evening whenever and wherever you are but uh i'll take it um regardless hello hackers um i hope your your projects are going great um and this is the the workshop so um can everybody hear me i hope so um anyhow i am 0x225 f137127d 906 788 bc 7fcc 1f36746a3c3b5 otherwise known as lewisman study and that kind of sums up my entire presentation um that is ens the core premise of ens ens is the ethereum name service ns allows us to turn names like into wallet addresses as shown here 0x ba okay i will i will spare you the pain long story short we can do this and a bunch more let me show you don't run away just yet though if you already know what ens is and you know you joined in for this presentation regardless um let me quickly run you through the points that i'm gonna be addressing and then afterwards we can talk okay i'm gonna be talking about what ens is how our core contracts work and all the cool stuff you can do with it i'm going to talk about records resolvers and destroying data on chain or off chain cross chain uh interoperability so where data gets loaded from and all that kind of cool stuff implementing ems in your dapps or in your smart contracts and if you're completely new to ens how to register an ens name and set your avatar so decide whether this workshop is for you if all of this just made you go hey i already know all this stuff cool congrats to you i feel free to leave happy hacking and i wish you best of luck on your project otherwise stay tuned for starters i want to address some of the milestones we recently reached um we just hit 2.17 million different names registered uh this is last updated this morning the 8th of september 2022 i might be wrong on a date i'm not really good with date and time time is weird we have 506 actual like proper integrations supported by ens as well as 541 000 unique owners of names sweet let's talk about a quick practical example you know your average gap if you're building anything that has a front end you're probably going to be using ens so obviously i want to shield a project that i built during like three four five hours in an evening in paris during the east paris hackathon tic-tac-toe some stupid tic-tac-toe and solidity game but it's just for example also excuse the design you know what whatever it was a hackathon project it's fine um if you check the top right corner you can see my username and you can see my profile picture and how much matic i have but username and profile picture sweet right here in the in the top awesome and that's not all if i look around the ui we can see the two people who don't have enos names because they're missing out and i played games against them i think those are my other wallets i'm not sure regardless when i press the create game button i can send an invite to somebody there's a lovely little input field where i can put an address or an ens name so if i put an emf name there such as nick.ethan and then i press the send invite button i can send an invite to nick daddy sweet now that he's accepted and we have started our tic-tac-toe game here it is uh there's nick duddy there's his profile picture and i didn't put his address on there because i [Music] had a hackathon project i was on a time limit um i started pretty late so you know there's always time to start if you haven't started already you can still you know build your whole thing um obviously i would flex how good i am at tic-tac-toe but considering that is not really the case let's just keep talking about ens okay so the core idea in this step is that the username and profile picture were both provided by ens but we can do a whole lot more than that this is me i'm losing studies or v3x.e that swaps back and forth i'm one of those people that changes their name every once in a while because i feel like it but long story short i'll probably forever be those two names and this is my profile picture as well as my address or at least the part of my address putting the entire one there would be pretty contrary to the point so we'd like to shorten it still give you the idea that you can validate it still allow you to validate it but not you know bloat up your entire screen we can store a lot more in ens names though this would be nik daddy and we can store not just his ethereum address but also his doge his bitcoin his litecoin and any other coin that supports ens how much does that take not much because these are text records so anybody putting ltc and then something and there you go now it magically works you can integrate this into your dap you can get people's bitcoin address you can get people's litecoin address you can get their near address you can get their whatever on any other chain any other network any other kind of cool stuff next you can host your websites on ens that's the content field i don't have that on this slide because you'll notice soon the slide runs out of out of page thing left um but you can store all sorts of cool stuff in here you can also store a link to your web2 domain if you know that's where you host your things as well as your email address so people can reach out to you maybe your discord maybe your twitter maybe your reddit your telegram your github or you store your ens profile so if you're an ems delegate for the ens dow because we have a dow and all of the funds go to the down are managed by the dow um you can put your blog post in here uh your your forum post in here for your dao application and then people can see it with your enf name sweet and obviously you know the avatar this specifically is an eip115 avatar which means that it's like a specific spec that allows us to have nfts as profile pictures and you can only have it as your profile picture if you actually own the nft which is super cool um as well as a ton of other stuff like http urls or ibfs links or our weave links or other kinds of cool stuff so how does all of this work i can hear you asking it's pretty pretty simple and i'm going to try and explain it to you dumb it down a little bit explain it to you there's a couple core contracts that ens runs off of these contacts keep track of important information like your name looseman's study your registrant which is the address that gets to control the name um and transfer the name and when it expires which in this case mine november 18th 2025. hopefully by then i will have renewed again but you know that's just another transaction last but not least it also stores the resolver which is a contract address it stores this for me it stores this for nick it stores this for vitalik and for every other ens name out there keep in mind enos names don't just have to be dot e they can be dot com.

computer.contact.show which is the domain i use to host this presentation luke.show um in case you're interested and a ton of other cool stuff please don't go to luke.show and fast forward in the slides because i have a 30 minute time slot to fill and i'm trying my best obviously this presentation can be clicked through in half a minute but you know whatever um so i i see you going okay i've got some code how do i actually load my avatar from this because i want to get the cool data so you go to your library and then you get your library to request nic.

ed so you go hey i'm looking for nick.e and then the core contract goes okay here you go and it gives you the information you need in this case we have nic.e the registrant expires resolver we can fetch all of these with different functions but the thing we care about here is the resolver the resolver field is a smart contract address it points to a smart contract right there so this specific resolver then points to the smart contract address this specific resolver on that smart contract address um has a couple functions that can basically return the metadata that is associated with your name like this so the contract stores your eth doge your bitcoin your litecoin their addresses not specifically the currency but the address of yours your website your email your discord your twitter your reddit your telegram your github your enos delegate your avatar your content and any other text record you'd like to store now the cool part about this oh i'm slides behind on my controller uh there we go the cool part about this is that this contract specifically 0x497ba41 is the public resolver it's an ens contract that we wrote and deployed and it's the default on most names through the ens manager the ens contract public resolver contract allows you to modify all of these records so if you want to go edit your website or edit your email or edit your profile picture you can go to the ens manager and do so through there however as well as edit your resolver however what i think the cool part of ens is and where the cool parts come in or the even cooler parts because it's already really cool um is when we change the resolver because you can point the resolver to your own contract which means that you now control the logic of what metadata gets outputted so you can change your eth address you can change your bitcoin address you can change your avatar and programmatically have all of these fields set if you wanted to have a different avatar depending on the day of the week you can code it if you wanted to have a different avatar depending on the price a different description depending on the ethe usd price or the e s token something the amount you have maybe there's so much cool stuff you can do because anything that can be written in a smart contract can be made into a resolver and can be read from ens sweet so it's fully programmable now i see you looking at this and going oh yeah cool i can make my own smart contract but they'll have to be on mainnet and i understand that when you you know look at these things like ethonline and you see the sponsor list you're like whoa that's a lot of different evm chains and i understand that all these fancy things are super nice to look at i mean look at all of them i want the oh i'm behind again this is fancy stuff i want to build on these i understand you want to build on these so it's possible to build on these we want to build on these so we got you got good news for you ccip the cross chain interoperability protocol otherwise known as telling your library that they need to read the data from elsewhere super simple allow me to explain this allows us ccip read allows us to store data not just on chain but also off chain on rollups on layer twos on magical zk things on hd over http over htc pcp and practically on anything heck your toaster could resolve your ens metadata hypothetically speaking it would be a smart toaster but you get the point right anything is possible which is super cool and you're able to program it completely obviously this will require some intermediary steps but it's not that bad so how does this actually work right how did we add this functionality is this fully smart contracts whatever if you're doing this on chain you can do it through chain link oracles however if you're doing an off chain you'll need your library to handle it in this case here's the way ethers goes about it ethers will request from the ens contract on mainnet your resolver right request your name verifies through the owner all that fun stuff um if that's what you ask but request your name and it gets the resolver field then it reaches out to the resolver contract and says hey resolver i need to load the avatar of this user or give me the east address of this user and the contract instead of replying with the information says oh no revert off chain data go to optimism or go to polygon or go to arbitram and this is the contract you need this is the call data and then ether says hmm i know how to handle optimism i know how to handle paul i know how to handle all these chains i got you and then it reaches out for you to optimism to the contract does all the stuff you need to do and then eventually your contract written on optimism or your nft on polygon replies and ethers has the data it needs your profile picture your whatever so you can now have this on multiple chains off chain on your teapot on your whatever and it will magically work the best part about it is that all of this is built into the library by default which means it is no extra effort on your part to support these kinds of names if you're building a web ui all of these names you know that are fetched from people's toasters will just magically work your fridge will be able to update its records dynamically it's a pretty good one so obviously there's a bunch of libraries out there and before you go looking what libraries are ens capable or all that stuff most of them already are so i'd recommend looking at the library you're already using right now and seeing their documentation and checking if they have ens support most popular libraries out there like ethers wag me en sjs obviously uh web3 js web 3j ak ethereum web 3 pi and go ens which would make sense because e s in it already supports ens and off chain resolution and that kind of stuff you can do things like forward lookup where you can give it a name and then it will reply with the address right so i can give it v3 x.e through loosemanstudies then it will reply with 0x225 f13171 yeah that shipping or you can do reverse resolution and fetch somebody's profile picture in avatar based on their address so we can go from wallet address to name which is super cool and you can do a bunch bunch more now i've been pushing myself a little to make this presentation and i've been procrastinating because i'm human i think and that means that some of the parts of the presentation i haven't fully finished so my sincere apologies because i could talk about sub-domains for a very long time there's a lot of cool things that we can do with sub domains and sadly this presentation has this part of this presentation hasn't gotten enough content just yet but i will be updating it as time goes on so if you check luke dot show slash east dash online dash 2022 you'll find the slides and it should be updated in a little bit however sub-domains same resolver logic same infrastructure same everything allow you to create sub-domains give out subdomains have subdomains as nfts depending on how you code it or what code you're using um we're working on some some examples for that so that you can easily do it as well and you can control all sorts of cool stuff so you could give sub domains to every member of your community or you could make an off chain resolver such as we've seen with argent and with lens and with coinbase where subdomains of those services are given to the users thereof so with coinbase you're given a cb.id subdomain which is a fully working ens name which is super cool so everywhere on the decentralized web and soon the centralized web you'll be able to have that as your name i have issues on ramping but otherwise i would have had luke dot computer on on ens already but you can do all sorts of cool stuff like that right you can take your web 2 domain and convert it to your web 3 domain and still have both and you know have extra functionality super cool so so where do you find more about this we obviously have our documentation docs study and s dot domains where you can find most of the the information that i just mentioned um i'm currently working on on a more improved version of that and more news will be coming about it uh in the near future as well as you know all this other cool stuff so i see you sitting here no i don't i can't look through the camera but i'm trying um but i i can i can envision you listening to this and going yeah that's that's cool these names are really cool but you know super duper cool where do i get one how do i register one and it's really simple the ens manager now the ens manager is not the only place you could do it directly on chain or you could do it through any of the other places such as the uns ferry rainbow coinbase lens or argent and each of these have their own things coinbase lens and argent are doing their subdomain thing and e s ferry and rainbow as well as status and e s ferry and rainbow allow you to register names directly um the enos ferry also has a cool feature where you can register a name and send it to the ens vault so if you find a name of a celebrity or of a person that you think should deserve to have their ens name but they're not in the web 3 ecosystem yet you can purchase the name for them send it to the ens ferry and the ens ferry will try and do their best to make sure that person gets their name so for a fair bunch of celebrities you can right now register their name give it to the ens ferry and then whenever that celebrity enters web 3 or wants their web3.

ethname then you're able to send it to them sweet the unis manager is what i'll be focusing on today i also want to tease really quickly we have a new version of the manager coming out um obviously it's been the same one for a fair bit of time so the alpha version is going to be there soon it looks really really really good and our developers have been working on it like like madman so i'm super excited for it you can find a tiny preview with just read only for now on alpha.inesta domains and we'll have more about that soon as well the enos manager i was going to get back to that business manager looks like this it's on app dot net domains you'll also find it if you go to ems.domains and it's super simple you connect your wallet and we have a search field you go to the search field you enter the name you want in this case alice study and you search for it here's the name al study this name has the registration on there we have a gas calculation on there and a button to request as well as a short explanation of the three steps that it takes there's three steps to registering an ens name two of which are transactions and one of which mean is is waiting for a minute this is done to prevent people from stealing your name or from man in the middling you or from all sorts of attacks um so here's how it works you look at this you can register for multiple names in one go uh i recommend you do that because it will save gas um and you can register for one year two years three years four years or five years which will cost more or less each depending on how many years you go for the price of a domain as long as it is five characters or longer um is going to be about five dollars a year and the other two uh for four characters and three characters can be found in the documentation um i think it's 640 and i'm not sure for four characters i'll have to double check um but check the documentation for the most up-to-date info this price is directly fetched from the chain link usd oracle or etherusd oracle whichever order it's in um and shown in the ui and all the fun calculations uh surround that so the actual price for the domain as long as it's five characters or more is five usd a year this five usd then goes or worth of eth goes to the ns treasury and is managed by the ens dow um so yeah super simple let's run you through this you have your name you go for one year or for however many years you want you press the request to register button the initial transaction is starting over here it goes through you wait for a minute and then after that it asks you to press the register button again this is transaction number two with the first transaction we've basically reserved the name for a few minutes so we and only we have the right to buy this one to to register it for this year um and then after that after you've waited a minute you can press the register button and register your name so once that transaction finalizes this is what you'll see if this is your first dns name i recommend pressing the set as primary ens name button which will guide you through another menu on how to set it as your main ens name so reverse resolution works properly and your name will start appearing in all the sites and otherwise you can manage the name or press remind me for getting reminders or notify me for when it expires so if you're not actively checking which i presume not everybody is you can get email notifications or other kinds of notifications hopefully soon um when your name is about to expire sweet now you press set uns name and you can do all that fun stuff so here's your profile this is mine um v3 x.e you can see the controller and the registrant um those are two different fields controller is whoever currently has the name and gets to use it as their identity registrant is the one that actually owns the name so in my case my registrant is my hardware wallet and my controller is my software wallet um the name expires june 16 2023 i need to renew that and um you can see all the other fun metadata that i've stored in here this is a sneak preview from the alpha one okay whatever we'll go back to the other one let's talk about setting your avatar okay back in the old manager and again this will all be updated when the new one comes out um it shows my registrant it shows my controller it shows the expiration date as well as the address it's currently associated with which by default will be your address so it saves you from paying more gas right um what you do is you go to the add or edit record button on the right side here you fill in the avatar field because all of these fields are editable right here each ltc doge and there's a bunch more but you have to actually add them yourself because otherwise the page would get too long by default um you can add the content so the actual like where your page should go so if you'd like to have your dot ether limo or dot eat that link then you can access your page that way um and you can set other text records like the email you can see down there or avatar avatar can be set to an ipfs url an r weave url an http url base64 directly uh there's a specification for pointing it towards an nft and a bunch more other cool stuff cool there's one last thing i really quickly wanted to do before i end this presentation and again i've ran out of sync um and that was just a rick roll everybody because you can't give a talk not rick roll the entire audience and then yeah that was it uh my name was looseman study uh at lewisml if you'd like to follow me on twitter i wish you happy hacking and um yeah that was my presentation my workshop if you have any more questions i'm happy to take them otherwise if you don't get the chance to ask your question feel free to reach out to me luke.contact through twitter lucemancinell it's over here um or anywhere else the discord i love this picture of you um yeah okay well we'll we'll take it off oh the screen late every screenshot um okay i think we have some questions um in the chat so uh happy to read them off if you want or we can just read through them yeah go for it um oh let's see let me scroll back what is the difference between registrant and resolver yeah so the the registrant is the actual address of the person who owns the name so that would be your address and the resolver by default will be the public resolver but it can also be your own resolver or any kind of fun stuff like that cool awesome yeah and thanks ben for helping out there um another question hello sir um could one use ens to display erc 721 tokens as well for a particular address similar to how you displayed erc 20 tokens and following up would one use the contract address for the erc 721 as the resolver yeah so um if the the erc721 natively supports being an ens resolver because that's another interface with a couple functions um then it is fully doable otherwise pointing it towards the nft address is fully doable the rc721 address however um you can also always after the fact write a resolver that basically connects the two that allows you to convert from ens resolver interface to reading the data off of the nft so you could have ens subdomains or actual name metadata fetched from an nft contract yeah or from a middleware resolver awesome yeah someone says yeah tell us about subdomains please [Music] [Laughter] someone asked what is the um loose dot show url i think yes it's it's luke shaw okay cool you send it off yeah i should buy both but yeah then patrice asked can i use it with a test net yes we have multiple deployments right now i'll put a quick link in the chat as well um to where our deployments are but we have some deployments on most of the mainnet test nets or most of the east death nets um so on rankb and gourley you'll definitely be able to test out and register i think if you go to the manager right now and you change your metamask or your wallet to um one of the test nets then it will automatically swap over and you can register and try it out for free on testnet sweet okay and last one um meek says how about a feature um that how about feature that um ens registry for smart contracts i think mink yes so regis registering smart contracts on users behalfs um that is technically doable although i don't think your user will be happy with the gas fees because it will you know all add up together so your contracts gas fees plus dns contract gas fees um you can however give away sub domains infinite for free in quotation marks depending on obviously the ass fees of your own contract um and all that would take is storing it in your resolver itself or in an nft or in anything along those lines any smart contract cool oh and then we had one more pop-up um could we queue uh to register expiring domain names instead of subscribing to notifications about expiration that's a good one um so the way that we've done expiry and it's not in my presentation it really should be um it's slightly different from how normal domains expire um the way that they they expire with ens which is something that we put way too much thought into um essentially ensures that everybody has a fair chance depending on how much they value getting that name so if i wanted to have my name and it accidentally expired um you have a three month period during which the original owner can still renew the name so the name is unaccessible to anybody else and then after the three months a 21 day dutch auction starts so the price starts super high and then 21 days later it is back at registration price um and whenever you feel like you think that's the price you're willing to pay whoever first ends up registering the domain then gets the wins the auction essentially and gets to have the domain so if some multi-million dollar organization really really really wanted their dot eth name and it expired um they'd be able to put in as much funding funds to it uh they wanted to um but if you wanted to take it from them you could you know overstep them and do that as well but that essentially prevents sniping okay cool all right um i think we have two more and they'll probably be our last one since we're almost over time um can you own an ens and distribute sub domains to other addresses yeah so you can own um an ens right now we have a subdomain functionality but that is all on mainnet so it all costs gas you can write your own resolver to manage subdomains or you can do it on a different chain and have all your data on there so if your nft lived on polygon then you could have sub domains magically working through the polygon system yeah awesome and then last one uh can a smart contract change its name to a doc contract um so no uh ether scan allows you to have like vanity names so for the e s ones we have like e s wallet and e s dow treasury and all that fun stuff e s public resolver um however for getting your eth name ens only provides the dot etld um i feel like that's one of the core principles of ens that we don't want to intrude into any other uh tld's domains for you know pun purposes um but we do however support any internet domain so if you have a com or you have a dot org you can get your contract's address to be.

ether.org or dot whatever your domain is so if you own and in my case um for proof of grass that was pog dot earth you can have that as your ens name your dot earth essentially right right which is super cool yeah awesome thanks everyone for the questions um thank you so much for the workshop um you always bring like the chaotic good energy that i love so much so um and yeah if you have any more questions everyone feel free to drop them in the ens discord channel um the team will be able to answer any questions and yeah happy hacking everyone happy hacking take care

Automatic transcript — names and jargon may be misspelled.