Skip to content
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

Feature/add merkle proof sdk #63

Merged
merged 28 commits into from
Aug 19, 2024
Merged

Feature/add merkle proof sdk #63

merged 28 commits into from
Aug 19, 2024

Conversation

EkamSinghPandher
Copy link
Collaborator

Add a CLI command to fetch the merkle proof for a given user index.

config/default.toml Outdated Show resolved Hide resolved
crates/zk-por-core/src/config.rs Show resolved Hide resolved
crates/zk-por-core/src/database.rs Outdated Show resolved Hide resolved
@@ -19,17 +40,17 @@ impl MerkleProofIndex {

/// Get the siblings index for the merkle proof of inclusion given a leaf index of a binary merkle sum tree.
/// We get the parent index of a leaf using the formula: parent = index / 2 + num_leaves
pub fn get_mst_siblings_index(global_index: usize, global_mst: &GlobalMst) -> Vec<usize> {
pub fn get_mst_siblings_index(global_index: usize, cfg: &GlobalConfig) -> Vec<usize> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we make this function as a method in Global_MST?

Copy link
Collaborator Author

@EkamSinghPandher EkamSinghPandher Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too, but I dont want to load the global MST, it is heavy because it contains an entire vector of all the hashes, we can probably refactor the global MST struct instead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too, but I dont want to load the global MST, it is heavy because it contains an entire vector of all the hashes, we can probably refactor the global MST struct instead.

agree

crates/zk-por-core/src/merkle_proof.rs Outdated Show resolved Hide resolved
crates/zk-por-core/src/merkle_proof.rs Show resolved Hide resolved
crates/zk-por-core/src/merkle_proof.rs Outdated Show resolved Hide resolved
crates/zk-por-core/src/merkle_proof.rs Outdated Show resolved Hide resolved
crates/zk-por-core/src/merkle_proof.rs Outdated Show resolved Hide resolved
crates/zk-por-core/src/merkle_proof.rs Outdated Show resolved Hide resolved
@cliff0412
Copy link
Collaborator

pass root as parameter in verify

@cliff0412
Copy link
Collaborator

the raw account format should be the readable json data rather than a vector

@cliff0412 cliff0412 merged commit a0f159a into dev Aug 19, 2024
1 check passed
@cliff0412 cliff0412 mentioned this pull request Sep 2, 2024
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.

3 participants