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

feat(Keys): Update broadcast and create_note #6440

Closed
Tracked by #5606
LHerskind opened this issue May 15, 2024 · 0 comments · Fixed by #6741
Closed
Tracked by #5606

feat(Keys): Update broadcast and create_note #6440

LHerskind opened this issue May 15, 2024 · 0 comments · Fixed by #6741

Comments

@LHerskind
Copy link
Contributor

LHerskind commented May 15, 2024

To fully implement #6408 we need to provide the ivpk and ovpk to the compute_encrypted_log function.

This can be implemented before #6410 and #6093 since the ovpk could be ignored temporarily to get the setup going.

We are currently providing the ivpk but the manner in which it is fetched is sub-optimal. At the moment, the ivpk is fetched inside the broadcast function of the notes, which push them to only retrieve it based on information inside the note itself.

This is not ideal, as the ivpk might be totally unrelated to the actor that can actually nullify the note, see #5864.

Instead, we should update the interface of broadcast

// Old
fn broadcast(self, context: &mut PrivateContext, slot: Field);

// New
fn broadcast(self, context: &mut PrivateContext, slot: Field, ivpk: GrumpkinPoint, ovpk: GrumpkinPoint);

And the lifecycle::create_note to

pub fn create_note<Note, N>(
    context: &mut PrivateContext,
    storage_slot: Field,
    note: &mut Note,
    ivpk: GrumpkinPoint,
    ovpk: GrumpinPoint,
) where Note: NoteInterface<N> {

Where the broadcast is always called, instead of being optional as before.

This way we will get all the information we need without needing to depend on all the information being in the note itself.

It requires some updates to the storage implementations and when they are used.

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