Skip to main content

zkML

The ability to prove the inference of a ML model on chain via zk-SNARKs will be one of the most important advancements in smart contracts since their inception. The deployment of this technology will blow the smart contract design space wide open - it will allow applications and infrastructure to become dynamic, evolving into more complex and intelligent systems.

The addition of ML capabilities will allow smart contracts to adjust to real-time on-chain data. This will be a marked improvement from the status quo in which smart contracts are deployed and their parameters remain static in perpetuity. This allows smart contracts to adapt to conditions that were not foreseen when the smart contract was written. The addition of ML capabilities to smart contracts will broaden the automation, accuracy, efficiency, and flexibility of any code deployed on-chain.

The primary bottleneck to ML functionality on-chain is the high computational cost of running these models on-chain – in particular, the inference phase of machine learning brings about a computational burden that the EVM cannot handle. The solution to this problem is zk-SNARKs. It’s feasible to run the computation off-chain and then generate a succinct and verifiable proof illustrating the intended model produced a particular result. This proof is then published on-chain and the smart contract is then licensed to adjust their parameters according to the new information.

zkML can enable applications such as:

  1. Verifiable off-chain ML oracles: The adoption of generative AI will push industries to attach zk-signatures to their content. The signed data is now composable and trustworthy. The ML models can process this signed data off-chain to make predictions and classifications, which can then be used to trustlessly settle real-world prediction markets, insurance protocol contracts, and more through the verification of the inference and publication of the proof on-chain.

  2. ML parameterized DeFi: The automation of DeFi parameters - LTV, liquidation threshold, borrow rate - will increase the capital efficiency as well as the stability of the DeFi ecosystem. These parameters are currently determined by private off-chain models. In the future, this could be a community trained open-source ML model that publishes proofs on-chain.