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
  • Epoch key nullifiers
  • Reputation nullifiers

Was this helpful?

Edit on GitHub
  1. Protocol
  2. Glossary

Nullifiers

PreviousTreesNextEpoch Transition

Last updated 2 years ago

Was this helpful?

  • Nullifiers are used to prevent things from happening more than once

  • UniRep uses two different nullifiers

Epoch key nullifiers

  • Epoch key nullifiers are used to prevent users from using the same epoch key twice and prevent users from double .

  • If an epoch key nullifier is seen before, then drop the second user state transition proof.

  • Nullifier of an epoch key is computed by

hash(
    EPOCH_KEY_NULLIFIER_DOMAIN, 
    identityNullifier, 
    epoch, 
    nonce
)

Reputation nullifiers

  • Reputation nullifiers are used to prevent users from double spending the reputation if an action requires users to spend reputation.

  • If a reputation nullifier is seen before, then the second reputation proof is recognized invalid.

  • Nullifier of a reputation spent is computed by

hash(
    REPUTATION_NULLIFIER_DOMAIN, 
    identityNullifier, 
    epoch, 
    nonce, 
    attesterId
)
  • The nonce can only be within 0 to posRep-negRep-1 with the given attesterID.

NOTE: EPOCH_KEY_NULLIFIER_DOMAIN and REPUTATION_NULLIFIER_DOMAIN are used to prevent mixed-up of epoch key nullifiers and reputation nullifiers.

☀️
user state transition