🔑Key

  1. <==: This operator is used to assign a value to a variable or signal. When you use this operator, you're saying "I want the variable on the left side to take on the value (or result of the expression) on the right side." Essentially, you're defining what a particular signal or variable should be.

    • Example: lowerBound.in[0] <== max_abs_value + in;

      This means you're defining or assigning the value of lowerBound.in[0] to be max_abs_value + in. Here, you're making a definitive statement about what lowerBound.in[0] should be in the circuit.

  2. ===: This operator is used to set up an equality constraint. It's like saying "The expressions on both sides of this operator must evaluate to the same value." This is a constraint within the circuit that must be satisfied for the proof to be valid.

    • Example: lowerBound.out === 0

      This means that, whatever other operations or constraints are in the circuit, for the proof to be valid, the signal lowerBound.out must equal 0.

In essence:

  • <== is directive, telling the circuit "This signal should have this value."

  • === is conditional, telling the circuit "These two signals or expressions should be equal."

This distinction is key in the construction of zk-SNARK circuits. Proper assignment and correct equality constraints ensure the circuit behaves as expected and produces valid proofs.

  1. <<:

    • Context in zk/Circom: The left shift operator retains its typical meaning from most programming contexts. In binary representation, it shifts the bits of the number on its left by the number of positions specified on its right.

    • Example: In the expression in + (1 << bits), the number 1 is shifted left by bits positions, essentially multiplying the number 1 by 2 raised to the power of bits.

Last updated