[ETH Seoul 2024] ENS Integration Workshop by Makoto Inoue

ETH Seoul 2024 · 12 Apr 2024 · 21:53

Makoto Inoue, a developer at ENS, shows hackathon builders how to bring Ethereum Name Service into their projects. The workshop covers forward and reverse resolution, avatars and text records, multi-coin addresses, subnames, offchain resolvers and the ENS design system, with tips on libraries such as wagmi and RainbowKit. It also offers practical advice from a hackathon judge on making a demo readable and memorable.

Speakers

Topics

From ETH Seoul 2024, hosted by Kryptoplanet.

Transcript

[Music] hello uh I'm starting Workshop uh now so yes it's good okay hell guys hi you Che out friend that's it and so yeah so my name is Makoto or name is called M but more

into even for those of you who might not be interested in integrating whatsoever if you pay attention for first few minutes you might guess something is the important thing is I'm a judge so I'll be judging your HS okay and uh so I have a bit of hacking tip from a judge that I do actually uh judge in many events and last one was the East Global London happened two weeks ago and uh sometimes I get to you know like he has a very I think I can't remember the format but usually like you know 3 minutes pitching and then the 3 minutes

Q&A or something and well five five was very short period and you had to do the pitch and they all quite often you asked to do the demo right and uh when to the demo stage I occasionally see things like this like when I see like okay when I see this I have a kind of mentally prepared that it's super technical things so youi doesn't matter so I have to start reading the source code that's one way or he just didn't make you know his 100% or just you know he didn't have a the team has didn't have a designer uh so first thing is that I think there's some awesome to like bu build they give

you some basic layers so I I highly recommend using some a bit of cosmetic work so that to just keep the attention of the judges because if you see that one St like automatically people just dozing off okay and and the second thing is this is actually one of the example at the East Global London starting it's okay but I see lots of these heximal stuff which means nothing for me and I had to start reading test 10 address or something so if and the judging time have very small period so you want to make as easy as possible to convey your ideas so one thing I idea one thing I can uh suggest is yeah just put in like

a you know ens name so like you know if you're supporting Alice bul Charlie you immediately know like all these like you know cryptocurrency analogies and using ens hopefully so just to make your life simple because we don't have a bounty so you don't want to make too much effort so if you don't want to integrate much uh yeah first thing we ens actually has its own design system so if you don't have any designer or you don't want to spend much time uh I suggest you just like you know just using this is react based design system but just use it so this is that you called you want and also for these uh So-Cal subnames I had the time so I actually created the Charlie Alice B and Charlie

especially for ISO it's in sepolia network so if you want to use some like Dam address or something and if you do basic basic integration it should show like this on your app as well so that's another QR code so uh for those of you who's not interested in integrating it anymore just get back to your hack uh but if you if that interested to integrate CNS I'll do slightly more that like basically it's very basic level but uh first thing is what can you do with CNS and then how to do it uh I'll go through

quickly and what can you do with enss you you already see saw some of the examples but uh in more technical term uh we the first thing of like you know when you uh type NS name and getting this address back it's called for resolution and reverse is that like you know if you put address and the UN name back it's called a reverse resolution well called primary name and you might wonder well the purpose of ens uh is so that you don't have to type PM address why would you want to do reverse record which I can explain why later is that how for uh lookup looks is you know most famous

example is uh M like something like metamask where you type moken eth and you get the address back one thing interesting is some of kind of ux tip is that uh yeah there m is red and the reason why they do is is like people sometimes get confused M as the combination of R and N so even though it's like human friendly still alphabet not necessarily like you know so intuitive for everybody so you might if you want to be design conscious you might want to do build stuff like that and also you may still wants to uh you

know check uh show that part of his address because people do actually recognize like you know F few letters which he started with and even if like if you just type ens name and it doesn't show anything I think most people get a bit anxious whether is it actually resol into the right address so it's always good practice to show some of the piece of the thing and another more subtle example is this example like our ens app or Isa scan or uh that's I think opposite that is basically using a URL that m eth and uh if you go to scan page it actually shows address this is very easy to remember

that if you just qu if you I want to you know like type copy and paste address and stuff and if I don't remember I just put the ISA scan the qu of you just automatically supplements the add uh name and the stuff and then I can immediately distinguish or that that's a m is so that's kind of tips for uh when you adding the for lookup support and the so reverse lookup how you looks is yeah like this that like so couple minutes ago I said like why would you type PCM adds you don't type address but when you connect the address wallet to these daps you the daps knows the address and uh that's when DS actually look up the name uh yeah sorry

look up the address and they return the name and this is how it looks and interestingly it has some like Avatar information as well and uh yeah so Avatar is another thing I think is mostly known for storing e address but you can actually set many different like coin types like Bitcoin or like any other evm chains and also you can set like random key value store and we have some specification for especially for Avatar that you can just upload a JPEG URL but you can also specify the combination of uh ELC this example in the green it says e EIP 155 which specified basically I think one is

chain ID and the ESC 721 is the NFD coin type and if you put the uh the token address sorry at the nft collection contract address and the token ID we we can fet the the uh nft metadata image and they can show it to you and uh yeah so that's another case and also uh quite often again like it's most intimidating thing when people goes into the crypto is like when you try to create a wallet and they have where to send it and that's a point you see the ZX address so if you are probably in this uh hack I'm not sure how many

people actually creates a wallet but like even if you're creating uh D when you on board the user for the first time if you can create it as subname under your name for for example in this case is unis swap uh is a famous uh decentralized exchange when and they recently announced to have their own wallet and when they on board the user if you put they can't actually let user to choose their own subname and they yeah gives like you know my photo uni or something like that so that's another use case for ens and this is just more of the inspiration that again uh in uh last I just when in London there's one my friend did the hack which was

interesting is that at the East Global London they had a this uh you know security thing but they had a NFC tip embedded and every time they go uh I think people were scanning so people know that like a East Global had a stats of how many people went to which talks and the stuff but they people Tred to add with NFC CH uh people Tred to add some incentive then one the hacker just spot the opportunity and he created I think a bound wallet made out of the NFC card of the uh the participants breast or something like that so that interesting case of NFC something you might want to work on and we also have a

kind of our internal hack that we Pro we basically print out this kind of plastic card with NFC where uh we give at the events uh I think last events we gave away is at the E haers where basically if they pre-register we can pull off the other Avatar text record and uh so we create a custom NC card where if you greet with people uh you can actually try out after the uh this my talk is that basically it goes to this URL where you type your ens and you mean this uh cute little uh pop of er dancing was the and so and yeah and then you can get

them yeah nft that kind of stuff so that that kind of stuff I think the physical stuff will be quite always get judges attention so like if you know that's something you might want to consider integrating and so that was like what you can do and now it's about how to do but most of what I going to say will be in docs enss domain so if you interested again a photo time that's like now yeah so H if you took the photo and if you was with me please tweet and hashtag me as well so I can retweet and yeah so level zero and most of the I

think bounties stuff uh you know there lots of priz but at the same time it's it's quite difficult stuff like you know there's a what was a trend like in Know da data avilability is always rage and can roll up like or the chain obstruction chain all the stuff it's quite complex but ens is one of the easiest things to integrate and you might already integrated with noticing is the fact that uh how many people want to uses something like rainbow kit web 3 model and connect it you know the that they give you again it's it's more slightly different to a thoring design system but they give give you basic

design uh template and the way to connect to the wallet and the stuff and these uh they actually all them have integrated so if you copy and paste some of the examples you may have already integrated with CNS and also uh wagi is a interesting actually curious to know who's going to use wagi okay three people uh rainbow kit oh uh web model two one so this this audience very hardcore people with that know youi

saying like I show in uh page three okay got it yeah but if you want to do you know bit more get more attention from the judges I highly recommend you spend at least 5 to 30 minutes before Haron ends uh to just just brush up and so w me is good is oh Isa yes no is this like okay I'm curious can you guys shout out what kind of framework you're using for the basic thing what's that I can't hear but anyway okay it's it's good always interesting to know in

these hackers some situation like what's the trending new tools so like you know if you are using something uh cool which not mentioned here please come and say hi and just show about your favorite tool set so I can show next time and yeah St design system I already mentioned and yeah then level one actually if you are want to pay a bit more attention of how to do uh it's very easy so these uh this is wag me I have a set of like a uh yeah fun is it function or I forgot yeah use I forgot how to call these things but uh tools to uh functions yeah to call it and uh what this example is

you use NS address and if you put uh luke. is and you get the I think uh name back I think H this is bug because address should be theem address not the look yeah never mind uh and also as I mentioned you can not only set the address but you can also say uh different coin types um so coin types is slightly different from chain ID which people are familiar with in theum community the coin types is uh more initially created to express the address format for the different like coins and and they started from I think to create the wallet so the coin type

zero is actually BTC and so you can start coin type which is defined in a place called slip 44 or we also Define that way because all the evm chains don't not necessarily have a same address format as ethereum so they don't have the register in uh slip 44 we have a way to kind of convert evm chain chain ID to coin type so if you are in a Cutting Edge chains which you know specifi you can actually derive the coin type and uh yeah this is if if anyone's actually going to integrate uh the latest trend is again I think there are many kind evm chains of Layer Two And as you might know like e ens is in in the

uh main net only so it might you might think like okay I can't resolve name on the my favorite chain but actually something like wagi each function can can decide which chain to connect so like in this case it's only when you look up the ens address it's you can actually specify chain ID one and there's something uh for about all AUD your main connection it can be somewhere else so that this is one thing you might want to uh take into consideration and I think if you want to use my Alis Po and Charlie subnames that's for the seia uh chain ID does anyone know seia chain

ID look up but you you would know okay and this is for using the yeah uh text record but we I we created as especially for ens avat and ens name and okay so yeah so this is subset of uh text record where you can actually get the name and Avatar and the more generic one is yeah there's one called use enss text where you can Define your own uh key and value okay and uh there are some preset uh data types so if we want to use kind of ens as a data storage for ha it's expensive to do in main but you can do it on the

sepolia for the hackers stuff this could be handy kind of quick dictionary you can put your identity information okay and uh issuing subnames uh for is issuing this uh arti mobile Char I actually went to the ens website and they just did a quick subname but there's actually more different actually mainly three ways to issue subnames and sub some of them are actually uh gas free so if you actually want to to issue subnames in main uh main net and if you worri about paying for the gas you could use uh one of the things called offchain resolver and

there's a a sample repple so you can actually just Fork this and then start building on it I and I think this one also use Sor so it has some decent design and uh one stuff interest thing is like yeah you once you interacted with uh ens H you may want to get more especially like subnames you may want to get uh information and the list as a transaction when in a transaction history you might want to I sorry uh for list of like a uh text or list of subnames these are not something you can actually call the enss function and they

get return return so so something like that you might want to uh look for fetch a data from subname which we have and so reading is good but to read the data you actually have to write it uh if you just want to do sample data you can just do from our ens manager but if you want to program itally do it uh there's a couple ways we have our own uh and I think for the writing the record most uh tools I introduced doesn't actually support so we you might want to either use enjs or uh like probably what OB part is ens is just bunch of smart contract so you can actually include a

smart contract through a mpm module and uh just interact with the enss Contra directly and just basic architecture is I mention I often mention is ens is a very simplified dictionary but the main difference is dictionary is usually just have one thing with key and value but in our case we have something called resol where uh key when you look up for m is uh in under the food rather than rning the ism address from the registry contract it actually return soal resol contract and resol contract is the one which usually

contains uh the actual record and the reason we do it is like by Swit you can actually customize and you can write your own resol or if you want to upgrade to the new version of the resolver comes in you people can up switch the new one p name and uh yeah so this is a basic structure and one terminology you want to be aware is that we don't just store ens name as a string uh we actually hash it but not just hashing it we if you hash the enti thing you cannot derive each like subnames from the parent so we actually have something called name hash

which kind of hash in the label recursively so that you can I I think uh yeah you can if you know the parent domain name and if you know the label uh yeah you can kind of SE separate these things U and this is just example and again uh all the detail is in this uh docs and but like I'll be around uh yeah today and so if you have any questions uh feel free to say hi and just ask questions and they get my uh pop uh but nft budges uh thank you very [Applause] much