An attester can submit the airdrop attestation to an epoch key with a sign up proof. The msg.sender should match the attesterId in the publicSignals.
/*** @dev An attester submit the airdrop attestation to an epoch key with a sign up proof* publicSignals[0] = [ epoch ]* publicSignals[1] = [ epochKey ]* publicSignals[2] = [ globalStateTree ]* publicSignals[3] = [ attesterId ]* publicSignals[4] = [ userHasSignedUp ]* @param publicSignals The public signals of the sign up proof* @param proof The The proof of the sign up proof */functionairdropEpochKey(uint256[] memory publicSignals,uint256[8] memory proof) externalpayable
The epoch key proof should be submitted before to get attestation. Then others can verify if the attestation is given to a valid epoch key.
/*** @dev A user should submit an epoch key proof and get a proof index* publicSignals[0] = [ globalStateTree ]* publicSignals[1] = [ epoch ]* publicSignals[2] = [ epochKey ]* @param publicSignals The public signals of the epoch key proof* @param proof The The proof of the epoch key proof*/functionsubmitEpochKeyProof(uint256[] memory publicSignals,uint256[8] memory proof) external
An attester can submit the attestation with a proof index. A valid proof is either an epoch key proof, a user sign up proof or a reputation proof with epoch key being one of the public signals. An attester can also submit attestations through a relayer or not.
It it is from a reputation proof we should include a fromProofIndex to make sure the attestation is from a valid reputation proof, or the attestation will fail.
A user include a reputation proof to spend reputation via an attester, the non-zero nullifiers will be processed as a negative attestation, and the spent reputation cannot be re-used.
/*** @dev A user spend reputation via an attester, the non-zero nullifiers will be processed as a negative attestation* publicSignals[0: maxReputationBudget ] = [ reputationNullifiers ]* publicSignals[maxReputationBudget ] = [ epoch ]* publicSignals[maxReputationBudget + 1] = [ epochKey ]* publicSignals[maxReputationBudget + 2] = [ globalStateTree ]* publicSignals[maxReputationBudget + 3] = [ attesterId ]* publicSignals[maxReputationBudget + 4] = [ proveReputationAmount ]* publicSignals[maxReputationBudget + 5] = [ minRep ]* publicSignals[maxReputationBudget + 6] = [ proveGraffiti ]* publicSignals[maxReputationBudget + 7] = [ graffitiPreImage ]* @param publicSignals The public signals of the reputation proof * @param proof The The proof of the reputation proof */functionspendReputation(uint256[] memory publicSignals,uint256[8] memory proof) externalpayable
After the spendReputation event emitted, the reputation will assign a proofIndex. Then the proofIndex can be included in the fromProofIndex of submitAttestation.
The proof index can be queried by proof hash. And the proof hash can be computed by