Turning Assets Into Agents With ERC-6551 | Jayden Windle - Future Primitive
ETHDenver 2024 · February 2024 · 20:13
Token-bound accounts built on ERC-6551 are the subject of this ETHDenver 2024 talk, which explores how the standard lets NFTs themselves hold assets and act as wallets. It walks through turning static NFTs into agents capable of owning other tokens, executing transactions, and accumulating on-chain history, reframing what an NFT can represent beyond a single collectible asset.
Speakers
Topics
From ETHDenver 2024, hosted by ETH Denver.
Transcript
[Music] thanks you all for being here this is a talk called Turning assets into agents with ERC 6551 we're going to talk a little bit about what assets are what agents are why they're important and how ERC 6551 interacts with that so I'm Jaden I'm the CTO of Future Primitive where we've been building ERC 6551 and tooling on top of it for the better part of a year one of the co-authors of the standard and spent basically all my time working on this for the last little while so excited to share what we've been working on now how many of you own one of these or owned one of these in the past any hands yeah okay a few right this is a feature phone they were great you know you could make calls um you could do texts you could like uh they
had some features that the manufacturer included you could play Snake you know you might have a calculator or a calendar they're kind of like a landline but better you could bring it with you um how many of you have one of these in your pocket right now a feature phone anyone no I didn't think so you probably have something like this in your pocket you have a smartphone in your pocket and smartphones were just infinitely better than feature phones they brought a bunch of new features that really just changed how we interact with the world around us you got internet access so you weren't just limited by calling and texting your friends and family you could interact with all of the information out there on the internet and instead of just being left with the features that the manufacturer created for you you now have this whole ecosystem of third party
apps anybody who had an idea could build it for your device we just saw this proliferation of what you could do with a smartphone and it was a whole new way of interacting right it wasn't just buttons on a keypad it was Taps and swipes and pinch and zoom a new way of interacting with the device that just brought a whole new way of using it um it was just fundamentally better now if feature phones were the past and smartphones are the present what might be coming next what's the next big leap in interacting with the Internet or interacting with the world around us I think we're starting to see some really interesting signs I don't know if any of you have played with any of these this is the Humane AI pin the rabbit R1 uh device AI device and chat gpt's voice
interface these are really cool you can just talk to or interact with these devices and they're kind of like agents they do things on their own you ask chat GPT something it just tells you it doesn't make you go click a button to do something it gives you the information need you tell the Humane pin to take a photo and it just does you tell rabbit to book you flights and it just does all on its own and they adapt to their environment right it's not programming individual button clicks and presses it's you know it will go and find the site and book the flights for you and you're not interacting with Taps and swipes anymore you're interacting at the level of voice and ideas it's a new way of interacting with devices a new way of interacting with the world around us and
you can see kind of the tech tree progression here right you start with an object that has some utility it just generally makes life better as more convenient than what we had before and then you add programmability you let people build applications for it and you just have this Cambrian explosion of what you can do with it and then you let it start doing things on its own you give it agency so that it can take actions for you this is kind of the natural progression of things over time now what does any of this have to do with nfts um we're at a crypto conference we're talking about nft standards at the base level nfts are internet native objects they're just like the objects we interact with in the world around us every day and you know they're great you can own them you can transfer
them those are the two things that are standardized in ERC 721 they might have some utility that the creator of the nft is defined for you for example crypto kitties you could breed them that's super cool and it's just better than a database it's better than your data being in you know Facebook's database you own it with your own private Keys it's an object you own but nfts are kind of in their feature phone era you're still locked into the utility that a Creator provides you there's not many applications beyond that um and what about programmability what about the ability to extend an nft with new ways of doing things what about agency what about the ability to act on its own or interact with the world on its own we don't really have that and you know it was never was never part of the standard
or the original design of nfts and about a year ago we started we've been spent our whole company's Lifetime Building crazy experim Al nft applications and we realized that there's a really neat way you can enable both programmability and agency for nfts last year Ed Denver we launched ERC 6551 and we introduced the world to the concept of a token bound account this means that every nft has its very own wallet and that goes for existing nfts like crypto kitties and the nft collection that launches tomorrow as soon as an nft exists it comes with a unique wallet a unique identity this means every nft can own assets eth ER c20s 115s anything that can be owned by an ethereum wallet your
nft can own too it also means your nft can execute transactions any dap or protocol that you as a user interact with your nft can now interact with as well this allows your nft to create its own history its own identity its own agency it can act as its own being now for the technical folks in the house this is how it works under the hood ERC 6551 defines a registry contract this cont contract is unowned it's non upgradable and it's deployed to the same address on every ethereum chain um this registry reserves address space for nfts it ensures that every single nft has a unique address assigned to it and anyone can create the smart contract at that address by calling into the
registry providing some information including the chain id address and token ID of the nft this means that every nft inherits those capabilities and how does it bind an account to an nft it actually embeds that data into the bite code so that permanently on the blockchain the nature of that account has the nft data in it this means that any application your account interacts with knows it's a TBA interacting with it and it knows which nft is taking the actions this opens up a bunch of possibilities for you to build really cool applications with nfts and we spent the past year or so working on developer tooling and uis and just things to make it easier to build with 6551 you don't have to worry about bite code structures you can just work with a
really nice SDK and a really nice UI now let me do a quick demo of how this works if you go to token b.org you can play with your token bound accounts for your nft so this is an nft I own let's see if I can get the demo to work here there we go this is an nfti own and this is its token bound account address if I go to openc I can paste in that address and I can see the contents of this ethereum wallet now openc has no idea this is an nft it just just knows this is an ethereum wallet and it owns some assets so it just works with anything on ethereum that works with accounts which is pretty much anything but because it's a wallet I can connect to openc as my nft and execute any action on openc so I just went to wallet
connect and you'll see It'll prompt me to sign with the holder wallet of that nft so I sign on behalf of my nft and now I'm using openc as an nft you can see that I'm I can go and I can list this nft right any action I can take in the DAP I can now take as my nft so I can go and I can list it for sale I put in all the details and it'll prompt me to do this transaction this is really cool this means nfts can just participate in ethereum like everybody else can same with something like Unis swap if I take the my token bound account and I go to Unis swap I can connect my wallet and this will let me swap ethereum that is stored in my token B account just the same as I would if I
was a normal ethereum user token bound accounts are a medium for turning nfts into ethereum users into agents and this enables tons of possibilities for developers who want to let nfts do more things it also opens up a ton of possibilities for you as an nft owner there's no code here right you're just doing normal ethereum transactions but you're doing it as your nft if you're a developer and you want to start working with this we have an SDK it's just as simple as pulling in VM or wag me or anything else it's one call to get the token bound account of an nft it's another to execute transactions from it just the same way you're used to if you were interacting with a wallet now there's still some unsolved problems
with this um if we go back to the feature phone example when I want to go from the US to Canada I can just bring my phone with me it just works right I might have to pay some data for roaming I might have to get a calling card or a SIM card but by and large I just bring my phone with me it's not quite the same for nfts nfts are by Nature single chain assets they live on one ethereum chain so if I want to bring it to another chain with me or do something with my nft on another chain I have to interact with the bridge which costs gas money I have to worry about finality and Bridge risk um it messes with the provenance of the nft because it's not just as simple as me bringing my nft with me if I'm
going to bridge an nft if the nft has native Integrations with a bridge which is usually only newer nfts I can burn the nft and mint a clone on the Chain I want to use so I would burn the nft on Main net mint a clone of the nft on polygon and then go about my business use my nft and if I wanted to bring it back I would get the nft remitted back to me but what about all of those nfts that predate Bridge Integrations in that case you're putting your very valuable asset into a bridge contract with everybody else's nft that bridge ever gets hacked your asset is gone and then you're minting a clone on the layer 2 Chain as you get into the situation where you're tracking which clone is the real one where is the NFD actually live if it's not on the origin chain because
the origin nftd still exists but now you've got a clone if you bridge it two or three times it's hard to keep track of where it is what if instead of moving your nft from chain to chain your nft just had an identity that lived across every chain at the same time what if your nft was just like a wallet where you can use your metamask wallet on any chain you want to what if your nft was the same that's what we've done with token bound accounts if I own a noun on ethereum and I have the token bound account 0x123 that same token bound account exists on any ethereum chain at the same address and I can use it just like a normal wallet so if I want to play a game on polygon or you know trade meme coins on bass my nft can own those
tokens on base without the nft ever having to change chains if I wanted to own a lens handle on polygon same thing all the daps you integrate with as a wallet you can use as your nft now we launched this about a year ago we've been working really steadily on improving Bridge support and right now we have support for ethereum to polygon and ethereum to op stack chains which is nice but in a lot of cases you actually want to go from destination chains from layer twos like polygon back to ethereum and we don't support that right now but really excited to announce that we're partnering with layer zero to make token bound accounts work on any chain supported by layer Zero by default this means that your nft on ethereum can just use any chain it wants to anytime you use the token bound site
or the token bound SDK all you're doing is specifying which chain you want to execute the transaction on and all the details about how that works happen under the hood so if you're a user you don't have to worry about interacting with the bridges or which changes my nft exist on you just worry about doing things as your nft so if I want to do a transaction on ethereum uh or sorry on Linea my token B account would call from ethereum to Linea and then the receiving contract on Linea will know that it comes from 0x123 my token bound account the receiving contract on Linea knows which nft is calling into it and knows that whoever initiated that call must own the nft this also works for Destination chain so polygon can execute transactions on blast or if you wanted
to go from any other chain to any other chain your nft no matter which chain it lives on can execute actions on any other chain now this is going to be live in the next little bit in March if you're at the hackathon and want to play around with this please come see me we'd love to get you hooked up with it we're going to do an announcement in the next couple of days uh about this specifically and some docs for it um there's still a couple of things that are missing here though it's still we're still maintaining a list of trusted Bridges which is not great we want to get this fully decentralized uh right now we're we're Whit listing Bridges one at a time it also means that every time you want to do a transaction you get a transaction popup you have to click that
sign transaction or submit transaction button um and it also means it only sports nfts right this kind of part of token bound accounts so far is it's nft native your nft has an account but what if we want to move Beyond those limitations we're working on V4 of the token bound protocol right now and there's a couple of really key improvements the first is we're going to be integrating layer zero natively into the token bound account this means no more centralized white list of bridges that we manage this means you as the nft owner get to bring your own Bridge you get to choose your security model choose the way you want messages fed from your origin chain of your nft to destination chains um this means that it's fully decentralized you don't have to rely on us to maintain this you as the nft owner
have full control over it if you picture the idea that I was saying before of Agents right of interacting with things like Humane or the rabbit R1 you just kind of ask it to do something and it does it and tbas right now aren't really like that if I went to my TBA and said hey can you collect the most popular zor nfts from this week my nft has no idea to how to inter that right it just knows how to interpret transaction dat and even if it did know how to interpret it it would still ask me to sign a bunch of messages I would get a bunch of popups every time it wants to do an onchain transaction I get a transaction popup and I have to sign it it requires the owners to approve it it requires a human in the loop and if
we're going to move into this future where it's just agents where I'm just saying what I want to do and it happens it's really difficult if I have to manually approve everything it's kind of the equivalent of a button click on a a smartphone how do we move from this to a model that's more agent like where I just say I want this thing to happen and it happens this going be a pretty big difference between token bound V3 and V4 it's a kind of a giant step we're introducing this concept of an oth extension it's a way for nft owners and nft creators to change how the token bound account interprets who can use it and where it can be used so instead of the owner having to always manually sign a transaction to say hey go and mint me this thing the nft owner can delegate an au
extension and say hey um I'm going to delegate an au extension that knows how to interpret my random requests for zor mins and is able to execute those on chain without prompting me for a signature every time and this kind of removes the human in the loop it's kind of like power of attorney it's giving access to your token bound account to a new contract now this is tied to the owner right if I'm the owner and I set an off extension and then I transfer the nft to someone else it's a blank slate for them but as long as I own the nft I have full control over the off extensions and if I'm an nft Creator I want to build a really cool game where I don't want transactions popping up every 10 seconds I can set uh Au extension in an au extension registry that works
across chains and say that hey for all of the nfts in this collection you're going to be able our game is going to be able to interact with those tbas is going to be able to manage them on behalf of the user in the game by minting this nft you trust us the nft owner uh to give this game to you and so our game logic can automatically execute things on a token bound account now you know you this means that you don't have to sign transactions every time you can just tell your nft to do things or just interact with that dap or interact with that game and things just happen but it's your nft doing the actions your nft acting as an agent which is just really different from how we interact with nfts today now of course it's all self custodial so if you the owner of the nft
don't trust the nft Creator which is kind of a common thing you can say okay I don't want to trust any of the N nft Creator off extensions I just want to manage itself s custodi that's totally fine so that's what's coming in token bound V4 we're introducing the concept of au extensions that lets you extend token bound account authentication Beyond just signing a transaction every time it lets both the nft owner and the nft Creator Define custom logic that determines who can use the token bound accounts and it's got native bridging built in so you don't have to rely on us to maintain a white list of bridges you can just choose your security model and choose how you want these transactions to go from chain to chain all while maintaining the token bound account the singular identity that exists for your
nft on every chain and maintaining the ease of use and the ease of programmability of this Paradigm now there's one more thing that's really cool with au extensions right now token M accounts are erc721 only so it's an nft that's non-fungible there's only one copy and if it's a non-fungible token it has a token bound account automatically and you can use it but one of the things we've gotten a lot of requests for is like what about erc1 55s those are nfts right kind of they can be they're semi fungible but they can be non-fungible what about my custom token type that I developed just for my game that I really want to use what about this new token standard that launched last week that's not ERC 721 Au extensions provide a solution to that problem and allow token about accounts to represent any asset on
chain using the same approach of giving a unique identity to an asset that's capable of owning assets and taking transactions this means that you can write Au extensions to support erc20 bound token bound accounts or ERC 699 bound token bound accounts or you know game Bound token bound accounts any anything you can identify with a chain ID contract address and token ID you can tie to an account now this goes a little bit beyond the ERC 6551 standard but there's some really cool possibilities here especially if you're doing kind of Novel things with nfts so if you look at it over the course of where we've B in nfts and where we're going nfts started as an asset as an object you own self custodial you can own it you can trade it that was really great it solved the
objects being stored in centralized databases it gives you an object you own and you control yourself and that led to a lot of really cool applications right token gating is a great example because you own an asset you can token gate a community or token gate access to something so you can build some applications on top of nfts but you're still pretty limited with token bound accounts and specifically with token bound accounts that are cross-chain enabled and that have auth extensions we've solved a couple of more problems we've solved the problem of nft identity across chains an nft identity that just works like you expect a wallet to work we've also solved the problem of utility the entirety of the ethereum ecosystem is now the utility of your nft you can do whatever you want just like you as a user can do anything you want in the
ethereum ecosystem nobody has to build anything for token B accounts or ERC 6551 it just works out of the box because everything in ethereum supports accounts and then if we look forward to nfts as agents so going from just objects with utility to objects that are programmable to objects that can act on their own with au extensions we have the ability to let nfts do things themselves to let nfts really be this representation of a unique identity onchain that can take its own actions and do anything it wants to even though it's still owned by a user and the amount of ways that that can be integrated into our experiences on chain applications on chain how we interact with the ethereum ecosystem are hopefully as Limitless as the smartphone
was compared to the feature phone you can do anything you want to with an nft now and it's really easy to integrate with so that's a quick history of what we've been building with 6551 we've been building with token B accounts and what's coming down the pipe um if you are interested in chatting about any of this or building with any of the tools or working on 6551 of the hackathon our team is all in these Blue Jackets you can come find us we'd be happy to help you integrate with it and we're really excited for this we're really excited to partner with layer zero to bring nft token bound accounts across chain and we're really excited for all the chains all the changes coming forth in the future so I have to leave you with one thing I think agents are the future I
think this experience of interacting with agents is going to be really cool and hopefully token M accounts can help with that thanks yall for coming