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

Remove Trapdoor From Circuit #50

Merged
merged 19 commits into from
Apr 13, 2022
Merged

Remove Trapdoor From Circuit #50

merged 19 commits into from
Apr 13, 2022

Conversation

bhgomes
Copy link
Contributor

@bhgomes bhgomes commented Apr 7, 2022

Changes

  • Replace trapdoor with secret key check on the Sender side
    • Trapdoor was the shared secret between the prover and the sender but it allowed the prover to impersonate the sender in the circuit
    • Now that the trapdoor is gone, we remove a scalar multiplication (3944 constraints & 3821 variables) from each Sender and Receiver
  • Remove unnecessary ephemeral public key check on the Receiver side
    • The ephemeral public key check was leftover from previous design choices made on the encrypted note.
    • NB: We don't check the encrypted note in-circuit on purpose since we don't care about enforcing in-band secret distribution, it does not change the security/privacy guarantees on honest users.
    • Now that this check is gone we remove a (constant-base) scalar multiplication (1902 constraints & 1779 variables) from each Receiver
  • Generalize some cryptographic primitives and add more encoding/decode methods

Circuit Sizes

This upgrade reduces the circuit sizes considerably:

CIRCUIT CONSTRAINTS Δ SECRET VARIABLES Δ PUBLIC VARIABLES Δ
Mint 450 -5857 448 -5607 4 -2
PrivateTransfer 18148 -15840 17936 -15340 7 -4
Reclaim 17706 -9983 17492 -9733 8 -2

@bhgomes bhgomes added bug A-security Area: Issues and PRs related to Security labels Apr 7, 2022
@bhgomes bhgomes added this to the Version 0 milestone Apr 7, 2022
@bhgomes bhgomes self-assigned this Apr 7, 2022
@bhgomes bhgomes marked this pull request as ready for review April 8, 2022 18:51
@bhgomes bhgomes requested a review from stechu April 8, 2022 20:23
bhgomes added a commit to Manta-Network/sdk that referenced this pull request Apr 8, 2022
See Manta-Network/manta-rs#50 for more on the
latest parameter changes.
@bhgomes bhgomes merged commit c6567af into main Apr 13, 2022
@bhgomes bhgomes deleted the fix/remove-trapdoor branch April 13, 2022 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-security Area: Issues and PRs related to Security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants