HashMinCommitment
The HashMinCommitment
circuit is designed for generating hashed commitments and ensuring a certain amount is greater than or equal to a specified minimum amount.
Input Signals
This circuit accepts the following input signals:
amount: This represents the amount under consideration.
minAmount: The minimum amount threshold.
oracle_owner: Identifier for the owner of the oracle.
oracle_key: Key for data retrieval in the oracle.
oracle_value: The associated value with the oracle_key.
unlock_sender: Identifier for the sender in the unlock operation.
unlock_receiver: Identifier for the receiver in the unlock operation.
Output Signals
This circuit outputs the following signals:
amountHash: Hash of the input amount.
minAmountHash: Hash of the minimum amount.
idHash: A complex hash, generated from all the input signals.
Components
The circuit has several components:
comp1: A comparator that checks if the
amount
is greater than or equal to theminAmount
.
hashAmount: A
Poseidon
hash function to hash theamount
.
hashMinAmount: A
Poseidon
hash function to hash theminAmount
.
hashId: A
Poseidon
hash function to hash all input signals to generate theidHash
.
Inclusion of External Circuits
The circuit includes poseidon
and comparators
circuits from the circomlib
library.
Main Component
The main component of this circuit file is the HashMinCommitment
template.
The HashMinCommitment
circuit is used primarily for creating hashed commitments for amounts while enforcing that the amount is greater than or equal to the minimum threshold. The hashed outputs can be used for comparison and verification processes in other parts of your application.
Last updated