Guillaume Claret
guillaume-claret.bsky.social
Guillaume Claret
@guillaume-claret.bsky.social
Founder/Security researcher at Formal Land

Formal verification in Rocq (PhD). Solitity/Rust/ZK

Discuss: https://calendly.com/guillaume-claret
At @formalland.bsky.social we are specialist of compilers and formal verification, and we will be happy to help building faster execution engine for smart contracts.

Thanks for the reading!
April 21, 2025 at 7:41 PM
This will surely optimize some computations, but others, such as Keccak hashes, would still take as much time. So there is a debate about whether it is worth the cost, or whether there are better targets than RISC-V.
April 21, 2025 at 7:40 PM
The proposal to migrate to RISC-V would keep CALL, CREATE, and the "storage" functions as special primitives but replace all the arithmetic/stack/memory opcodes with corresponding RISC-V ones.
April 21, 2025 at 7:40 PM
The most complex opcodes are related to contract calls and creation, such as CALL and CREATE. They are the way to interact with other contracts and have complex rules, for example, for error handling. What to do if there is not enough gas? Not enough money? A revert?
April 21, 2025 at 7:40 PM
Other primitives of the EVM include cryptographic primitives for hashes and signatures. Some of these are implemented through "precompiles", which are like sys-calls to some special hard-coded primitives. 💪
April 21, 2025 at 7:40 PM
Generally, the access keys are computed with the Keccak hash algorithm.

This hashing is one of the bottlenecks to migrate to ZK platforms, as it is really expensive to compute in ZK, unless replaced by ZK-friendly hashes like Poseidon2.
April 21, 2025 at 7:40 PM
You have access to a "storage" which is preserved after the contract's execution. You can view it as the smart contract's hard drive 💾. It is a mapping from 256-bit words to 256-bit words. It costs money to write in it, as its state must be replicated on all the network nodes.
April 21, 2025 at 7:39 PM
A smart contract might terminate either with success or failure (RETURN or REVERT opcode). In both cases, you specify a memory range acting as the returned value. If there is a REVERT, the program is rejected from the blockchain and does not modify/pay anything. 👌
April 21, 2025 at 7:39 PM
You have all the arithmetic and bitwise operations you might expect, operating generally on 256-bit words. You never de-allocate, as smart contract executions are short-lived! 🏎️
April 21, 2025 at 7:39 PM
It works with a stack (no registers). The default word size is 256 bits (32 bytes!). When executing a smart contract, you have access to a "memory" that is an array of bytes, similar to the RAM memory for native programs.
April 21, 2025 at 7:39 PM
This is the assembly language to which smart contracts written in Solidity are compiled. You can see the complete list of opcodes on evm.codes There are about 150 of them.
EVM Codes
An Ethereum Virtual Machine Opcodes Interactive Reference
evm.codes
April 21, 2025 at 7:39 PM