Epoch Key And Proof

User generates an epoch key and a proof of this epoch key

  • An epoch key is the only way that a user can receive reputation.

  • A user can generate an epoch key with a nonce, the nonce should be less than numEpochKeyNoncePerEpoch.

  • A user generates the epoch key with a circom circuit and the epoch key and proof can be verified by attesters and other users.

genEpochKeyAndProof

npx ts-node cli/index.ts genEpochKeyAndProof 
                  [-h] 
                  [-e ETH_PROVIDER] 
                  -id IDENTITY 
                  -n EPOCH_KEY_NONCE 
                  -x CONTRACT
  • epoch key and base64url encoded epoch key proof and public signals will be printed

  • A string with Unirep.epk.proof prefix is the proof of this epoch key

  • A string with Unirep.epk.publicSignals prefix is the public signals of this proof The public signals includes

    • the current epoch

    • the epoch key

    • the global state tree root.

  • Attesters and other users can verify if the epoch key is in the current epoch and if the user has a leaf in the global state tree.

Options

Options inherited from parent commands

verifyEpochKeyProof

  • This command will help other users with an epoch key proof with Unirep.epk.proof prefix and it public signals with Unirep.epk.publicSignals prefix to call the Unirep smart contract to verify the proof.

Options

Options inherited from parent commands

submitEpochKeyProof

  • Epoch key proof should be submitted to UniRep and get the index of the proof.

  • Then the attester can submit attestation to the epoch key with a valid proof index.

  • Only if the epoch key proof is valid, the attestation can be processed.

Options

Options inherited from parent commands

Last updated

Was this helpful?