-
Notifications
You must be signed in to change notification settings - Fork 31
feature/implement verkle tree follow commitment scheme interface #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nguyen-xuan-quoc
wants to merge
18
commits into
orochi-network:main
Choose a base branch
from
nguyen-xuan-quoc:feature/commitment_interface_for_verkle_tree
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a41defa
draft of commitment scheme interface for verkle tree
nguyen-xuan-quoc 188099e
try opening and verifying using real prover and verifier
nguyen-xuan-quoc b7c168f
fix kzg params
nguyen-xuan-quoc 5a8bb6c
update setup() and move everything to circuit
nguyen-xuan-quoc fe50104
fix and optimize
nguyen-xuan-quoc 95d6195
Merge branch 'orochi-network:main' into feature/commitment_interface_…
nguyen-xuan-quoc 8f2200d
Merge branch 'feature/commitment_interface_for_verkle_tree' of https:…
nguyen-xuan-quoc f9a7ca7
add the whole Verkle Tree commitment
nguyen-xuan-quoc 926be96
add test case and remove unnecessary example
nguyen-xuan-quoc bb69fcd
add errors's detail and optimize
nguyen-xuan-quoc 6331414
modify test_commitment example to commit the whole commitment scheme
nguyen-xuan-quoc 1fd7138
remove impl CommitmentScheme in circuit
nguyen-xuan-quoc a421995
change prover's constructor and optimize open()
nguyen-xuan-quoc 3f2bfa8
Merge branch 'orochi-network:main' into feature/commitment_interface_…
nguyen-xuan-quoc b8d8429
remove println!() line
nguyen-xuan-quoc a87dba2
modify example
nguyen-xuan-quoc 374d4af
add test cases
nguyen-xuan-quoc 2063bbc
use CommitmentScheme trait in zkmemory
nguyen-xuan-quoc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| use verkletree::verkletree::*; | ||
| use zkmemory::commitment::commitment_scheme::CommitmentScheme; | ||
| extern crate alloc; | ||
| use ff::Field; | ||
| use halo2_proofs::halo2curves::bn256::Fr; | ||
| use rand::thread_rng; | ||
|
|
||
| fn main() { | ||
| let rng = thread_rng(); | ||
| let elements: Vec<Fr> = (0..16 * 16).map(|_| Fr::random(rng.clone())).collect(); | ||
|
|
||
| let vk_commitment_scheme = VerkleTreeCommitmentScheme::setup(Some(2)); | ||
|
|
||
| let indices: Vec<usize> = vec![2, 3, 3, 3]; | ||
| let leaf = elements[16 * 16 - 2]; | ||
|
|
||
| let witness = VerkleTreeWitness { | ||
| leaf, | ||
| elements, | ||
| indices, | ||
| }; | ||
|
|
||
| let root = vk_commitment_scheme.commit(witness.clone()); | ||
|
|
||
| let opening = vk_commitment_scheme.open(witness.clone()); | ||
|
|
||
| assert!(vk_commitment_scheme.verify(root, opening, witness)) | ||
| } |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| /// Verkle Tree circuit | ||
| pub mod circuit; | ||
|
|
||
| /// Verkle Tree Commitment Scheme | ||
| pub mod verkletree; |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.