Skip to main content

Verifiable Computing

Verifiable computing enables a client to outsource computations to an untrusted server while ensuring that the computed results are correct. The output is often accompanied with a proof that can satisfy the client that the computation was done correctly. While in some cases it allows computationally weak clients to delegate computations to powerful machines in order to save time and/or battery, in yet others the tasks would be simply impossible to complete had it not been delegated to one or more third-parties.

For example, the SETI@home project allowed anyone with a computer to provide computing power to search for signs of extraterrestrial intelligence. Collectively, in 2000, the 2.6 million Seti@Home machines were twice as powerful as the most powerful supercomputer on the planet, and a lot cheaper.

There are several approaches to achieve verifiable computing. Amongst them, the most popular is probably verification by replication which is used by most blockchain systems today. However, carrying out redundant computation is both slow and expensive. New approaches to verifiable computing include use of Trusted Execution Environments (TEEs) and Zero-Knowledge Proofs (ZKPs). Marlin offers access to both of these technologies through its Oyster and Kalypso sub-networks.

In the context of designing decentralized systems, verifiable computing is useful for both smart contract and web 2 based browser access patterns.

  1. Smart contracts:

    For use in smart contracts, a verifiable computing protocol deploys a relay and verification contract on-chain. The relay contract registers job requests from other contracts and adds them to a queue. An off-chain network of gateways listen to events emitting from the job registration contract and assign jobs to worker nodes in accordance with the protocol’s work distribution logic.

    Similarly, once the worker nodes are done processing the request, they themselves or with the help of gateway nodes submit the response back on-chain. In order to convince consumer contracts that computation was done correctly and thus can be used for further processing reliably, the output is often accompanied by a proof. Outputs are registered on-chain and the corresponding worker nodes are paid only if the proof successfully passes the checks in the verification contract.

    In the case of TEEs, the verification contract would normally check for enclave attestations by the TEE hardware manufacturer while for ZK systems, it checks for the validity of the ZK proof.

  2. Browser or mobile apps:

    SDKs or libraries built for browser and mobile apps help them communicate with relay smart contracts or gateways as the case may be to relay the request and receive responses. Similar to the case above, verification logic built into the SDK or library can ensure that only valid responses are accepted.