This project introduces a @free annotation that allows you to offload any heavy computation offchain. It allows solidity developers to bring the cost of compute-heavy functions almost to zero without sacrificing the DevEx.
The project's goal is achieved by a combination of many instruments used in the different stages. The first stage is preprocessing, here the user's code gets modified and all the needed modifications are injected. The original code of the annotated function is used later in the process. We defined a custom set of EVM opcodes and the interpreter within the SP1 VM to prove the execution of the function's code.
After the proving, batches of proofs are aggregated and sent to the blockchain. Within those aggregated proofs, every single one has its own Merkle path that can be later used for verification purposes. Those are sent to the special contract called Oracle.
After they are present in the Oracle contract,
We use solc modifications, SP1, Rust, and Foundry.
System workflow:
@free
annotation in the source code.calldatasize()
with calldataload(caldatasize() - 32)
in the EVM bytecode. It allows us to pass additional witnesses needed for ZKP verification without affecting the function selectors and contract logic.