---
# System prepended metadata

title: Kurate Handover Document
tags: [Kurate]

---

###### tags: `Kurate`

# Kurate Handover Document

## 1. Project Overview

- **Project Name**: Kurate
- **Link**: http://kurate.vercel.app
- **Github**: https://github.com/logos-innovation-lab/Kurate
- **Description**: Anonymous social network using zero knowledge protocols.
- **Project Objective**: Kurate introduces new dynamics for well-informed private interactions and curating content collectively. As such, it showcases an inclusive, collaborative alternative to the web2 social media/influencers model. We also see Kurate as a first step towards building a private and curated marketplace.

- **Key Features**: 
Anonymous Group Signalling
Private reputation
RLN
## 2. Roles and Responsibilities

- **Team Structure**: _The roles within the project and the individuals currently holding those roles._
- **Responsibilities**: _A breakdown of each role's responsibilities and duties._

## 3. Technical Specifications
### **Technology Stack**
The projects consists of 3 different components:
#### [`packages/ui`](https://github.com/logos-innovation-lab/Kurate/tree/main/packages/ui)
- Written in [Svelte](https://svelte.dev/)
- The UI has a number of `stores` which contains all the data that are shown to the user. These are observables so when they change the UI gets re-rendered.
- The UI uses adapter design pattern - all user interactions are done with through an `adapter` and the adapter directly manipulates the UI `stores`. Currently the UI has 3 adapters:
    - `firebase` adapter connects to a firestore instance and does everything in this centralised database. It is used for prototyping and testing the app.
    - `zkitter` adapter interacts with the smart contracts and relayer. The intension of this adapter is to demonstrate how the app can be build in decentralised fashion. The `zkitter` adapter uses [`zkitter-js`](https://github.com/zkitter/zkitter-js) which abstracts the interaction with `semaphore protocol`, `waku` and `zk-kit`. 
    - `zkitter-god-mode` adapter inherigts from `zkitter` adapter and removes the `REP` and `GO` token requirements to interact with the app by keeping both of them at `infinite`. The reason for this adaptor to exist is to be able to test things without being limitted by `REP` or `GO` token balance.
#### [`packages/contracts`](https://github.com/logos-innovation-lab/Kurate/tree/main/packages/contracts)
- Uses [`semaphore protocol`](https://semaphore.appliedzkp.org/) to create groups of anynomous identities. It also uses [`unirep`](https://unirep.io/) for the `REP` token.
#### [`packages/relayer`](https://github.com/logos-innovation-lab/Kurate/tree/main/packages/relayer)
- The relayer service relays some of the user interaction so that their identities can not be linked to an ETH address that makes the transactions
- The relayer also seal the epochs - this resets the GO balance for all users, distributes REP rewards and publishes the promoted posts to personase.

![](https://hackmd.io/_uploads/BkVRXWKVn.jpg)

### Dependencies
- [`zkitter-js`](https://github.com/zkitter/zkitter-js) - used in the UI in `zkitter` adapter. It abstracts the interaction with `semaphore protocol`, `waku` and `zk-kit`. The original intention was to be compatible with https://www.zkitter.com/ but this effort has been abandoned due to complexity.
- [`semaphore protocol`](https://semaphore.appliedzkp.org/) - used for identities and personas (each persona is a group).
- [`unirep`](https://unirep.io/) - used for GO and REP token which are distributed after each epoch (every 8 hours).

## 4. Project Status

### Current State
The project works and can be tried in the centralised mode. You can try it on https://kurate.vercel.app/ . If it fails to load, make sure you are connected with the `firebase` adapter. You can change the adapter in [`/dev`](https://kurate.vercel.app/dev).

As of now, you can also use the `zkitter` adapter but only to read content and create identity. Voting, publishing posts or creating personas does not work. 

You can also use the `zkitter-god-mode` adapter which enables you to create persona and publish posts to it. However, interacting with other personas or chatting with users does not work.

### Pending Work
The first three are blocking and necessary for operation.

**1. Implement GO tokens**:
- ZK Circuit 
- Develop UI from design (user flow)
- Optimize GO creation time (pre-generate before it's time to disperse)

**2. UI Loading state for all blockchain interactions**
- The UI needs to show that there are two interactions when a user is participating in a Persona for the first time. For example, to submit a post (second interaction), a user must join a Persona first. Both interactions need a "loading" state in the UI, plus confirmation from the user.
- For example, a user should be asked if they would like to join a Persona. And then be asked if they'd like to submit a post.
- This regards "submit post", "start chat", "vote", "reply to post"

**3. Reputation calculation**
- The question is what is the most efficient way For the app to calculate REP through generating proofs.
- To find out a user's REP, one way to do this is the app needs to keep checking by generating proofs until it fails. For example, the proof could be "Does the user have more REP than "X". Keep asking until there's a "No".
- The code for generating proofs in this way already exists

**4. Fix joining persona in both `zkitter` adapters.**

**5. Update `zkitter-js` to use provided proofs** [#411](https://github.com/logos-innovation-lab/Kurate/issues/411)

**6. Adapter `firebase` does not have an epoch mechanism.**
- It is not difficult to create but it has not been priority.

**6. Have indication (e.g.loading screen) that action is happening (e.g. submitting a post).**
- This is not needed for firebase as stuff happens instantly but when using zkitter adapter such actions can take seconds.

**All issues in the repo:** https://github.com/logos-innovation-lab/Kurate/issues





## 5. Documentation

### User Documentation

#### Website
- available at https://kurate-expression.vercel.app/
- repo - https://github.com/logos-innovation-lab/Kurate-expression

#### FAQ
- available at https://kurate-faq.vercel.app/
- repo - https://github.com/logos-innovation-lab/kurate-faq

### Technical Documentation

#### How to run the stack locally
latest version available [here](https://github.com/logos-innovation-lab/Kurate#for-developers)
##### 0. Install all dependencies
```sh
pnpm i
```

##### 1. Start blockchain and deploy contracts
```sh
cd packages/contracts
```

```sh
pnpm start:blockchain
```

In another terminal window, compile, deploy the contracts
```
pnpm start
```

If successfully, the output should say:
```
GlobalAnonymousFeedContract contract has been deployed
Don't forget to set the variables for both the UI and relayer
PUBLIC_GLOBAL_ANONYMOUS_FEED_ADDRESS=0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0
PUBLIC_PROVIDER=http://localhost:8545
Relayer only
PRIVATE_KEY=...
UI only
PUBLIC_RELAYER_URL=...
```

##### 2. Start relayer
```sh
cd packages/contracts
```
Set the environment variables according to the contract deployment (for private key you can use any hardhat key). Should be:
```sh
PUBLIC_GLOBAL_ANONYMOUS_FEED_ADDRESS=0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0
PUBLIC_PROVIDER=http://localhost:8545
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
```

Build and start the relayer
```
pnpm build
pnpm start
```

##### 3. Start UI
```sh
cd packages/ui
```

Set the environment variables according to the contract deployment and where the relayer lives: Should be: 
```sh
PUBLIC_GLOBAL_ANONYMOUS_FEED_ADDRESS=0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0
PUBLIC_PROVIDER=http://localhost:8545
PUBLIC_RELAYER_URL=http://localhost:3000
```

Start the UI with
```sh
pnpm dev
```

You can now open the app at http://localhost:5173/ . Just make sure you are using either the `zkitter` or the `zkitter-god-node` adapter. You can configure those in `/dev` route (http://localhost:5173/dev)

## 6. Future Roadmap

Kurate was build as a 6 month innovation prototype. Next step is attracting a community that can further develop Kurate.

## 7. Points of Contact

- **Internal**: 
- **External**: 