import { Prover } from './type'; import { SnarkProof } from '@unirep/utils'; import { BaseProof } from './BaseProof'; /** * The reputation proof structure that helps to query the public signals */ export declare class ReputationProof extends BaseProof { /** * The index of the data in the public signals */ readonly idx: { epochKey: number; stateTreeRoot: number; control0: number; control1: number; graffiti: number; data: number; }; /** * The epoch key that owns the reputation. */ epochKey: bigint; /** * The state tree root the user is a member of. */ stateTreeRoot: bigint; /** * The control field used for the proof. This field contains many signals binary encoded into a single 253 bit value. This value is automatically decoded into the other properties on this class. * See the [circuit documentation](https://developer.unirep.io/docs/circuits-api/circuits) for more information. */ control0: bigint; /** * The control field used for the proof. This field contains many signals binary encoded into a single 253 bit value. This value is automatically decoded into the other properties on this class. * See the [circuit documentation](https://developer.unirep.io/docs/circuits-api/circuits) for more information. */ control1: bigint; /** * The graffiti controlled by the user, which is defined by `data[SUM_FIELD_COUNT] % (2 ** REPL_NONCE_BITS)` in the circuits. This value is only checked if `proveGraffiti` is non-zero. */ graffiti: bigint; /** * The signature data included for the proof. */ data: bigint; /** * The nonce used to generate the epoch key. To determine if this value is set check that `revealNonce == 1`. */ nonce: bigint; /** * The epoch the proof was made within. */ epoch: bigint; /** * The attester id for the proof. */ attesterId: bigint; /** * A number indicating whether the epoch key nonce was revealed in the proof. This value will be either `1` or `0`. */ revealNonce: bigint; /** * The chain id for the proof. */ chainId: bigint; /** * A minimum amount of net positive reputation the user controls. This value is only used if `proveMinRep` is non-zero. * Example: Alice has 10 `posRep` and 5 `negRep`. Alice can prove a `minRep` of 2 because she has a net positive reputation of 5. */ minRep: bigint; /** * A maximum amount of net positive reputation the user controls. This value is only used if `proveMaxRep` is non-zero. * Example: Bob has 10 `posRep` and 5 `negRep`. Bob can prove a `maxRep` of 7 because he has a net positive reputation of 5. */ maxRep: bigint; /** * Whether or not to enforce the provided `minRep` value. If this value is non-zero the `minRep` will be proven. */ proveMinRep: bigint; /** * Whether or not to enforce the provided `maxRep` value. If this value is non-zero the `maxRep` will be proven. */ proveMaxRep: bigint; /** * Whether or not to prove the user has a net 0 reputation balance. If this value is non-zero the user `posRep` and `negRep` must be equal. */ proveZeroRep: bigint; /** * Whether the user has chosen to prove a graffiti. If this value is non-zero the user graffiti will be proven. */ proveGraffiti: bigint; /** * @param publicSignals The public signals of the reputation proof that can be verified by the prover * @param proof The proof that can be verified by the prover * @param prover The prover that can verify the public signals and the proof * @example * ```ts * import { ReputationProof } from '@unirep/circuits' * const data = new ReputationProof(publicSignals, proof) * ``` */ constructor(publicSignals: (bigint | string)[], proof: SnarkProof, prover?: Prover); /** * Pack several variables into one `bigint` variable. * @param config The variables that will be packed. * @returns The controls * @example * ```ts * ReputationProof.buildControl({ * attesterId, * epoch, * nonce, * revealNonce, * chainId, * proveGraffiti, * minRep, * maxRep, * proveMinRep, * proveMaxRep, * proveZeroRep, * }) * ``` */ static buildControl({ attesterId, epoch, nonce, revealNonce, chainId, proveGraffiti, minRep, maxRep, proveMinRep, proveMaxRep, proveZeroRep, }: any): bigint[]; }