Inspiration

There is no good way to show the community's thoughts and opinions about a company or protocol. In the case of most off-chain governance protocols, users must use their own wallet address which reveals their identity, and can lead to potential privacy issues in the long run. In addition, off-chain web2 social media platforms like reddit not only have this issue of pseudonymity as opposed to full anonymity, but also rely solely on the upvote system to display the overall feeling of the community, oftentimes leaving out the posts that don't get a lot of attention because of possible unconscious biases from users.

What it does

Sentiment is an off-chain governance alternative solution that tries to address both of these issues.

  1. This protocol attempts to solve the privacy issue using Merkle Tree inclusion to allow users to post messages from a different account. This leads to full anonymity since no post can be tracked to a specific user.
  2. This protocol attempts to solve the lack of community 'sentiment' by utilzing AI to summarize what the community is feeling based off of all of the posts.

How I built it

I used circom to create the zkSnarks that verifies the proof on the backend. If you are familiar with Tornado Cash, the circuits are pretty similar with some small differences that are specific to the Poseidon hash. Poseidon hash is a cheaper alternative to the MimC which is why I chose to use this route. This proof verification is to verify that the users are inside of the merkle tree. An off-chain merkle tree implemented by javascript is also used on a server to generate the proof. The Emoji contract is an NFT contract that is used to mint different types of Emoji NFTs when the main contract is deployed. The Sentiment Contract is the main contract.

Challenges I ran into

Using the poseidon hash for the merkle tree was giving me some errors as I had to modify some of the circuits as well as the solidity code to include the poseidon hash. I also had troubles decoding my return value from functions in my contract. I eventually had to figure out how to split the strings, since I realized that Chainlink sends an abiencodePacked version of bytes instead of the abi encode, which cannot be directly decoded into different strings.

What's next for Sentiment

  1. Create a better UI experience. Develop frontend as well as add Account Abstraction so users do not have to create a new wallet everytime they want to post. (It should automatically do it).
  2. Optimize gas in solidity, and allow functions to occur automatically on every new message added.
  3. Configure with the best LLM for this project.
  4. Create auto-generating tables using SxT API so users can automatically navigate to a page with a new database initialized.

Built With

Share this project:

Updates