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

Noir Contracts: Can TransparentNote of the non_native_token_contract conform to the NoteInterface? #1363

Closed
iAmMichaelConnor opened this issue Aug 2, 2023 · 2 comments · Fixed by #1412
Assignees

Comments

@iAmMichaelConnor
Copy link
Contributor

Ideally, we should be able to design every custom note to adhere to the NoteInterface:

use crate::note::note_header::NoteHeader;

struct NoteInterface<Note, N> {
    deserialise: fn ([Field; N]) -> Note,

    serialise: fn (Note) -> [Field; N],

    compute_note_hash: fn (Note) -> Field,

    compute_nullifier: fn (Note) -> Field,

    dummy: fn () -> Note,

    get_header: fn (Note) -> NoteHeader,

    set_header: fn (&mut Note, NoteHeader) -> (),
}

The motivation for this, is that an ordinary (not advanced) user can write notes without having to mention the Aztec context or the abi. This is because the Set, Singleton and ImmutableSingleton types take care of pushing-to and pulling-from the context, abis, and trees, by wrapping custom notes.

Currently, the TransparentNote deviates from this pattern. I don't fully understand the example, but would like to understand if the note could be made to conform to the pattern, or if there's something fundamental that's been overlooked in designing the NoteInterface.

Tagging @Maddiaa0 who I think designed this contract and note :)

@dbanks12
Copy link
Collaborator

dbanks12 commented Aug 2, 2023

It can, and I have started working on this here #1194

@iAmMichaelConnor iAmMichaelConnor assigned dbanks12 and unassigned Maddiaa0 Aug 3, 2023
@dbanks12 dbanks12 moved this from Todo to In Progress in A3 Aug 7, 2023
@dbanks12
Copy link
Collaborator

dbanks12 commented Aug 7, 2023

Closed as this is being done in #1194

@dbanks12 dbanks12 closed this as completed Aug 7, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in A3 Aug 7, 2023
Maddiaa0 pushed a commit that referenced this issue Aug 7, 2023
Closes #1194
Closes #1363

Will likely rename getCommitment alongside all instances of "commitment"
as a part of this other issue:
#1408

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [x] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

---------

Co-authored-by: Michael Connor <[email protected]>
superstar0402 added a commit to superstar0402/aztec-nr that referenced this issue Aug 16, 2024
Closes AztecProtocol/aztec-packages#1194
Closes AztecProtocol/aztec-packages#1363

Will likely rename getCommitment alongside all instances of "commitment"
as a part of this other issue:
AztecProtocol/aztec-packages#1408

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [x] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).

---------

Co-authored-by: Michael Connor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants