Unirep
  • 👏Welcome
  • 🧩Introduction
  • 🎮Getting Started
    • Install & build 🛠
    • Start with cli commands 🔌
      • 0. Install and build
      • 1. Spin up the testing chain
      • 2. Deploy Unirep contract
      • 3. User generates semaphore identity
      • 4. User signs up
      • 5. Attester signs up
      • 6. User generates epoch key and epoch key proof
      • 7. Attesters/Users verify epoch key proof
      • 8. Submit epoch key proof to Unirep smart contract
      • 9. Attester attest to epoch key
      • 10. Epoch transition
      • 11. User state transition
      • 12. User generates reputation proof
      • 13. Attesters/ Users verify the reputation proof
      • 14. User generates sign up proof
      • 15. Attesters/ Users verify the sign up proof
    • Start with Typescript 📠
      • 0. Install packages
      • 1. deploy
      • 2. User signs up
      • 3. Attester signs up
      • 4. Epoch key proof
      • 5. Attest
      • 6. Epoch transition
      • 7. User state transition
      • 8. Reputation proof
    • Computation happens off-chain ℹ️
  • ☀️Protocol
    • Glossary
      • Users and Attesters
      • Epoch
      • Epoch Key
      • Reputation
      • Trees
      • Nullifiers
      • Epoch Transition
      • User State Transition
    • Circuits
      • Epoch Key Proof
      • Reputation Proof
      • User Sign Up Proof
      • User State Transition Proof
    • Contract
      • Sign up
      • Attestations
      • Epoch transition
      • User state transition
      • Verify proofs
  • 🌈Package usage
    • @unirep/crypto
    • @unirep/circuits
    • @unirep/contracts
    • @unirep/core
    • @unirep/subgraph
    • cli
      • Deploy Unirep Contract
      • User Identity
      • User Sign Up
      • Epoch Key And Proof
      • Attestation
      • Epoch transition
      • User state transition
      • Reputation Proof
      • Airdrop Reputation
      • Spend Reputation
  • 🌻Applications
    • Unirep Social
Powered by GitBook
On this page
  • Public inputs
  • Private inputs
  • Contraints
  • 1. Check if user exists in the Global State Tree and verify epoch key
  • 2. Check if the reputation given by the attester is in the user state tree

Was this helpful?

Edit on GitHub
  1. Protocol
  2. Circuits

User Sign Up Proof

The zero-knowledge circuit of user sign up proof in UniRep

PreviousReputation ProofNextUser State Transition Proof

Last updated 2 years ago

Was this helpful?

The user sign up proof is used to indicate if the user has a valid membership from an attester. Attesters can send a with a signUp flag to authenticate the user. Once the attester has signed the user up, the sign up flag will not be changed (in the current version).

In the current version, the user sign up proof is used to give users the reputation airdrop. Once the users are authenticated by an attester, the user can get the airdrop from the attester. Then the users also need epoch keys to receive reputation from the attester.

The idea of the user sign up proof (or called the airdrop proof) is to prevent the same user from obtaining airdrop twice in the same epoch. As a result, the airdrop proof output an epoch key a fix the nonce to 0.

Therefore, the proof checks that

  1. If the user has a sign-up flag from a given attester.

  2. The user has in UniRep and has performed the in the latest epoch. In other words, the user has a leaf in the global state tree.

  3. If the sign up proof epoch matches the current epoch.

  4. If the output epoch key is computed with the nonce = 0

Public inputs

  • epoch

  • epoch_key

  • GST_root

  • attester_id

  • sign_up

NOTE: No epoch key nonce is given.

Private inputs

  • identity_nullifier

  • identity_trapdoor

  • user_tree_root

  • GST_path_index

  • GST_path_elements

  • pos_rep

  • neg_rep

  • graffiti

  • sign_up

  • UST_path_elements

Contraints

1. Check if user exists in the Global State Tree and verify epoch key

Check the constrains in epoch key proof.

2. Check if the reputation given by the attester is in the user state tree

Check if hash(pos_rep, neg_rep, graffiti, sign_up) is one of the leaves in the user state tree of root user_tree_root.

See:

See the whole circuit in

☀️
reputation
registered
user state transition
Epoch Key Proof circuit
circuits/proveUserSignUp.circom