Skip to main content

One post tagged with "Experiment"

View All Tags

Who verifies the Verifier? We ran solc in a zkVM

· 9 min read

Source code verification has no proof​

Source code verification is a very simple process, if you have the contract's sources and compilation settings you can just call the compiler, see the output, and compare the bytecode from the compiler with the bytecode deployed onchain.

Average users don't usually do this process though, mainly because the users' wallets and apps don't do it for them. They, instead, put their trust into verification services like Sourcify that can reply with a verification status in the matter of milliseconds.

But what if Sourcify is hacked and malicious contracts appear as verified while they aren't? Speed and UX come at the price of trust. In theory the best way to verify would be to reproduce the verification locally, if you are willing to pay trust with some seconds of your life: your wallet recompiles the contracts directly on your machine and fetches their onchain bytecode from a light client, also running on your machine.

Verifying locally solves the trust problem on most devices (paying trust with time), with two exceptions:

  • Hardware wallets have a small processor, too little memory to run a compiler or a light client.
  • Smart contracts can read the onchain hash, but they cannot execute Solidity. So onchain source code verification is not possible.