Use natural language to send tokens in your discord server. Send to discord users, ENS names, or 0x.
This project combines the discord user interface that people are already familiar with, with an in-chat ai wallet that you can interact with using natural language.
Every discord user id is converted into a counter-factual Safe (multi-sig) which each discord user in your server can operate via commands.
Just type "/do" and then describe what you would like to do and the ai wallet will attempt to do it.
Operations that require confirmation will display a summary of the action that will be taken and buttons to confirm the action.
An LLM parses what you describe and attempts to match it against a set of possible tasks it is able to do.
If you are unsure of what you can do, ask for help from the bot and it will list what it is capable of.
The ai wallet can be installed on any discord server and configured for any ERC20 token that the server would like to make available to their users.
The idea is to make it easy for anyone interact with the server tokens but also to bring the interaction where the conversation is. You can have a discussion within your server about a task and its completion and, upon completion, send the other person some tokens without ever leaving discord.
This also works in the discord mobile app.
The user's Safe is operated via the ai wallet's server through a module. If the user would like to take control of their account, they can always use the "/add-owner" command to specify the 0x address of an EOA to be added as a signer to their Safe. From here, they can always disable the module and completely take over the Safe if they want.
Note: we started from our discord bot boilerplate and transformed it to process/parse commands through an LLM. we use our existing 4337 infrastructure to process the transactions.
The project uses discord.js to build the discord interactions needed to receive user inputs and respond.
For account abstraction we use the citizen wallet community server. The communities available are on Celo and Gnosis. The ai wallet does not care about chains, this is abstracted away. No contracts needed to be deployed, we just operate existing ERC20 tokens.
For the counter-factual discord user accounts, we use a similar concept to NFC Wallet where the discord user id is used as the salt to generate a Safe. This allows every single discord user to have a Safe without needing to spend gas to deploy it. Users can receive and it is only when they send that it is deployed. There is not risk of the address being taken by another deployment as these are scoped.
Something of note: we defined the available commands as tasks with specific arguments in a way that could be provided as context for a prompt to an LLM. The LLM is asked to follow the JSON structure of the task it has identified and to try and figure out the arguments. If it is able to do this and figure out all the arguments, it executes one of the commands that matches the task.
We used openai's api.