Coder Social home page Coder Social logo

unirep / unirep-social Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 7.0 16.83 MB

An anonymous social media platform.

Home Page: https://unirep.social

License: MIT License

TypeScript 73.93% JavaScript 11.39% Solidity 3.26% Shell 0.45% Dockerfile 0.11% HTML 0.26% SCSS 10.10% Circom 0.50%
blockchain ethereum smart-contracts social-media solidity

unirep-social's Introduction

UniRep Protocol

Github license Linter eslint Code style prettier Circle CI

UniRep

โ€‹

๐Ÿ’ก About UniRep

UniRep is a private and non-repudiable data system. Users can receive attestations from attesters, and voluntarily prove facts about their data without revealing the data itself. Moreover, users cannot refuse to receive attestations from an attester.

๐Ÿ“˜ Documentation

Read the medium article to know more about the concept of Unirep protocol. For more information, refer to the documentation.

๐Ÿ“ฆ Project Structure

  • Package Version Description
    core NPM version Unirep protocol related functions.
    contracts NPM version Unirep smart contracts, ZKP verifiers and contract related functions.
    circuits NPM version Unirep circom circuits and circuit related functions.
    utils NPM version Utils which are used in unirep protocol.

โ€‹

๐Ÿ”‹ Requirements

๐Ÿ›  Install and test

  • Install

    yarn install
  • Build with trusted setup keys

    yarn circuits keys && yarn build

    Or build with phase 1 trusted setup circuits

    yarn build

    If you want to contribute to the circuits Please run yarn circuits buildOverwrite to update keys

  • Run test

    yarn test

๐ŸŽฏ Contributing

Contributions are always welcome! Feel free to open any issue or send a pull request. Go to CONTRIBUTING.md and CODE_OF_CONDUCT.md to learn about how to contribute to Unirep project!

๐Ÿ™Œ๐Ÿป Join our community

  • Discord server:
  • Twitter account:
  • Telegram group:

Privacy & Scaling Explorations

This project is supported by Privacy & Scaling Explorations and the Ethereum Foundation. See more projects on: https://pse.dev/projects.

unirep-social's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

unirep-social's Issues

Mobile navigation is missing

In the responsive view, the navigation was just display as burger menu,
we want to help the navigation when user is in mobile.

current:
image

expected result:
image

UI bug on "get started"

image

the border width is too large at right side

image

the progress bar is way too wide, it should be same width as the content, see expected result

image

mobile view we probably can enhance more, but above here is nice to fixed, not a deal breaker. btn position seems offset 4 px at y-axis and the progress bar went off the screen.

Cache proving keys

Right now the prover downloads the proving and verifying keys every time it verifies or proves. We need to cache these files locally to avoid excessive network requests.

[contracts] Edit post functionality

We can allow a user to edit a post by providing a proof of epoch key ownership, the old hash of the post, and the new content.

Includes a function taking an old hash + new hash + proof.

Reputation creation

Right now we give people 30 rep every epoch. Instead we could use a system where users get a 30 rep subsidy each epoch. The first 30 rep spent is covered by the system. After that it's taken out of the users rep balance. If the user doesn't spend or receive any rep in an epoch their balance is unchanged.

  • rep is only created by interactions in the system
  • people can't hoard rep by getting airdrops and never spending
  • if people create posts/comments just for exchanging rep others can vote and take rep away (vote negatively on the posts/comment for free)

This would also make the case of missing an epoch more clean. Right now if a user doesn't do a UST for an epoch they miss 30 rep for each epoch they skip.

Gas price watcher

The transaction manager has a hardcoded gas price right now. This should be changed to a value that is calculated periodically using the median gas price. Omitting the field and allowing ethers to automatically fill it caused an error for some reason.

It's probably a good idea to do this ourselves anyway so we can in the future do things like optimize away from local highs in the gas markets.

Event synchronization

The backend currently loads all events at once using a queryFilter call. This will break after a few hundred events exist for a topic. I solved this problem in zkopru by starting at the block where the contract was created (or the block of the latest event in the DB) and then loading events for a batch of 1000 blocks, then ingesting, then repeat. Once I reach the head block I start a subscription listener. You can see it here. I think we should use a similar strategy for this backend.

[backend] Add a route to request a username

We need a route to request a username. This could be /api/usernames POST.

  • The route should accept and verify a ZK proof proving the epoch key and current graffiti pre-image
  • The route should accept a username that is being requested

The route should then check if the username is free, and if it is use the setUsername function in the unirep social contract to claim it. The username will need to be hashed with poseidon offchain so the hash is what is submitted in the contract call.

[Fronted] Release note

As a team, we would like to inform users of what has been released in the build, so that users can learn the progress of the app.

  • probably better using CMS for this type of thing, either on wordpress or other, something simple.

Rich Text Editor: collaborate with Tsukino

As an user, I want to edit my post or comment with freely styling to make my article looks great

  • collaborate with tsukino
  • integrate to Unirep-Social and adjust the styling

Jest SyntaxError: Cannot use import statement outside a module

Describe the bug
The issue I am facing is configuring Jest to understand ESM modules. Specifically, when I test the router.js file get the error SyntaxError: Cannot use import statement outside a module. This can only happen if the configurations are off, but not sure where the problem is after trying multiple different configurations. I made a StackOverflow with the configurations and errors I have and can make a PR if anyone would know a better way to configure this.

To Reproduce
Steps to reproduce the behavior:

  1. Use current configurations for Jest and Bable shown in the StackOverflow post
  2. Run yarn test src/__tests__/router.js
  3. See error: SyntaxError: Cannot use import statement outside a module

Expected behavior
Passing test

Screenshots
Screen shot is in StackOverflow post but will show code-trace here:

Screen Shot 2022-07-11 at 9 47 57 AM

Additional context
More context can be given surrounding this issue by reading the links to the post I specified in the StackOverflow post.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.