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: add native rust implementation of schnorr signature verification #5053

Merged
merged 10 commits into from
May 21, 2024

Conversation

TomAFrench
Copy link
Member

@TomAFrench TomAFrench commented May 18, 2024

Description

Problem*

Resolves

Summary*

This PR replaces the final wasm calls to barretenberg with a native implementation of schnorr signature verification. This allows us to remove the entire acvm_backend.wasm.

This schnorr implementation is something this I've slapped together in an afternoon so be warned of potential bugs, there doesn't seem to be any off-the-shelf rust implementations of schnorr using grumpkin however.

Now we don't need to do wasm initialisation for acvm_js, we can stop caching a solver object to pass into acvm_js, I've maintained the interface for now however but the external solver is ignored.

Benchmarks relative to #5056

schnorr_verify          time:   [526.91 µs 527.81 µs 528.91 µs]
                        change: [-67.185% -67.081% -66.993%] (p = 0.00 < 0.05)
                        Performance has improved.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@TomAFrench TomAFrench changed the title feat: remove embedded barretenberg wasm from bn254_blackbox_solver feat: add native rust implementation of schnorr signature verification to bn254_blackbox_solver May 19, 2024
@TomAFrench TomAFrench changed the title feat: add native rust implementation of schnorr signature verification to bn254_blackbox_solver feat: add native rust implementation of schnorr signature verification May 19, 2024
@TomAFrench TomAFrench force-pushed the tf/native-schnorr branch 2 times, most recently from 4a037a6 to 504d918 Compare May 20, 2024 00:24
Base automatically changed from tf/native-pedersen to master May 20, 2024 15:53
@TomAFrench TomAFrench marked this pull request as ready for review May 20, 2024 16:14
@TomAFrench TomAFrench requested a review from vezenovm May 20, 2024 16:17
@TomAFrench TomAFrench requested a review from guipublic May 21, 2024 10:15
acvm-repo/bn254_blackbox_solver/src/schnorr/mod.rs Outdated Show resolved Hide resolved
acvm-repo/bn254_blackbox_solver/src/schnorr/mod.rs Outdated Show resolved Hide resolved
TomAFrench and others added 2 commits May 21, 2024 15:53
Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
@TomAFrench TomAFrench enabled auto-merge May 21, 2024 14:54
@TomAFrench TomAFrench added this pull request to the merge queue May 21, 2024
Merged via the queue into master with commit fab1c35 May 21, 2024
42 checks passed
@TomAFrench TomAFrench deleted the tf/native-schnorr branch May 21, 2024 16:18
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request May 21, 2024
…ic definition (noir-lang/noir#5041)

feat: Implement turbofish operator (noir-lang/noir#3542)
feat: add `as_witness` builtin function in order to constrain a witness to be equal to a variable  (noir-lang/noir#4641)
chore(experimental): Elaborate impls & non-trait impls (noir-lang/noir#5007)
feat: add native rust implementation of schnorr signature verification (noir-lang/noir#5053)
chore: Release Noir(0.30.0) (noir-lang/noir#4981)
TomAFrench added a commit to AztecProtocol/aztec-packages that referenced this pull request May 21, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
fix(frontend): Call trait method with mut self from generic definition
(noir-lang/noir#5041)
feat: Implement turbofish operator
(noir-lang/noir#3542)
feat: add `as_witness` builtin function in order to constrain a witness
to be equal to a variable (noir-lang/noir#4641)
chore(experimental): Elaborate impls & non-trait impls
(noir-lang/noir#5007)
feat: add native rust implementation of schnorr signature verification
(noir-lang/noir#5053)
chore: Release Noir(0.30.0)
(noir-lang/noir#4981)
END_COMMIT_OVERRIDE

---------

Co-authored-by: TomAFrench <tom@tomfren.ch>
AztecBot added a commit that referenced this pull request May 21, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
fix(frontend): Call trait method with mut self from generic definition
(#5041)
feat: Implement turbofish operator
(#3542)
feat: add `as_witness` builtin function in order to constrain a witness
to be equal to a variable (#4641)
chore(experimental): Elaborate impls & non-trait impls
(#5007)
feat: add native rust implementation of schnorr signature verification
(#5053)
chore: Release Noir(0.30.0)
(#4981)
END_COMMIT_OVERRIDE

---------

Co-authored-by: TomAFrench <tom@tomfren.ch>
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.

None yet

2 participants