Skip to main content
Version: 1.0.1

6. User generates epoch key and epoch key proof

npx ts-node cli/index.ts genEpochKeyAndProof \
-x $UNIREP_CONTRACT_ADDRESS \
-id $USER_IDENTITY \
-n 0
info

NOTE: -id is user's identity and -n is epoch key nonce which should be less than the system parameter maxEpochKeyNonce

See: cli/genEpochKeyAndProof for more genEpochKeyAndProof options.

NOTE: epoch key and base64url encoded epoch key proof and public signals will be printed and they should be handed to attester to be verified, for example:

Epoch key of epoch 1 and nonce 0: 1916576171
Unirep.epk.proof.WyIxMzUzNzA2MjUwMDcwMTQxOTEwNTYxNTQ3ODU5NzUxMzE2Mjg3MDg3OTY3OTM3ODcwODI0NDk2MzQwODk2NDg1NDE1OTUyOTA0Mzg0NyIsIjEwOTQ2OTcyMjQxOTMzNDMwMTUxMDQ1NzQzNzY0MjI5ODE0ODU5MjU2MDIyMDI3MTEwNDcxNjA1NjIwNTAwNDM5OTQwMjA0OTQzMzAxIiwiNzQ5NjMyMjAzNzM3MTcwMDA0MTE5NjU2MzA0Mzc3MzIwNDc4NTI2NjAwOTYxNjA5OTU4NTAzMDkwMDQ5MTkyMjQ2NDg3ODg2ODU0MCIsIjExNjU3MTU3MTMxODk3MzgxNDc5MTY1MDkwMTAwOTkxMjgyOTkzNjg5MTgxMjg1NjM5ODA4MzQ5NDU1MzIyNjc3MjExNzE1MDc5Mjc1IiwiNzcwNTY0MTMxNjM2Njc4MDk5MzkyMDE2NTIwMzIyODc0MjMyMzIxOTQzMzQ3NzEyODg1NDYwNDcyODQ2OTUxOTkxMDAyNjc2NjUyMSIsIjgyODU4MzIyMjk0NTYyNDkxNTM5NDkyMjQ2MjY2MDQ1OTUyNzI5Njk5NTYwNjYyODQ3NzIwMDA3ODE3MTY3NjUyMjk4ODAyMDU1MDAiLCIxMjk4MTIyNjg1ODc4MTQ1Mjk3MjAzMjA1MjEzNzYwNTk3NDU1Mjc0MzA5MTA5MjgyNjM3OTAzNTg1NDk0ODY5ODA5OTkwNzM5ODI0NCIsIjIwM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