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

Loading player…

Arx 🛠 Hackathon Workshop

ETHGlobalWed, Oct 9, 2024, 12:00 AM

Join Arx Team for their hackathon workshop! From November 17-19 2023, ETHGlobal is welcoming builders from around the globe to help shape the future of Ethereum at ETHGlobal Istanbul. $500,000 USD in prizes are up for grabs at the prestige ICC Istanbul Congress Center... you're not going to want to miss this! ----------------- Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

[Music] hi everybody this is Cameron from arc's research also from Kong cash you might know Kong cash because previously we dropped the first crypto cash notes that look like flexible real cash with chips on them since then we've work been working on Halo chips Halo chips look like an NFC chip but they're actually very very different most NFC chips are typically pretty insecure either they're just a link that points to something like a QR code or their security relies on a centralized backend service so you have to have that chip talk to a private API to validate that the chip is valid and of course if that company or service or whoever hosts that server goes away you can no longer validate the chip none of that is true with arc's chip chips Arc chips are completely decentralized fully composable and immutable they common a lot of different form factors and in the dev kits you should have several of them yourself including a round tab um a hanging tab chip as well as a uh kland citizen Green Card which is the card format so what exactly do I mean when I say it's uh a mutable composable decentralized well the number one thing is Arc chips generate their own signatures and these are fully compatible uh with ethereum or really most chains um and you can use them immediately to do things in smart contracts so without having to talk to some Oracle or some thirdparty service you're able to immediately take a chip that you scan in the wild completely offline validate the signature and then on chain use it to do some action in a contract um likewise they're extremely composable um you can take these signatures and you can remix them in different ways you you can use them in different Services um they're ready to be used in all sorts of dii type applications typically you'll see Kong chips embedded in things from cards to skateboards to clothing uh there's lots of different ways that you can use them for this exercise we're going to go through an overview of how to interact with the chips and some of the software tools that we buil to do that all of which are open source and then we're going to talk about how you can resolve to the chips so by that I mean when you scan a chip what does it do on chain and for that we've built something called ERS or the ethereum reality service and I'll have my colleague Brian talk about that in a little bit so let's dive in as I mentioned our chips are a lot different than other chips out there that you might find that are NFC so we're starting to call them onchain NFC um if you want to learn a little bit more about this from what I've already described take a look at our mirror where we uh Explain how other chips are effectively going to expire at some point that's not the case with Halo chips chips if we disappear go away get acquired it doesn't matter the chips keep on working independent of us the first place to get started is really in our docs here at docs. ars.org the docs explain more about the hardware level of the chips and how they work so for instance um you might want to learn about the URL structure of the chip when you tap a chip there's a very long URL here and it includes a lot of data from the chip it includes the public keys of the chip the the keys that you use to sign data with as well as in the new chips that you have a randomly generated signature that you can immediately use to get going so what I'm going to do here on my phone is go ahead and scan a chip to demo this functionality I'm going to use uh an app called NFC tools because it lets me grab the endf data from a chip really easily so I'm going to tap on a chip here great so we've pulled it up here and we see see that we have this long URL record this record contains a bunch of useful information about the Chip And I can use it to parse out um this random signature as well as the public Keys as I've just shown so that's one way to interact with a chip um we call this noninteractive mode and this generates this random challenge that I've discussed however there's another much more powerful way to interact with a chip and that's by integrating uh the lib Halo Library which I'll reference here as a second L link and the lib Halo Library lets you request signatures on demand from a browser so the really neat thing about this is uh you're able to build a full web app um think something like a friend Tech uh and have it interact with chips via NFC without the need for going into a native app and obviously that's super powerful because you don't have to get app store approvals you don't have to update native apps so for that I'm going to go ahead and demo a bulk chip scanning app so what we've done is loaded up lib Halo demos on my phone here you can see on the right side lib Halo demos is a really nice way to test out just simple signatures using a chip uh you can find it at Halo demos. ars.org lib Halo itself is a great resource to take a look at so the lib Halo repo has a lot of documentation that you're not going to find in the docs Pages specifically on how to integrate lib Halo and into all sorts of different applications like an HTML web app a react app even react native mobile apps um the neat thing about lib Halo is that you can use it across a bunch of different transports so you could even use it in a desktop command line interface using a USB scanner it's incredibly powerful so back to my phone here let's go ahead and load up the simple signing demo what's happening in this demo is we're taking a string and we're hashing that string and then having the chip sign it so we'll take this uh random string here and we'll go ahead and tap the chip Boom the chip is now taken that message and uh or sorry I should say that digest the hash of the message and gone ahead and generating a signature from it and Below you can see the ethereum formatted signature the 0x E64 the really neat thing about this is we can start to imagine signing all sorts of messages so say for instance in this simple demo instead we were to sign the message of a recipient of an nft plus uh a recent block hash and we could feed that into a contract and that contract said I know this public key and I'm going to Mint an asset to it we'll get to a practical example of that in a second but one of the things I want to show with the lib Halo demos that's really neat is how to use it uh away from your mobile phone as I mentioned earlier there's a bunch of different transports that you can use with lib Halo one of the more interesting ones is the lib Halo Gateway the lib Halo Gateway is a really powerful way to get signatures from a Halo chip onto a desktop without having a custom USB scanner so say for instance you want the user to interact through a web page yet they need to get a chip signature they can do that using the lib Halo Gateway so what we're going to do here is initiate a gateway gateway session we bring up a QR code and we'll scan that QR code from the phone what we've done now is we've created a session linking the phone and the uh desktop version through the Halo Gateway and we can confirm the request from the Halo Gateway which is to sign this message so again confirm tap the the key and boom we have the result pip through in Json for us ready to use in our dap so we've talked a lot about the nuts and bolts of getting signatures from chips why don't we look at some practical examples one of them is ERC 5791 ERC 5791 is a proposal for physical back tokens the idea is that anything embedded with a chip can be transferred on chain only through signatures generated by the chip itself so for instance if I have an isuki golden skateboard I can only transfer that thing on chain if I can tap the skateboard itself and get a a valid signature from it I can't resell it on openc but it gives a really strong link that I'm likely the holder of it because I can generate signatures from the chip you can take a look at the implementation proposal here as well as learn more at pb.

the PBT smart contracts are a great place to understand how you might look how you might enroll chips um against an asset so in this case there's a mapping of chips to a mapping a mapping of token IDs again this is one example of a contract you might come up with you could come up with a really simple nft Mentor where any signature from a chip allows you to Mint an nft you can come up with a simple wallet where a chip allows you to transfer assets uh there's all sorts of things that can be built on top of chips but it's worth mentioning the PBT because there's a lot of great code examples here in the isuki repo hey guys Brian from marks research here um Cameron gave a really great overview of our chips and how you can use them interact and interact with them using um desktop or mobile I'm going to give us an overview of the ethereum reality service um so etherum reality service serves uh two main functions first it provides a chain of custody so from manufacturer to um have the project or entity that you know creates an experience around the chips to the ultimate end end user then second it also allows us to have kind of a uh public database of all the services that are attached to a chip so these Services can can provide you know new experiences and tie new experiences to the chip so I will start walking through kind of the participants in the system as mentioned there's manufacturers which is uh arcs research is one of those um so the ones that create the chips and then they actually enroll them into the uh ethereum reality service to kind of create that first um you know step in the chain of custody then we have what are called tsms uh tsms are you know we take this from kind of mobile lingo they're trusted service managers and what they would in the system what they would do is maybe create a a project around a set of chips and they would enroll all those chips in this project and attach you know certain experiences then to that chip uh and then from there they may send that chip or sell those chips that are embedded in Goods to an end user or what we would call Chip owners so these chip owners would be you know essentially uh those that uh May purchase an item that has a chip embedded in it they are free to you know kind of use that chip uh and any experience that's tied to the chip they can obviously transfer it as well to to new holders um and then we finally have service providers and these are kind of pretty coupled with the idea of a TSM we imagine a TSM would have some of their own services that they would tie to a chip but this is ultimately an open resource so anybody can create their own services and the chip owners can decide to tie that service uh to their chip as well um so then this way we kind of you can start T you can start um add adding more and more powerful functionality to your chip uh over time to give a really brief uh architectural kind of discussion here um we have a series of Registries the ones that are probably the most important uh for your purposes are the chip registry this is essentially a big ERC 721 contract but we've modified it uh and created what we're calling pbts um and this is going to store you know a lot of the information about the chip uh that's not you know hosted in ipfs or you know placed in ipfs is going to be stored in this registry and this is how the the registry you interact with if you want to transfer the chip um things like that um the manufacturer registry this contains all the information about uh chips that are that are enrolled in the system ERS registry this is very similar to ens this is going to be just kind of a [Music] um uh essentially a chain of custody uh through these various like root names very similar to to set up very similar to how ens is set up and then finally you have this the services registry and this is where people can come and enroll their own service that links to could be uh a ipfs um hosted service it could be a centralized Service uh it could even be like a different contract address or or anything like that right um so this is kind of a highle architecture of the system and next I'll start showing you how you can actually interact with the system using our ER scripts uh repository so now that we've learned a little bit about the ERS system we are going to uh start by creating a service so a service we can ultimately tie to chips that we're going to roll uh enroll into a project in The Next Step so first we'll talk a little bit more about what a service is so a service is essentially a set of records and these records uh can really contain anything uh we have a couple special records these are um you know stuff that the system kind of uh in one way or another acknowledges so the first would be a token URI um so you can tie a token URI uh to uh a chip uh within every service there's also a token URI tied to a chip uh at kind of the that chip registry level the chip registry token URI does override anything tied to a service however if the token URI is not present uh on the chip registry then it defaults to whatever is in the service and then the second one is the content app and this is probably the more important one um when you tap a chip for the first time the um first thing that will pop up is that chips content app but ultimately we can we could make this any form of content and it's just up to the uh client uh or website to uh kind of parse and analyze that content so it could be a a smart contract address um it could be you know some centralized uh website could be an ipfs uh website those of things um and that and the the kind of the whether the the website or the contract address that would be considered the content within a record uh for that service and then you also can specify as part of that record whether you want to append the chip ID on the end and the reason we do this is there may be some things that you want uh to be unique to a chip so this could be the token URI for example or there may be some some resource that you want to share uh uniformly across all chips and in that case you don't really want to append uh an extra ID at the end this extra chip ID at the end uh you want it to just all chips to redirect to that singular uh URL or ipfs instance whatever it may be then there's also this concept of primary versus secondary Services um so the primary services so you can you can have one primary service and you can have any amount of secondary Services tied to a chip uh so that primary service when you tap the chip the content app of the of the primary service is what will pop up but you can imagine there may be clients that would also when you tap a chip can bring up a list of the secondary services that you're uh the chip is enrolled in and you could navigate to those Services via um via that client so I'll do a really quick example of how you create a service on chain um this is the ERS scripts Library I should say this is the ERS scripts Library um it's a repo of of essentially CLI um functions that can be used to interact with the the ERS protocol uh here we have a uh we're going to this is all being done on local host for now um we are uh going to enroll the service so we've named the service arcs Dev connect we have the the content here uh later on you'll get to see what that content is and then uh we've decided not to append an ID uh because we this this piece of content we want to share across all chips that end up um being attached to the service so now we'll press enter and we'll see the transaction submitted on the Chain here and now we have the service ARX Dev connect it's created on the service registry and this is the service ID um so we'll have to make note of that service ID and we will next create a project great so now that we have a service created we're ready to try to tie that service to a set of chips so the set of chips we can think of as like a project right so you know I have three chips right here one two three and these chips we're going to enroll in a project now you can Envision them being embedded in a piece of clothing perhaps uh piece of artwork that sort of thing right and now we are going to you know we're going to tie some experience to this and send it out to to end users so first thing uh to add a TSM we've actually it has to be uh done via governance uh so we've already added a TSM under which which you can enroll your own projects and we have a a separate smart contract that that manages that enrollment process um in terms of adding projects uh there are some some things you have some piece of information you have to provide um a lot of this will be abstracted away in the the scripts that that we've created but you do have to you know name your project um and this is part of going to that uh ERS registry in string of authenticity is now we'll have you know we have the name root of uh you know the TSM which would be us arcs research and then you'll have the the name of your project now appended in front of that in kind of the the chain of custody uh as um as part of this as well you'll have your own project registar that'll be that'll that that's deployed as part of interacting with with our manager contract um you'll have to create a a Merkel uh tree and hence a Merkel root uh that proves inclusion of these chips in a project and this will be done by the script itself um there's a couple other things that need to be you know created all of this is done is managed by the scripts that we have one thing I'll point out is the the ownership proof this is essentially um uh proof that the project owner um you know had custody of the chips at the time of of enrollment um you'll be signing uh this project registar address that's created the project regist is created through Thea create to so we can predict the address as part of it um or the the the address that comes out of that transaction and then we'll sign a message and that's validated in um in ers uh and then there'll be this claim data URI which is necessary to actually for the users to claim the chips right so let's pop over to ERS scripts oops or to great so now we have before um you had to you know you had all these different inputs you had to put on the the command line there's too many inputs for this so we're going to put them into a separate uh file which can be found at um in the task peram folder you'll want to copy the default file and kind of create your own inputs here we're naming our project Dev connect demo uh you'll we'll have a link to you'll you'll want to link to the chip data uh the chip data is um you'll be able to find that by going to the manufacturer uh validation data now this is uh when I enrolled the chips uh in ERS I also created a uh posted that data to ipfs so you can grab this chip data parse out the different uh pieces uh you know data fields that you need to to create an array of Chip data which you can place in this chip data location uh I'm not going to specify token URI but you can do that very easily this is the service that we created in the last um in the last step great um so now that we've gone over this file we're going to be ready to actually execute the transaction on chain um so this is actually um pretty simple you know we've now that we have the um kind of prams file setup uh in this instance I want to specify to make sure that uh the project enrollment files are posted to ipfs this makes it easy for users to then be able to actually do the the claim port portion of the or make it easy for them to claim their chip so here I'll just run this script I'm also going to need my phone for this uh in here we are going to put up a QR code and what this QR code does is it links us to the Halo Gateway which you can see here um and now I will go through and uh sign these um C proofs or ownership proofs takes two Taps usually and then now we'll go and now this is um showing that I you know currently also have custody of of one of the chips um the the custody proofs um you know in theory those could be if anybody has access to the chips they could they could create these custody proofs but this portion right here requires knowledge of um kind of certain parameters at run time um so you'd actually need uh one of the chips in your possession to be able to submit uh as part of this project there we go and great now our our project has been created um we can see that the data for the project was posted ipfs right here so if we now go to that rout here we go and now you can kind of see what um these are all the chip addresses essentially what we call Chip IDs but it's really the uh the address of the the first private key slot on the chip and here you can get all sorts of data so we have the this enrollment ID is the manufacturer enrollment um this right here is the project registar for the chip so when you go to claim the chip you actually have to call this this address right here this is all data required to to claim the chip so we have kind of like the index in the tree the service ID which we created in the last step uh here's the URI which you know is is kind of a dead uh URI right now and then we also have the Merkel proof right here um and then alongside that we also have these are kind of the so the TSM certificate is the uh chip ID signed by the T the the project public key for the the project uh or the private key associated with that project public key then the custody proof is that project public key signed by the chip right so you obviously need to custody the have custody of the chip to sign that transaction um so this allows us to uh kind of you know uh make sure that at some point the per the the person who created the project had custody of the chips great so now we have uh created a service enrolled the our chips in a project and now I'll show you how to claim one of those chips from the project so what is claiming do claiming um essentially allows you to uh kind of complete that chain of cust it's like now I own this phys this item I can claim it and and show the world that I own the item and that will be kind of etched onto the blockchain forever and then it also allows us to kind of like instantiate this primary service and like kind of officially tie it to the chip um by uh you know kind of enshrining that on chain as well additionally this allows you to start adding some of these secondary Services we we briefly mentioned before so you can start putting on you know adding different services that you want to tie to the chip whether it's some other kind of like funny meme that you want to tie to the chip or it could be you know like a ticketing service that sort of a thing right so how to claim it I think I mentioned this very briefly but you have to go through the the project registar for the project to do that um you can always find what that project registar is uh oops um you can go to the uh ipfs um post uh kind of the project enrollment files post ipfs here this is where the project registar is um and yeah so now we can go yeah back here so that's where you can find where the project registar is um again there's a whole host of data here we will be able to this script will you know grab this data from ipfs and organize it uh so that it's pretty easy to actually uh claim the chip um let's let's just go ahead and do that right now so uh you briefly saw this file I'm GNA name my chip Brian uh after myself and then we have the chip claim data location so this is what was posted in the last step ipfs then you have the manufacturer validation location location this is what was posted by the manufacturer when they first enrolled the chip um on chain great and now that we've gone over the chip claim uh input parameter file let's go ahead and claim the chip doing this on Local Host um likewise uh to uh project enrollment we will need to execute some um we'll have to first pull off the the chip ID from the chip itself uh and then we'll have to sign a message that kind of proves ownership of the of the chip kind of at runtime so to speak so when when the chip is actually uh being submitted or or when the when a message is being submitted on chain um for the chip to be claimed let's do this and we'll have another QR code pop up here my phone so now will pull the chip ID off of this and now it's posting um the project enrollment data to ipfs and now I'm I'll sign this next ownership proof to kind of close the chain of custody so to speak and Bam now we have claimed the chip uh and next I'll do a really quick uh demonstration of how the chip can be uh resolved great so now we have claimed our chip um the next thing I promise you is just a look at how to resolve the chip or really a discussion of resolution um we're running everything on Local Host so it's right now so uh we won't be able to give you the full experience um but typically what resolution inails is if you tap the chip we've uh embedded kind of a uh a en ironment or or a URL in that chip so when you tap it it'll go to that URL and in that URL uh you know we have logic at that end that then um helps resolve the chip Based on data that's been stored onchain and offchain um so I we do this resolution via EIP 3668 it's also known as ccip read essentially what happens is you tap the chip goes to the embedded URL in that embedded URL we perform a a a ccip uh read call to the chip registry uh when it does that uh we it will bubble up a revert and in that revert there will be some information and the client catches that revert pulls out the information it needs uh one of which is the location or the endpoint to call to get manufactured and um project enrollment data now what we have are these ERS gateways that are constantly indexing um any added uh manufacturer enrollments or or project enrollments um so you call out to one of these gateways the Gateway will then return the data and the client that calls out will then submit it back onto back on chain to the chip registry so essenti what we're doing here is we're calling to the the chip registry to ask it like okay what do we do and then the chip registry says okay go look for data here offchain and then that location returns some data to you and then you pass it into the chip registry which then validates the data that was stored off chain right so we don't we can't necessarily fully trust data offchain right so we need to do some sort of validation on it so um when you pass uh the turn data back into the chip register we validate it and if all the validations check out then it will resolve to the primary service um that's associated with the chip in this case since we've claimed the chip that whole thing doesn't even happen all we do is tap the chip it's the chip register recognizes it is claimed and just spits you right out to the primary service if the chip had just been enrolled uh in the project but hadn't been claimed then that whole you know call back flow would happen but it would still spit you back to kind of this this primary service um but it's not going to you know it'll be a little bit it'll be a little bit longer uh and you because you wouldn't have claimed the chip and then if if the chip hasn't been enrolled in any project at all uh it would spit you out to What's called the manufacturer bootloader app and this may just be an app that um you know can be used to if you're a project to enroll chips however it may be however the manufacturer of the chip wants to set it up but the idea is if the chip is enrolled in ERS if you tap it it will always resolve and so here's a a sample of that we've claimed this chip this is so the chip that we claimed this is that URL uh that Cameron referenced in in the first video and now that we've gone through everything and claimed it we can uh resolve to this URL which will then go Happy

Automatic transcript — names and jargon may be misspelled.