Formally Verified Arbitrum Stylus Verifier #8609
clarus
started this conversation in
[NRG#4] Developer Tools
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We propose a translation of the Solidity smart contract for the Noir verifier in Rust in a way that is 100% safe and maintainable. For what we will:
Motivation
Maintaining several code bases can be challenging. In addition, verifiers are one of the most critical piece of software for a zero-knowledge systems so formal verification is considered as a requirement, for example by Vitalik, to use such systems at scale.
This is why we want to develop a Rust verifier that is formally verified as being equivalent to the original Solidity one. Note that we will not verify the original contract. But our translation will benefit from the same level of security as the Solidity contract. In addition, in case of a fix or evolution on the original contract, we will quickly propagate these changes on the Arbitrum Stylus version as we plan to follow the same code structure, and can easily check that all changes have been correctly propagated.
Methodology
We will rewrite the contract in Rust using the Alloy libraries (implementing
U256and all the data structures of the EVM), looking at the intermediate Yul code generated bysolc, the Solidity compiler. This first rewriting may be done by hand or with the help of AI. We have experience in representing Solidity code in identical Rust code thanks to our project Oxidefier, a compiler from Solidity to Rust. Note that for this project we will make the translation more manually in order to have a more optimized output.Then we will translate both the Solidity and Rust version in the Rocq theorem prover using coq-of-solidity and coq-of-rust to formally verify that the two behavce exactly the same, for any possible inputs.
In addition, we will run unit-tests, in particular to benchmark the rewriting of the code. As Arbitrum Stylus provides the same pre-compiles as the EVM we will also use them to implement the elliptic curve operations.
Timeline and Deliverables
The milestones are:
We can also run our project Oxidefier that is a compiler from Solidity to Rust, to get a baseline in terms of performance. In case the difference of speed is negligeable, we will drop our manual translation and prove equivalent the generated translation, what would be straightforward given that the translation is straighforward.
Team
The Formal Land will work on this project, with either Guillaume Claret (me) or the company's members. As relevant experience, I am developing the Oxidefier tool to automatically translate Solidity smart contracts to Rust, so I have deep knowledge of how a translation can be done. At Formal Land, we are very experienced in formal verification, and we developed the tools
coq-of-solidtyandcoq-of-rust, which we would use to prove the equivalence.We are familiar with zero-knowledge technology, developing a formal verification framework for circuits named Garden.
Start date
We can start on June 15th.
All reactions