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

replace the sinsemillar note commitment with the poseidon commitment #214

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

XuyangSong
Copy link
Collaborator

@XuyangSong XuyangSong commented Sep 13, 2023

close #199 and resolve #123 incidentally

  • Use Poseidon hash to commit the note, note_cm = poseidon_hash(note, rcm).
  • As a result, the note commitment will be a field element instead of a point. Adjust the nullifier derivation from nf =Extract_P([PRF_{nk}(\rho) + \psi \ mod \ q] * K + note_cm) to nf = poseidon_hash((nk || \rho || \psi || note_cm)
  • Remove sinsemilla commitment and the note bits decomposition
  • Remove the confusing address(address = hash(app_data_dynamic || app_data_dynamic)) in the note. Both app_data_dynamic and nk_com directly go to the note commitment.

Potential improvement: There are seven field elements in Poseidon note commitment. If we composite the is_merkle_checked(bool) and value(u64 but may be extended to u128 later) to one element(is_merkle_checked * (1<<128) + value) in the circuit, we can save one round of Poseidon absorb. Is it worth it?

@XuyangSong XuyangSong marked this pull request as ready for review September 15, 2023 13:56
Copy link
Contributor

@bazzilic bazzilic left a comment

Choose a reason for hiding this comment

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

LGTM

@bazzilic
Copy link
Contributor

we can save one round of Poseidon absorb. Is it worth it?

I think we can take note of this possibility and leave this optimization for the future.

@XuyangSong XuyangSong force-pushed the xuyang/poseidon_note_commitment branch from e604a67 to bb3be6e Compare September 18, 2023 14:42
@XuyangSong XuyangSong merged commit 8ecd229 into main Sep 19, 2023
3 of 7 checks passed
@XuyangSong XuyangSong deleted the xuyang/poseidon_note_commitment branch October 6, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants