Inspiration

The idea of a fully autonomous AI-controlled treasury captivated our imagination. We envisioned a system where AI, not humans, would have the sole discretion over the allocation of funds, paving the way for an unbiased and efficient distribution of resources. We aim to achieve the fully autonomous and secure DAO - even being the developers of this DAO, we should not be able of funding our own project until we get a "funded" response from AI, and we're not able to censor transactions to fund projects good enough from the chosen AI point of view.

What it does

Our project introduces a user-friendly interface where individuals can attempt to fund their proposal. They send NEAR tokens and a message to a smart contract. The contract adds the tokens to the treasury, and in return, the user receives a signed response from pre-trained ChatGPT, called Stephan. If the response contains "funded," the user is awarded half of the treasury's balance.

How we built it

We leveraged the security of Intel SGX. Ideally, the AI should run within it, but for this hackathon, we use ChatGPT. A simple "certifying" service is running within Intel SGX, ensuring that each response is signed within a trusted environment. These signatures are then validated by a smart contract on the NEAR blockchain, creating a secure and transparent process for AI-driven financial decisions.

A trusted environment is needed here to enhance the security - the private key is generated within TEE and cannot be extracted from it even by the software hosts. Thus, as long as we don't have access to the private key, we won't be able to produce fake results.

Challenges we ran into

The most daunting challenge was generating and validating the attestation report that connects back to Intel's root certificate, and ideally, this validation should be done within the Near smart contract. We spent a lot of time on this validation, but we were unable to implement this contract during the hackathon because it uses different elliptic curves. However, as a proof-of-concept, we have a standalone Python file validating this attestation report.

Accomplishments that we're proud of

We're proud that we were able to demonstrate the possibility of an honest AI-power DAO.

What we learned

We learned that Intel documentation is very bad and sometimes incorrect...

What's next for Quex

Still, a lot of work remains to polish this solution. Later on, we'd like to use our solution within the Near grant program, providing transparency and honesty to the community. And after that, we will build a fully autonomous investment fund driven by AI. One more idea that came to us during this hackathon is to use this technology to implement human-language smart-contracts - a user can provide instructions to AI, and the AI operates the contract tokens after that.

Useful links

Near social interface to communicate with Stephan.

Contract & transactions:

  • Transaction with the user request . No authorization here, anyone can send message if attach 0.1 Near to his request.
  • Transaction with the Stephan response. All the messages are signed (we use ed25519 here), and you can see a plain response from Stephan with "funded" message within the content field - it's exactly our condition to get funded. So the contract validates the signature, then parse the message string, and if it sees the "funded" within the context field - it sends 10% of the treasury (2.05756 Ⓝ in this case).

Code

Built With

Share this project: