Blockchain technology and machine learning are two highly regarded fields that are leading technological advancements with their decentralized characteristics and data-driven capabilities. In blockchain technology, ZK (Zero-Knowledge) is a concept in cryptography that refers to a proof or interactive process where the prover can prove the truthfulness of a statement to the verifier without revealing any specific information about the statement. ML (Machine Learning) is a subfield of AI. Machine learning learns from input data, summarizes it to form models, and can make predictions and decisions.
In this context, the combination of ZK and ML, known as ZKML (Zero-Knowledge Machine Learning), has been flourishing recently. ZKML combines the privacy protection and verification capabilities of zero-knowledge proofs with the data processing and decision-making abilities of machine learning, bringing new opportunities and possibilities to blockchain applications. ZKML provides a solution that simultaneously protects data privacy, verifies model accuracy, and enhances computational efficiency.
This article will delve into ZKML, exploring its technical principles and application scenarios, and uncovering how ZKML is building a more comprehensive, secure, and efficient digital future while protecting privacy.
ZKML: The Combination of Zero-Knowledge Proofs and Machine Learning
There are two reasons why zero-knowledge proofs and machine learning can be combined on the blockchain:
Firstly, in addition to achieving efficient verification of on-chain transactions, the developers of ZK hope to use ZK in a broader ecological field, with the powerful AI support of ML serving as an excellent enabler for the expansion of ZK applications.
Secondly, the entire process of developing and using ML models faces trust and proof problems. ZK can help ML achieve effectiveness without leaking data and information, solving the trust dilemma of ML. The combination of ZKML allows both parties to benefit and contributes energy to the blockchain ecosystem.
Complementary Development Needs and Capabilities of ZK and ML
ML has a lot of trust-related issues that need to be addressed, including proving the accuracy, integrity, and privacy of various workflows. ZK can efficiently verify the correctness of any kind of computation while ensuring privacy, effectively solving the long-standing trust proof problem in machine learning. Model integrity is an important trust proof issue in the ML training process, but the protection of data and information privacy in ML training and usage is equally important. This makes it difficult for ML training to undergo trust proof through third-party auditing and regulatory organizations. The decentralized and zero-knowledge nature of ZK provides a highly compatible trust proof path with ML.
"AI enhances productivity, blockchain optimizes production relationships", ML injects higher innovation momentum and service quality into the ZK track, and ZK provides verifiability and privacy protection for ML. ZKML complements each other in the blockchain environment.
Technical advantages of ZKML
The main technical advantages of ZKML combine computational integrity, privacy protection, and heuristic optimization. From a privacy perspective, the advantages of ZKML are:
Transparent verification
Zero-knowledge proofs (ZK) can evaluate model performance without exposing internal details of the model, achieving transparent and trustless evaluation processes.
Data privacy protection
ZK can be used to verify public data using public models or verify private data using private models, ensuring data privacy and sensitivity.
ZK itself ensures the correctness of a statement while ensuring privacy through cryptographic protocols, effectively addressing the shortcomings of privacy protection in both machine learning with computational correctness proofs and homomorphic encryption machine learning. By incorporating ZK into the ML process, a secure and privacy-preserving platform is created, solving the limitations of traditional machine learning. This encourages privacy companies to adopt machine learning technology and motivates Web2 developers to explore the potential of Web3 technology.
ZK Empowers ML: Providing On-Chain Infrastructure
The constraints of on-chain computing power for ML and ZK-SNARKs
The reason why ML, which is already mature off-chain, has just entered the on-chain space is due to the high cost of blockchain computing power. Many machine learning projects cannot run directly in blockchain environments, represented by the EVM, due to computing power limitations. While the effectiveness verification of ZK is more efficient than repetitive computation, this advantage is limited to the native transaction data processing of the blockchain. When ZK faces a large number of computations in ML, the low TPS problem of the blockchain is exposed, and the low computing power of the blockchain becomes the biggest constraint hindering ML's on-chain implementation.
The emergence of ZK-SNARKs alleviates the high computational demands of ML. ZK-SNARKs, short for "Zero-Knowledge Succinct Non-Interactive Argument of Knowledge," is a cryptographic construct for zero-knowledge proofs. It is a technology based on elliptic curve cryptography and homomorphic encryption, used to achieve efficient zero-knowledge proofs. ZK-SNARKs are highly compact, allowing the prover to generate a short and concise proof, while the verifier only needs to perform a small amount of computation to verify the proof's validity, without multiple interactions with the prover. This property of requiring only one interaction between the prover and verifier makes ZK-SNARKs efficient and practical in real-world applications, making them well-suited for the computational demands of ML on the blockchain. Currently, ZK-SNARKs are the main form of ZK in ZKML.
ML on-chain infrastructure requirements and corresponding projects
The empowerment of ML by ZK primarily lies in the zero-knowledge proofs throughout the entire ML process, enabling the interaction between ML and on-chain functionality. The two major problems to be solved by this interaction are the alignment of the data format between the two and providing computational power for the ZK proof process.
ZK hardware acceleration: ZK proofs in ML are relatively complex, requiring hardware-assisted on-chain computational acceleration for the proof calculations. Projects in this category include: Cysic, Ulvetanna, Ingonyama, Supranational, Accseal.
ML on-chain data processing: Transforming on-chain data into a format suitable for ML training, and facilitating easier access to ML output results from the blockchain. Projects in this category include: Axiom, Herodotus, LAGRANGE, Hyper Oracle.
ML circuitization: The computation mode of ML differs from the on-chain circuitized proofs of ZK. To bring ML on-chain, its computation mode needs to be transformed into a circuit form that can be processed by the blockchain's ZK. Projects in this category include: Modulus Labs, Jason Morton, Giza.
ML proving in ZK: The trust proof problem of ML needs to be solved on-chain through ZK. Applications based on ZK-SNARKs constructed on Risc Zero or Nil Foundation can achieve model authenticity proof. Such projects include: RISC Zero, Axiom, Herodotus, Delphinus Lab, Hyper Oracle, Poseidon ZKP, IronMill.
ML empowering ZK: Enriching Web3 application scenarios
ZK solves the trust proof problem of ML and provides on-chain opportunities for ML. Many Web3 fields urgently need the productivity or decision support of AI ML. ZKML enables on-chain applications to achieve AI empowerment while ensuring decentralization and effectiveness.
DeFi
ZKML can help automate DeFi, including the automation of on-chain protocol parameter updates and trading strategies.
Modulus Labs has launched RockyBot, the first fully on-chain AI trading robot ever.
DID
ZKML can empower the construction of decentralized Web3 identity DID. Previously, identity management patterns such as private keys and mnemonic phrases have resulted in poor Web3 user experience. Real DID construction can be completed through ZKML for the identification of Web3 subjects' biometric information. At the same time, ZKML can ensure the security of user biometric information privacy.
Worldcoin is applying ZKML to achieve zero-knowledge DID verification based on iris scanning.
Gaming
ZKML can help Web3 games achieve full functionality on-chain. ML can bring differentiated automation to game interactions, increasing the fun of games, while ZK can make ML's interactive decisions on-chain.
Modulus Labs has launched @VsLeela, a chess game driven by ZKML;
AI ARENA has implemented high interactivity of on-chain NFT games using ZKML.
Healthcare and Legal Consultation
Healthcare and legal consulting are highly private and require a large accumulation of cases. ZKML can help users make decisions and ensure the privacy of users is not compromised.
Challenges Faced by ZKML
ZKML is currently thriving, but it faces two main challenges due to not being native to blockchain and requiring a lot of computational power:
Parameter distortion issue during ML data quantification on the chain:
Most ML models use floating point numbers to represent parameters, while ZK circuits require fixed-point numbers. During this conversion process, the precision of ML parameters may be reduced, leading to distortion in the output results of ML to some extent.
High computational power requirements for large-scale ZK proofs of the big model:
The current computational power of blockchains cannot handle large-scale ZKML with high computation. The popular ZK-SNARKs currently only support small-scale and relatively low computation ML zero-knowledge proofs. Computational power limitations are a key factor affecting the development of ZKML blockchain applications.
The calculation complexity of the ZK proof generation stage is high and requires a large amount of computational resources. Due to the high correlation between the data that the ZK proof stage usually needs to access and process, this process is difficult to be distributed and cannot be "parallelized". Distributing this process may introduce additional complexity and even reduce overall performance. Currently, the mainstream research directions for solving the efficiency problem of ZK calculations are more focused on algorithm optimization and hardware acceleration.
Conclusion
ZKML is a two-way commitment of zero-knowledge proof and machine learning. The emerging blockchain technology ZK helps ML solve trust proof problems and provides an on-chain environment for ML. Mature AI technology ML helps ZK realize the expansion of the Web3 ecosystem and application innovation.
ZKML faces some challenges, such as the parameter distortion issue and high computational power requirements for large models. However, these problems can be solved through technological innovation and hardware acceleration. With the continuous emergence and development of ZKML projects, we can anticipate that it will bring more innovation and value to the Web3 ecosystem in areas such as DeFi, DID, gaming, healthcare, etc.
In the future, ZKML is expected to become the key that truly unlocks the fusion of Web3 and AI, providing strong support for further building secure, privacy-protected, and efficient blockchain applications. By combining the zero-knowledge nature of ZK and the data processing capabilities of ML, we will definitely be able to create a more open, intelligent, and trustworthy digital world!