-
Notifications
You must be signed in to change notification settings - Fork 6
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: Solidity verification of light client proofs with Plonk #27
Conversation
Thank you for the PR @storojs72! Could you add the documentation for this? I think what you have written in the PR header is already quite interesting and should be added to our mdBook |
Can you change the base branch to be It might require a rebase |
a412dee
to
220bac3
Compare
* docs: proof server rust doc Signed-off-by: Thomas Chataigner <[email protected]> * docs: mdbook Signed-off-by: Thomas Chataigner <[email protected]> * chore: missing link in summary Co-authored-by: wwared <[email protected]> * docs: document release Signed-off-by: Thomas Chataigner <[email protected]> * docs: integrate suggested changes Co-authored-by: wwared <[email protected]> * docs: integrate review Signed-off-by: Thomas Chataigner <[email protected]> * docs: apply suggested updates Co-authored-by: wwared <[email protected]> Co-authored-by: Artem Storozhuk <[email protected]> * docs: another batch of suggestions Co-authored-by: wwared <[email protected]> * docs: integrate more review Signed-off-by: Thomas Chataigner <[email protected]> * docs: Add list of useful tests, mention e2e.rs is STARK-only, remove hackmd link * docs: Groth16 -> Plonk/SNARK --------- Signed-off-by: Thomas Chataigner <[email protected]> Co-authored-by: wwared <[email protected]> Co-authored-by: Artem Storozhuk <[email protected]>
* ci: release ci Signed-off-by: Thomas Chataigner <[email protected]> * ci: add release creation Signed-off-by: Thomas Chataigner <[email protected]> * ci: fix release files Signed-off-by: Thomas Chataigner <[email protected]> * ci: update based on review Signed-off-by: Thomas Chataigner <[email protected]> * ci: dry files & hotfix flow Signed-off-by: Thomas Chataigner <[email protected]> * Apply suggestions from code review Co-authored-by: Samuel Burnham <[email protected]> * ci: base for PR Signed-off-by: Thomas Chataigner <[email protected]> * ci: Update release workflow (#26) * ci: Update release workflow * fix: Enforce `major.minor` version only for initial release * fix: Use full `major.minor.patch` for `Cargo.toml` and tag --------- Signed-off-by: Thomas Chataigner <[email protected]> Co-authored-by: Samuel Burnham <[email protected]>
* docs: proof server rust doc Signed-off-by: Thomas Chataigner <[email protected]> * docs: mdbook Signed-off-by: Thomas Chataigner <[email protected]> * chore: missing link in summary Co-authored-by: wwared <[email protected]> * docs: document release Signed-off-by: Thomas Chataigner <[email protected]> * docs: integrate suggested changes Co-authored-by: wwared <[email protected]> * docs: integrate review Signed-off-by: Thomas Chataigner <[email protected]> * docs: apply suggested updates Co-authored-by: wwared <[email protected]> Co-authored-by: Artem Storozhuk <[email protected]> * docs: another batch of suggestions Co-authored-by: wwared <[email protected]> * docs: integrate more review Signed-off-by: Thomas Chataigner <[email protected]> * docs: Add list of useful tests, mention e2e.rs is STARK-only, remove hackmd link * docs: Groth16 -> Plonk/SNARK --------- Signed-off-by: Thomas Chataigner <[email protected]> Co-authored-by: wwared <[email protected]> Co-authored-by: Artem Storozhuk <[email protected]>
97477e8
to
e1cfd7a
Compare
e1cfd7a
to
fd6416f
Compare
Some update. We have set own private AWS S3 bucket (
|
Closing this PR in favour of #28 for easier reviewing (new PR excludes already merged commits from |
This PR adds Foundry project for verification the Plonk proofs of light client programs (epoch-change and inclusion) using Solidity contract from Sphinx artefacts.
The
solidity
folder now contains three subfolders:contracts
(Foundry project with Solidity code);contracts-generator
(Rust program for generating the contracts using Sphinx);fixture-generator
(Rust program for generating a so-called fixture - a JSON file with the encoded proof, public values and vk necessary for the verification).Currently, executing Solidity verification should give tentatively following:
Two positive tests that demonstrate Plonk verification of epoch-change and inclusion proofs at ~318k gas are successful and two negative tests if fake proofs are used are successful.
There are also additionally four negative tests - when fake public values or wrong vk are used - that are currently failed. That means essentially that current version of Plonk contract (
e48c01ec
tag from Sphinx) allows submitting those fake input. I have checked that in recent versions of SP1 (in v1.0.7-testnet) it is fixed, so we in theory should get those tests passing once forward porting latest SP1 changes to sphinx.If you want to use custom fixture, you can regenerate it with
fixture-generator
program:This will run either inclusion or epoch_change proving (depending on
--program
flag value) and will end up with fixture JSON file replaced the current one inaptos/solidity/contracts/src/plonk_fixtures
.In case when new Sphinx is released and new version contains some breaking changes in the Plonk contracts, one can reinstall the Sphinx artefacts using
contracts-generator
program:this will invoke try_install_plonk_bn254_artifacts which will either tries to download the parameters from SP1 AWS bucket (their parameters don't work with our LC programs so we are going to replace this with our bucket containing our rebuilt parameters) or if they already exist, it will end up with just copying the *.sol files to the
aptos/solidity/contracts/src/plonk
. So until we have our own AWS bucket, the Plonk parameters have to be rebuilt manually (this process takes ~1 hour on R7 machine) and copied into~/.sp1/circuits/plonk_bn254/<commit>
directory.