import { Prover } from './type'; import { SnarkProof } from '@unirep/utils'; import { BaseProof } from './BaseProof'; import { CircuitConfig } from './CircuitConfig'; /** * A class representing a [user state transition proof](https://developer.unirep.io/docs/circuits-api/classes/src.UserStateTransitionProof). Each of the following properties are public signals for the proof. */ export declare class UserStateTransitionProof extends BaseProof { readonly idx: { historyTreeRoot: number; stateTreeLeaf: number; epochKeys: number; control: number; }; /** * The [history tree](https://developer.unirep.io/docs/protocol/trees.md#history-tree) root being proven against. */ historyTreeRoot: bigint; /** * The new state tree leaf for the user. */ stateTreeLeaf: bigint; /** * The epoch keys that are output as public signals. These should be verified to not exist in the epoch tree. */ epochKeys: 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. */ control: bigint; /** * The attester id for the proof. */ attesterId: bigint; /** * The epoch the user is transitioning to. */ toEpoch: bigint; /** * @param publicSignals The public signals of the user state transition 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 { UserStateTransitionProof } from '@unirep/circuits' * const data = new UserStateTransitionProof(publicSignals, proof) * ``` */ constructor(publicSignals: (bigint | string)[], proof: SnarkProof, prover?: Prover, config?: CircuitConfig); /** * Pack several variables into one `bigint` variable. * @param config The variables that will be packed. * @returns The control * @example * ```ts * UserStateTransitionProof.buildControl({ * toEpoch, * attesterId, * }) * ``` */ static buildControl({ attesterId, toEpoch }: { attesterId: any; toEpoch: any; }): bigint; }