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

Was this helpful?

Edit on GitHub
  1. Getting Started
  2. Start with cli commands 🔌

9. Attester attest to epoch key

Previous8. Submit epoch key proof to Unirep smart contractNext10. Epoch transition

Last updated 2 years ago

Was this helpful?

npx ts-node cli/index.ts attest \
    -x $UNIREP_CONTRACT_ADDRESS  \
    -d $ATTESTER_PRIVATE_KEY  \
    -epk $EPOCH_KEY  \
    -toi 1  \
    -pr 5  \
    -nr 4  \
    -gf 0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864  \
    -s 1

After attestation is submitted successfully, the message will be printed

Attesting to epoch key 1421637519 with pos rep 5, neg rep 4, graffiti 0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864 and sign up flag 1
Transaction hash: 0xcfa6432b326343c679285cebc8a7cefbb0489ad4a636d4e87b649d27892bd9f5h

NOTE:

-epk is the epoch key of the receiver

-toi is the proof index of the epoch key

-pr (optional) is the positive reputation given to the user

-nr (optional) is the negative reputation given to the user

-gf (optional) is the graffiti for the reputation given to the user

-s (optional) is the sign up flag to give to the user to indicate the attester authenticates the user's membership.

See: for more attest options

🎮
cli/attest