Skip to content

Point inequality hash#53

Closed
hridambasu wants to merge 38 commits into
zsa1from
point-inequality-hash
Closed

Point inequality hash#53
hridambasu wants to merge 38 commits into
zsa1from
point-inequality-hash

Conversation

@hridambasu

@hridambasu hridambasu commented Feb 25, 2026

Copy link
Copy Markdown

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 difference of the points

  • dx = (x - x0), dy = (y - y0),
    and then choosing a random point r which is computed by taking the Hash of the transcript
    of the protocol so far and then checking whether a random linear combination
    of the differences of the values equates to zero or not.
  • c = dx + r.dy
    The Hash can be a Poseidon hash or a Blake2s Hash

Please check out the visual layout of the circuit at: https://github.com/QED-it/halo2/blob/point-inequality-hash/point-inequality.png

@PaulLaux

PaulLaux commented Mar 5, 2026

Copy link
Copy Markdown
Row | I0                                                                 | A0                                                                 | A1                                                                 | F0  | F1 | F2 | S0 | S1 | S2 | S3
----+--------------------------------------------------------------------+--------------------------------------------------------------------+--------------------------------------------------------------------+-----+----+----+----+----+----+---
0   | 0x5                                                                | 0xa                                                                | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
1   | 0x7                                                                | 0xc                                                                | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
2   | 0x2bcecee922cd968d7c3826eae86f127bb8e7229646410618eabf4e9772f56d42 | 0x5                                                                | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
3   | 0                                                                  | 0x7                                                                | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
4   | 0                                                                  | 0xa                                                                | 0x5                                                                | 0x2 | 0  | 0  | 0  | 1  | 0  | 0 
5   | 0                                                                  | 0x5                                                                | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
6   | 0                                                                  | 0xc                                                                | 0x7                                                                | 0x2 | 0  | 0  | 0  | 1  | 0  | 0 
7   | 0                                                                  | 0x5                                                                | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
8   | 0                                                                  | 0x2bcecee922cd968d7c3826eae86f127bb8e7229646410618eabf4e9772f56d42 | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
9   | 0                                                                  | 0x2bcecee922cd968d7c3826eae86f127bb8e7229646410618eabf4e9772f56d42 | 0x5                                                                | 0   | 1  | 0  | 0  | 0  | 1  | 0 
10  | 0                                                                  | 0x1b0a0a8dae03f0c36d18c2968a2b5c6a35afe1fb435e3329ca34f62e3ecb2247 | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
11  | 0                                                                  | 0x5                                                                | 0x1b0a0a8dae03f0c36d18c2968a2b5c6a35afe1fb435e3329ca34f62e3ecb2247 | 1   | 0  | 0  | 1  | 0  | 0  | 0 
12  | 0                                                                  | 0x1b0a0a8dae03f0c36d18c2968a2b5c6a35afe1fb435e3329ca34f62e3ecb224c | 0                                                                  | 0   | 0  | 0  | 0  | 0  | 0  | 0 
13  | 0                                                                  | 0x1b0a0a8dae03f0c36d18c2968a2b5c6a35afe1fb435e3329ca34f62e3ecb224c | 0x2d0ae087001c8a40106b757811460967fa234f183acde4f79b1bb7a879275813 | 0   | 0  | 1  | 0  | 0  | 0  | 1 

@PaulLaux PaulLaux closed this May 1, 2026
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