The start page about my efforts around smart contract verification
294
49 commits
updated Mar 24, 2022
This is the start page about my efforts around smart contract verification.
The goal is to establish a method how to verify a smart contract so that no surprises happen after their deployment.
What are formal methods? The word "formal" here is about looking at the shape, not at the meaning, of mathematical proofs.
For a long time, mathematical proofs were read, understood and then checked. In some cases you can do calculations like "a + b - b = a" by just looking at the form, saying something like "this cancels that". Still, in the usual practice of mathematics, you ought to be able to explain what is going on. You need to understand.
In the first half of 20th century, rigid languages appeared where proofs can be checked by machines. You can see examples here. Maybe the computers do not understand the meaning, but they can check the proofs.
When you translate mathematical texts into such machine-readable proofs, you are "formalizing" mathematics. Recent decades saw a tantalizing progress in this area. The Flyspeck project and CoqFiniteGroups formalized big results from the past centuries. The Homotopy Type Theory was formalized from its very early stages.
So far this was about mathematics. The take away is, you can obtain infinitely many truths at one shot. The equality "a + b - b = a" is true for any natural numbers. By the way, here we have a smart contract, whose input is actually only finitely many. Can we do something about this?
One way is to look at the EVM bytecodes. They are executed on a simple virtual machine. The rules of the virtual machine is well understood by different Ethereum clients which usually match (otherwise they fix the difference with uttermost priority). The current attempt in Coq is in evmverif repository, and there is a screen cast.
∀ a, b. keccak(a) = keccak(b) -> a = b, using the pigeon hole argument, I can prove 0 = 1 and everything.
sorry or admit to indicate that I give up proofs whenever I have to prove keccak(a) != keccak(b) because a != b. Then the proofs would be incomplete and I cannot call my results "theorems", but I'm happy that way. Anyway the compiler assumes no hash collisions without logical justification (but empirical).Deed and some other simple bytecode programs against simple properties (6-10 days)active flag.time it.Another way would be to verify Solidity sources somehow, not looking at the EVM bytecode.
The steps that have to be taken:
This alone does not verify smart contracts, but I have a chance to make it static analyzer friendly.
The bamboo compiler is now producing snippets of bytecode for the empty contract (still lots to be done).
The language has
It is inspired by an existing language but I will talk about it when it's actually working.
The contract analyzer needs an overhaul in the functionality and the UX. I want to see the meaning of each basic block, and how the execution can jump around the basic blocks.
A quick hack to visualize the dataflow in a transaction. This is useful after a surprise.
49 commits
The start page about my efforts around smart contract verification
294
49 commits
updated Mar 24, 2022
This is the start page about my efforts around smart contract verification.
The goal is to establish a method how to verify a smart contract so that no surprises happen after their deployment.
What are formal methods? The word "formal" here is about looking at the shape, not at the meaning, of mathematical proofs.
For a long time, mathematical proofs were read, understood and then checked. In some cases you can do calculations like "a + b - b = a" by just looking at the form, saying something like "this cancels that". Still, in the usual practice of mathematics, you ought to be able to explain what is going on. You need to understand.
In the first half of 20th century, rigid languages appeared where proofs can be checked by machines. You can see examples here. Maybe the computers do not understand the meaning, but they can check the proofs.
When you translate mathematical texts into such machine-readable proofs, you are "formalizing" mathematics. Recent decades saw a tantalizing progress in this area. The Flyspeck project and CoqFiniteGroups formalized big results from the past centuries. The Homotopy Type Theory was formalized from its very early stages.
So far this was about mathematics. The take away is, you can obtain infinitely many truths at one shot. The equality "a + b - b = a" is true for any natural numbers. By the way, here we have a smart contract, whose input is actually only finitely many. Can we do something about this?
One way is to look at the EVM bytecodes. They are executed on a simple virtual machine. The rules of the virtual machine is well understood by different Ethereum clients which usually match (otherwise they fix the difference with uttermost priority). The current attempt in Coq is in evmverif repository, and there is a screen cast.
∀ a, b. keccak(a) = keccak(b) -> a = b, using the pigeon hole argument, I can prove 0 = 1 and everything.
sorry or admit to indicate that I give up proofs whenever I have to prove keccak(a) != keccak(b) because a != b. Then the proofs would be incomplete and I cannot call my results "theorems", but I'm happy that way. Anyway the compiler assumes no hash collisions without logical justification (but empirical).Deed and some other simple bytecode programs against simple properties (6-10 days)active flag.time it.Another way would be to verify Solidity sources somehow, not looking at the EVM bytecode.
The steps that have to be taken:
This alone does not verify smart contracts, but I have a chance to make it static analyzer friendly.
The bamboo compiler is now producing snippets of bytecode for the empty contract (still lots to be done).
The language has
It is inspired by an existing language but I will talk about it when it's actually working.
The contract analyzer needs an overhaul in the functionality and the UX. I want to see the meaning of each basic block, and how the execution can jump around the basic blocks.
A quick hack to visualize the dataflow in a transaction. This is useful after a surprise.
49 commits