# Nullifiers

### Attestation nullifier

* Attestation nullifiers are used to prevent an attester attests to the same epoch key twice.
* Definition:`hash5(ATTESTATION_NULLIFIER_DOMAIN, identityNullifier, attesterId, epoch, epochKey)`
* `ATTESTATION_NULLIFIER_DOMAIN = 1`

### Epoch Key nullifier

* Epoch key nullifiers are used to prevent an epoch key be generated twice.
* If an epoch key is used more than once, we cannot differentiate which user receives the reputation.
* Definition:

  `hash5(EPOCH_KEY_NULLIFIER_DOMAIN, identityNullifier, epoch, nonce, 0)`
* `nonce` is used to limit the number of epoch keys, if the nonce is more than `numEpochKeyNoncePerEpoch`the epoch key proof will be invalid.
* `EPOCH_KEY_NULLIFIER_DOMAIN = 2`

### Reputation nullifier

* Reputation nullifiers are used to prevent a user double spending his reputation to perform actions.
* If the same reputation nullifiers submitted to Unirep contract, the transaction will be rejected.
* Definition:`hash5(REPUTATION_NULLIFIER_DOMAIN, identityNullifier, epoch, nonce, 0)`
* `nonce` is used to limit the number of spent reputation, if the nonce is more than `transitionedPosRep - transitionedNegRep`the reputation proof will be invalid.
* `REPUTATION_NULLIFIER_DOMAIN = 3`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unirep.gitbook.io/unirep-social/definition/nullifiers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
