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

[Task]: Create nullifier tree wrapper over Smt #269

Closed
polydez opened this issue Mar 11, 2024 · 0 comments · Fixed by #275
Closed

[Task]: Create nullifier tree wrapper over Smt #269

polydez opened this issue Mar 11, 2024 · 0 comments · Fixed by #275
Assignees

Comments

@polydez
Copy link
Contributor

polydez commented Mar 11, 2024

Node's components affected by this task

  • Block producer

What should be done?

From @bobbinth:

While I think 0xPolygonMiden/crypto#288 could be independently interesting, I wonder if we should use a different approach for this specific issue.
This should help abstract away the logic of how block numbers are associated with nullifiers and would leave more flexibility for the future (e.g., we could build a specialized implementation of the NullifierTree which assumes that leaves are just 32-bit values).

How should it be done?

Specifically, we could create a new type NullifierDb or NullifierTree which would look something like this:

pub struct NullifierTree(Smt);

impl NullifierTree {
    pub add(&mut self, nullifier: Nullifier, block_num: u32)-> Result<(), NullifierTreeError> {
        // returns an error if the nullifier is already in the tree
    }

    pub fn get_block_num(&self, nullifier: &Nullifier) -> Option<u32> {
        // returns None if the nullifier is not in the tree
    }
}

When is this task done?

When wrapper with requested functionality is implemented and all components of Miden Node use it for nullifier's tree instead of bare Smt with conversions of nullifier's data.

Additional context

More context here: #266

@polydez polydez self-assigned this Mar 11, 2024
@polydez polydez changed the title [Task]: Create nullifier's tree wrapper over Smt [Task]: Create nullifier tree wrapper over Smt Mar 12, 2024
@polydez polydez linked a pull request Mar 12, 2024 that will close this issue
@polydez polydez closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant