Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
We solve this by computing the difference of the points
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.
The Hash can be a Poseidon hash or a Blake2s Hash
The circuit looks like:
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