Autonomous OnChain Agents with erc6551
ETHCC 7 · 10 Jul 2024 · 15:47
Audrey Akwenye, CTO of Spartan Labs, explains how NFTs could act as autonomous onchain AI agents using ERC-6551 token-bound accounts, which tie a smart account to ERC-721 ownership. She says this lets AI builders sell or trade an agent with its logic attached. Examples include AgentFi with modular NFT add-ons, Scroller, which uses a machine learning model to time bridging to Scroll, and Parallel Colony. She acknowledges most agent AI still runs offchain and says limiting agent permissions guards against misuse.
Speakers
Topics
From ETHCC 7, hosted by Ethereum France.
Transcript
This train up change. That's good. Hello everybody. My name is Audrey Taylor Quigner and I am the CTO at Spartan Labs. And today I want to talk to you guys about AI-powered on-chain agent NFTs. Before I do, just a little bit about Spartan Labs. We are a venture studio and RD lab for Spartan Group.
Spartan Group has three arms, which is Spartan Capital, Spartan Advisory, and then us at Spartan Labs. We work with the most early state, earliest of stages founders, building just like innovative and transformational Web3 products. And it just so happens that majority of the projects that we are working on right now are at the intersection of AI and Web3. Alright, so now let's talk about on-chain autonomous AI-powered agents.
But before we do, kind of talking about like this rise of this term like AI agents, because if you um it just seems like it came out of nowhere. Before we were talking about AI assistants or maybe AI chatbots, um, but now um there's a push in the web too as well as Web3 Space about AI agents. And the way that I think about it is like if you look at an AI model, if an AI model is very powerful, but it's kind of like a brain inside of uh it's just a brain. It can do predictions, it can do analysis, it can make decision making, it can generate an email for you, generate an image.
Um, but without like uh combining it with software, it really can't do anything. It can write an email for you, but it can't send that email to your boss. Um, so now with AI agents, AI agents is basically creating the software entity that works that's powered by the AI that's generated in order to create you know, tasks and interact with the world around it, interact with humans, interact with other AI agents as well. Um so when we talk about on-chain AI agents, I think it's very important that if we have these AI agents that will be able to autonomous autonomously take actions on our behalf, like sending a bank transfer, sending an email to your boss, um, adding someone to your calendar.
Um, I I think that it's important that we think about putting that that uh these intentions and these actions on-chain. Um the same way that we look at like how cryptocurrency has allowed for two parties to be able to transact with each other without needing a trusted third party like a bank or a Western Union. I think that over that it's very important that we also look at AI in the same way and find ways to interact with AI and for like human to human human to AI interactions as well as AI to AI interactions, figuring out a way to make that work in a trustless environment as well. We don't want Google to determine what bank payments we make or things like that.
So this is why on-chain agents make sense. Okay, so there are many different ways that you can kind of implement autonomous agents or AI-powered agents. Some examples is like there's autonomous safe smart contracts that have their multi-agent system that does really well with creating uh agents that can implement DeFi strategies and things of this nature. You also have like modular accounts like ERC 7579 or ERC6900, which are modular accounts with plugins, which allows for you to programmatically to programmatically control a smart account. And in this way you can also use that to create AI powered agents.
But this is the NFT and Culture Track. So what we're talking about, oh so here's an example of uh autonomous. They have this baby gen, baby DGIN, which is AI powered trading agent, which I love. It allows for you to create this um this agent, and then the AI pulls in data about the networks and social media conditions, etc., and it uses uh it to um trend uh to trade tokens on your behalf. Okay, but we're NFT and culture, so um why not?
What if an agent can be an NFT? And so this is something that at Spartan Labs we've been exploring a lot over the last six to nine months, especially with the rise of this new um token standard called ERC 6551, which is a token-bound account. Um any raise your hand if anyone knows about ERC 6551. Yeah, a few people. Okay, cool. So um the cool thing about ERC 6551 or token-bound accounts is that it basically connects the ownership of a smart account to uh the ownership of a ERC 721 token. So if you transfer the ownership of the 721 token, you transfer ownership of the wallet itself and all of the um assets that are within that wallet.
Um, so the reason why this is very uh we think this is very interesting to implement in the context of um of um uh on-chain agents or autonomous agents. The first thing is that because of the way the ERC 6551 works, it's based on uh it's launched the token smart accounts are launched based on an implementation registry. So if you are AI um builder or creator, you can create this implementation that has specific functionality for the smart accounts, and then every time the ERC 721 is minted, the wallet that's attached to the ERC 721 also has this underlying functionality. Um the second thing about this that we find very interesting is that you now have the wallet attached to an NFT, then this agent the token bound account becomes a distribution mechanism and a monetization strategy for AI builders because you can build an ERC 721, you can sell it, you can trade it, and then all of the functionality and logic that you've put into the smart account contract goes with the selling or trading of the ERC 721 token.
So some examples of how this like works in practice. The first one is AgentFi, which is a project that we support at Spartan Labs. With AgentFi, there is a Genesis token, which is a token bound account, and then there's all a lot of smaller NFT modules that have specific functionality attached to them. These functionality can be a DCAing, rebalancing of liquidity pools, it could be on-chain quest implementations, etc. So as the user or the owner of the token bound account adds these modules inside their token bound account, it actually changes the functionality and and the way that the token bound account acts.
And in that way, you can automate a lot of DeFi strategies. Another project which was kind of like a proof of concept that we created within Spartan Labs is called Scroller. Scroller is an NFT, a token bound account that bridges East from Ethereum Mainnet to scroll LT. And it's powered by a machine learning model that analyz that analyzes gas prices and predicts the most optimal time to actually do the bridge in order to ensure cost savings for the user during that transaction. Another kind of gaming focused implementation is Parallel Colony.
And the each player in the game is actually a token bound account, and it's attached to an AI that is self-learning. So as the player, this agent in the game interacts with other agents and their environment, they're able to learn how to survive and how to grow within the colony. And then the agents initiate transactions to buy, sell resources or to build you know things, buildings or houses. So all of this is done on-chain, and it's um the player, the user just trains their agent, and then the agent actually is the one that interacts with the game and makes decisions throughout the game.
Some of them being the fact that right now most of the AI that powers on-chain agents is actually done off-chain. And there's some discussion about you know why having on-chain agents if you um or or on-chain autonomous agents, if actual logic that powers them is off-chain. So I agree. I I believe that um we hopefully are getting closer to decentralized AI where we are training and interacting with AI on chain using something like maybe ZKML or uh or putting weights and biases for small um um language models on chain but I believe that the first step to this um on chain agents is allowing for us to at least have the actions and the decision making um be on chain so that we have some sort of verifiable ledger of what the AI is doing and how we can control and put guardrails for the AI as well.
Awesome that is my talk I guess I have time for um any questions about ERC 6551 or what on-chain agents mean um this is uh my context if you guys have any if you want to reach out via telegram or WAPCAS. Any questions cool hi uh I'm Hani uh thanks for the talk. So I'm I'm curious like what do you think is the best wallet solutions or private solutions, private key solutions for the AI agents uh currently or what do you envision it will be in the future? Sorry.
Yeah no go ahead. No like uh if it's like if you're running the agent locally, I guess you can just you know encrypt the private key locally and use it in atrocity device, but let's say we're running the AI agent on chain in in some cloud infrastructure, like how do you envision the infrastructure would be for the agent? Yeah, that's a very good question. And so, like uh obviously, you know, have um having private keys in production is always going to be challenging. This is also something that like account abstraction in general um uh is a challenge. So a lot of the software or a lot of the structure or technology that we use for the agents that we build is using like AWS cloud, and then we use um you know key management and key encryption um uh software that's kind of built into AWS in order to manage the private keys, and then we also try to make it to where there is some rotation in private keys, so that if you deploy um an AI power agent, you make it to where you can remove a private key if it's being corrupted, or you can create a strategy where like once a month or uh whatever cadence you can actually rotate and put in a new private key.
So there these are some of the strategies that we use to protect um you know uh these private keys that are hosted or or stored um in production. Um yeah, so these are some examples that we do, yeah. Uh just a uh a small follow-up question to that strategy. Would that be like a centralized solution where that you kind of take custody of the private key, or it's more like agent, I call it agent uh like custodial, like private key solution? Yeah, so that's a good question.
And so I think also this is like a broader control, the broader question about like how much control does the AI builder have over the AI agents, right? So, like when we create the token-bound accounts, we try to make their them have very specific use cases and where the um our um you know off chain solutions initiate transactions but don't actually have uh too much deterministic control over the action so if it's a DCA the DCA is kind of programmed in and then the agent that in that decides oh it's time to DCA initiates the transaction but the logic of where the the DCA goes which wallet it um funds are returned to etc that is kind of pre-programmed so that we limit the control over the agent so the agent can never just like drain a wallet or if it becomes corrupted in a way it can't it it doesn't become like an attack vector for all of the token bound accounts so this strategy of just like limiting the the amount of um control the agent has to making it specific task allows for us to ensure that um we we don't have like a place where people can take control over the agent uh and do nefarious things okay thank you yeah questions cool awesome all right thanks everybody do not
Related talks
- Optimizing DeFi with ERC-4337 and AI Agents
- Sufficiently Decentralized OAuth Protocol for Both Security and Usability of Web3 | Dennis Won
- AI Agents will Empower DeFi in 2025
- Ethereum's OpenClaw Moment: Automated, Safer, and Easier to Use | Jacob - Coin Fello
- AI Agents Will Replace Dapps
- AI x Ethereum: Vibe Coding, Agents & The EIPs That Matter
- Ethereum Wallets, Security and AI Agents (Combined Recording)
- New AI asset class enabled by Optimistic Machine Learning
- Agents with Allowances: Embedded Wallet Tools for a new Economy