Skip to content

Point inequality#50

Open
hridambasu wants to merge 35 commits intozsa1from
point-inequality
Open

Point inequality#50
hridambasu wants to merge 35 commits intozsa1from
point-inequality

Conversation

@hridambasu
Copy link

@hridambasu hridambasu commented Feb 10, 2026

Halo2 Example: Prove knowledge of a point (x, y) that is NOT equal to reference point (x0, y0)
This circuit demonstrates proving that a witness point (x, y) is different from
a public reference point (x0, y0). The inequality is proven by showing that

  • either x != x0 OR y != y0 (or both).
    We solve this by:
  • Computing the inverses of the differences of the points inv_dx and inv_dy
  • Computing the terms is_dx_nz and is_dy_nz which are flags for checking if dx and dy are 0 or not
  • Checking whether these flags are boolean or not
  • Checking whether (1 - is_dx_nz)(1 - is_dy_nz) = 0

The Circuit looks like:

Row | I0 | A0 | A1 | F0 | F1 | S0 | S1 | S2
----+-----+--------------------------------------------------------------------+--------------------------------------------------------------------+-----+----+----+----+---
0 | 0x5 | 0xa | 0 | 0 | 0 | 0 | 0 | 0
1 | 0x7 | 0xc | 0 | 0 | 0 | 0 | 0 | 0
2 | 0 | 0x5 | 0 | 0 | 0 | 0 | 0 | 0
3 | 0 | 0x7 | 0 | 0 | 0 | 0 | 0 | 0
4 | 0 | 0xa | 0x5 | 0x2 | 0 | 0 | 1 | 0
5 | 0 | 0x5 | 0 | 0 | 0 | 0 | 0 | 0
6 | 0 | 0xc | 0x7 | 0x2 | 0 | 0 | 1 | 0
7 | 0 | 0x5 | 0 | 0 | 0 | 0 | 0 | 0
8 | 0 | 0x19999999999999999999999999999999a74f7064d0853071707879f866666667 | 0 | 0 | 0 | 0 | 0 | 0
9 | 0 | 0x19999999999999999999999999999999a74f7064d0853071707879f866666667 | 0 | 0 | 0 | 0 | 0 | 0
10 | 0 | 0x5 | 0x19999999999999999999999999999999a74f7064d0853071707879f866666667 | 0 | 1 | 0 | 0 | 1
11 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0
12 | 0 | 0x5 | 0x19999999999999999999999999999999a74f7064d0853071707879f866666667 | 0 | 1 | 0 | 0 | 1
13 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0
14 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0
15 | 0 | 1 | 1 | 0x2 | 0 | 0 | 1 | 0
16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
17 | 0 | 1 | 1 | 0x2 | 0 | 0 | 1 | 0
18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
19 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1
20 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
21 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1
22 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
23 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants