Skip to content

Circuit: Update note_commit to take into account asset#56

Merged
ConstanceBeguier merged 28 commits intozsa1from
circuit_note_commitment
May 23, 2023
Merged

Circuit: Update note_commit to take into account asset#56
ConstanceBeguier merged 28 commits intozsa1from
circuit_note_commitment

Conversation

@ConstanceBeguier
Copy link
Collaborator

@ConstanceBeguier ConstanceBeguier commented Apr 26, 2023

In the circuit, we update note_commit to take into account asset.
Previously, note_commit returns cm = hash(Q_ZEC, msg) + [rcm]R.
Now, note_commit returns

  • cm = hash(Q_ZEC, msg) + [rcm]R for ZEC note
  • cm = hash(Q_ZSA, msg || asset) + [rcm]R for ZSA note

We now evaluate note_commit with the following steps

  1. evaluate hash_zec = hash(Q_ZEC, msg)
  2. evaluate hash_zsa = hash(Q_ZSA, msg || asset)
  3. select hash = hash_zec if is_native_asset
    = hash_zsa otherwise
  4. evaluate cm = hash + [rcm]R
  5. check some constraints on msg and asset and their decompositions
  6. return cm

The following modifications are required to update note_commit:

  • add a is_native_asset witness (and check that it is a boolean and its value is correct according to asset)
  • add a MUX chip to evaluate a multiplexer on Pallas points

Warning: we increased the size of the Orchard circuit !

@ConstanceBeguier ConstanceBeguier force-pushed the circuit_note_commitment branch from addc182 to f3217ed Compare April 27, 2023 07:55
@ConstanceBeguier ConstanceBeguier force-pushed the circuit_note_commitment branch from 34a4b71 to 004881d Compare May 4, 2023 13:25
@QED-it QED-it deleted a comment from what-the-diff bot May 9, 2023
@ConstanceBeguier ConstanceBeguier force-pushed the circuit_note_commitment branch from 6a6eaf1 to b24de51 Compare May 11, 2023 07:49
@ConstanceBeguier
Copy link
Collaborator Author

I just rebased on zsa1 branch

Copy link
Collaborator

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

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

added some minor comments. As discussed, let's wait for today's meeting before the final approve.


region.assign_advice(|| "out y", self.config.out, 0, || out_val)
},
)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like the duplication between x_cell and y_cell but don't see an easy way to remove it.

@ConstanceBeguier ConstanceBeguier force-pushed the circuit_note_commitment branch from b24de51 to 4dda8eb Compare May 16, 2023 14:08
@ConstanceBeguier
Copy link
Collaborator Author

I just rebased on zsa1

Copy link
Collaborator

@PaulLaux PaulLaux left a comment

Choose a reason for hiding this comment

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

Let's merge it.

This was referenced May 23, 2023
@ConstanceBeguier ConstanceBeguier merged commit aeb9934 into zsa1 May 23, 2023
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.

2 participants