You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With `coq-of-noir`, we provide an **open-source and extensive way to formally verify smart contracts written in ⬛ Noir**. Formal verification is about checking for any possible input that your code has no security issues, what is essential for code deployed on the blockchain! 🛡️
3
+
With `rocq-of-noir`, we provide an **open-source and extensive way to formally verify smart contracts written in ⬛ Noir**. Formal verification is about checking for any possible input that your code has no security issues, what is essential for code deployed on the blockchain! 🛡️
4
4
5
-
To keep things simple, we rely on the well-known proof assistant [Rocq](https://rocq-prover.org/) for all the verification work: if you are already knowledgeable into this system, you can readily use `coq-of-noir` to verify your smart contracts!
5
+
To keep things simple, we rely on the well-known proof assistant [Rocq](https://rocq-prover.org/) for all the verification work: if you are already knowledgeable into this system, you can readily use `rocq-of-noir` to verify your smart contracts!
6
6
7
7
## 🏎️ Getting Started
8
8
9
-
Follow what we do in our CI file [coq.yml](.github/workflows/coq.yml). Sorry for not having the time to provide more explanations!
9
+
Follow what we do in our CI file [rocq.yml](.github/workflows/rocq.yml). Sorry for not having the time to provide more explanations!
10
10
11
11
## ✅ What Works
12
12
13
-
The following steps work:
13
+
The following functionalities are currently implemented:
14
14
15
-
- A generated translation of the `base64` library of Noir to Coq in a code that compiles; we should thus support a large part of the Noir language.
16
-
- Semantics rules to reason on code like the above together with a proof strategy. This should already cover most of the Noir language.
17
-
- A formally verified functional specification of one of the functions with a loop from the `base64` library, exercising mutations and array access. We consider this to be our main test to see that `coq-of-noir` can work on non-trivial examples.
15
+
-**Translation:** Automatic translation of Noir programs to a representation in Rocq.
16
+
-**Semantics:** Formal semantics for reasoning about the translated Noir code.
17
+
-**Proof Strategy:** A proof strategy to formally verify properties of Noir programs.
18
+
-**Verified Example:** A verified functional specification of a non-trivial example (base64 loop) demonstrating mutation and array access handling.
18
19
19
-
Note that the proof process is still very verbose, and this tool is still a work in progress. Contact us at [contact@formal.land](mailto:contact@formal.land) or by direct message on our [X account](https://x.com/FormalLand) if you are interested.
20
+
Contact us at [contact@formal.land](mailto:contact@formal.land) or by direct message on our [X account](https://x.com/FormalLand) if you are interested.
20
21
21
22
## 🔭 Goal and Vision
22
23
23
24
The goal is to enable each team developing critical applications (meaning handling user money) to verify the correctness of their code with the higest degree of certainty thanks to **formal verification**.
24
25
25
-
For those who do not know, formal verification is a technique to verify software for 100% of possible execution parameters. **This means that the code cannot have bugs or vulnerabilities!** Initially applied to software from the spacial/defense industry, the key idea is to mathematically reason about the code to talk about possibly infinitely many possible cases, and to verify all the reasoning by a dedicated tool called a proof checker, in our case 🐓 Coq.
26
+
For those who do not know, formal verification is a technique to verify software for 100% of possible execution parameters. **This means that the code cannot have bugs or vulnerabilities!** Initially applied to software from the spacial/defense industry, the key idea is to mathematically reason about the code to talk about possibly infinitely many possible cases, and to verify all the reasoning by a dedicated tool called a proof checker, in our case 🐓 Rocq.
26
27
27
-
In this repository, we provide a command to automatically translate a Noir program to a representation in Coq. We translate the code after the monomorphisation phase of the Noir compiler so that we do not have to deal with polymorphism or type classes. Instead, one can reconstruct this organization of the code on the Coq side in a refinement step, if needed.
28
+
In this repository, we provide a command to automatically translate a Noir program to a representation in Rocq. We translate the code after the monomorphisation phase of the Noir compiler so that we do not have to deal with polymorphism or type classes. Instead, one can reconstruct this organization of the code on the Rocq side in a refinement step, if needed.
28
29
29
30
This translation is a shallow embedding optimized to write specifications and proofs about the code. As we erase all the types during the translation to keep only the values, we recommend doing a first proof step that reconstructs these types. This first proof step is also an opportunity to explicit the structure of the global state.
30
31
31
32
Our initial target is to verify a part of the [base64](https://github.com/noir-lang/noir_base64), which uses field arithmetic for optimizations. It also includes many loops, which are generally non-trivial to fully verify with formal verification.
32
33
33
-
_If you have a Noir project that you want to formally verify, either start using `coq-of-noir` or contact us!_
34
+
_If you have a Noir project that you want to formally verify, either start using `rocq-of-noir` or contact us!_
34
35
35
36
## 📚 Blog posts
36
37
@@ -41,4 +42,4 @@ Here are some blog posts featuring this tool:
41
42
42
43
## ⚖️ License
43
44
44
-
`coq-of-noir` is free and **open source**. It is distributed under a dual license. (MIT/APACHE) The translation phase is based on the code of the Noir compiler to maximize code reuse.
45
+
`rocq-of-noir` is free and **open source**. It is distributed under a dual license. (MIT/APACHE) The translation phase is based on the code of the Noir compiler to maximize code reuse.
0 commit comments