Today we are talking about ๐
Modulus Labs
Quick Takeaways ๐
ZK-ML Innovation: They are leading the way in researching and understanding current ZK-ML ecosystem applications.
Product Launches: Successfully introduced three products, highlighting the diverse applications and strengths of ZKML technology.
Strategic Collaborations: Partnered with key players like Lyra Finance, Astraly, Aztec Protocol, and Matchbox DAO.
What is Modulus Labs solving for? ๐
Modulus Labs is developing zero-knowledge machine learning solutions, enabling trustful integration of AI outputs into blockchain systems without revealing sensitive data or model details.
What is ZKML first of all?
ZKML leverages zero-knowledge cryptographic proofs to validate the outputs of machine learning models without revealing the specific inputs or the model's inner workings.
Why is it needed?
Privacy & Confidentiality: Some ML inputs or the model parameters can be sensitive and private. ZKML ensures they remain hidden.
Trust & Verification: For many applications, especially in decentralized systems, it's essential to verify that a machine learning model genuinely produced an output without exposing the model or its input.
How does it work in the context of blockchain applications?
Instead of running computationally intensive ML models on-chain, which is often infeasible due to resource constraints, ZKML allows these models to run off-chain.
Once the model produces an output, a zero-knowledge proof (like zkSNARK) is generated, which essentially says, "Trust me, the model genuinely produced this output given a certain input."
This proof is then verified and used on-chain, like in a smart contract, allowing these contracts to make decisions based on ML outputs without ever seeing the model or its input directly.
Benefits of AI on-chain
Increased Intelligence: By integrating ML outputs through ZKML, smart contracts can make more informed and dynamic decisions.
Flexibility: Rather than just using static rules, smart contracts can adapt based on real-world data.
Efficiency & Scalability: Since the actual ML computations happen off-chain, we sidestep the high computational costs associated with direct on-chain processing.
Use-cases of ZKML
Letโs also quickly run-through a few use-cases of the ZKML technology:
Kaggle, But Decentralized
Imagine selling or competing with your machine learning model without showing all its secrets. zkML lets you prove your model's good without spilling the beans on how it works.
Filtering the Noise in Web3 Social Media (think Twitter algo)
With web3, there's gonna be lots of spammy posts. zkML helps social media platforms use community-approved filters, showing proof they're working right without everyone knowing the exact recipe.
Fraud Monitoring
Instead of waiting for humans to spot shady stuff, zkML helps deploy machine learning to sniff out possible scams in smart contracts.
Personalized Advertising
Receive tailored ads using zkML, ensuring personalized experiences while safeguarding your data privacy
You can even possibly get paid for it.
In addition, the table below outlines various interpretations of the intersection between AI and blockchain, offering descriptions and potential use cases for each crossover.
Projects by Modulus
Iโll dive deep into the different projects being built by the Modulus team.
Theyโve already launched three exciting ones:
Rockybot - First Fully On-Chain AI Trading Bot
Leela vs The World - First On-Chain AI Game
zkMon - First On-Chain AI Artist
Letโs understand them better ๐
Rockybot - First Fully On-Chain AI Trading Bot
The bot is the first fully on-chain AI trading bot developed by Modulus Labs, operating on Ethereum. (discontinued for now)
It used to analyse historic price data between WEth and USDC, with all the operations validated on-chain backed by a three-layer feed-forward network.
Basically, Rocky is a fully autonomous agent, it runs without interference, even Modulus Labs canโt go ahead and tamper with it. Its operations are transparent, driven by a public algorithm.
Use-cases and Idea Behind It:
Rocky wasnโt designed as a guaranteed profit-making entity. But instead, it served as a technical showcase, aiming to:
Demonstrate the feasibility of deploying verifiable AI inferences on-chain.
Offer a tangible, interactive experience for those curious about on-chain AI.
Ofcourse, not everything is a positive - there are a few limitations as well.
L2-L1 Communication: There are delays between Rocky's decisions on L2 and their verification on L1.
Data Approximations: Handling floating-point numbers required approximations due to field element limitations.
But all in all, this was a great experimental bot built by the team to test the hypothesis of how does it even look like of actually having AI on-chain.
Check out Rockybotโs website (the bot is closed for now though) & explore the medium article.
Leela vs The World - First On-Chain AI Game
Leela vs the World, is the first on-chain AI game where the community (The World) competes against an AI (Leela) in a game of chess.
The AI's moves are transparent, unchangeable, and validated by a verifier contract ensuring trustless gaming. Itโs based on the open-source Chess agent - Leela Chess Zero (LC0).
Players can bet on either the human team or Leela.
Post-match, the winnings are distributed proportionally to the winners based on their stake.
Unclaimed stakes roll into the next game.
Hereโs a flow-chart to explain it better
Tech details & constraints:
Model Adjustments: The team used a compact LC0 variant with quantized elements for zk proving.
Proving System: Leela was built using the Halo2 proving system, which basically offers design flexibility but it also had speed and cost challenges.
Key Takeaways
Beyond engagement, the game pioneers trustless gaming through on-chain implementation and zero-knowledge proofs, ensuring unmatched fairness.
However, the journey wasn't without its technical challenges, particularly where there was a need to balance a sophisticated AI within the constraints of on-chain proving.
Yet, this provides us a glimpse into the expansive future of on-chain gaming, especially emphasizing community interaction.
You can play the game Leela on the website. Check out the overview on medium
zkMon - First On-Chain AI Artist
zkMon is the world's first zero-knowledge proven Generative Adversarial Network (zkGAN) NFT collection, bringing AI art generation and verification directly on-chain.
By integrating zK-proofs, the aim is bring authentication and transparency to the AI art generation process.
It is revolutionizing the NFT landscape by enhancing blockchain's cryptographic security to authenticate AI art origins, seamlessly integrating off-chain art creation with on-chain verification.
Challenges & Exploration:
Technical Hurdles: Overcoming blockchain's computational demands to enable on-chain AI was a significant challenge faced by the zkMon team.
Value Perception: The zkMon initiative brings added cryptographic strength, but will the market perceive this as added value? The NFT space's acceptance is still an open question.
This was a joint initiative by Modulus Labs & the Polychain Monsters team. Check out the details here.
Overview of the Cost of Intelligence paper
The team has worked on putting out "paper0", funded by the Ethereum Foundation.
The research dives deep into the challenges and costs of integrating machine learning on the blockchain.
Challenges with AI on Blockchain:
No on-chain neural networks exist due to high costs.
Minimal operations can cost hundreds of dollars.
The paper examines using rollup services and zero-knowledge proofs to mitigate these costs.
Paper's Main Findings:
The performance of AI almost always scales with the model size, which makes implementation on the blockchain particularly challenging.
Current ZKPs can support smaller AI models, but larger models are still problematic
Benchmark Details:
The paper centers around two primary metrics for any zero-knowledge proof system:
Proof generation time: Time taken to create a proof corresponding to an AI inference.
Peak prover memory usage: The maximum memory used to generate an inference proof.
These metrics were chosen based on practical applications and feasibility for trustless AI use.
Six proof systems were tested and analyzed. Hereโs a breakdown about them ๐
Letโs check out how the results performed for the different proof systems ๐
So, what were the results?
Plonky2 is the fastest but uses more memory than Halo2.
For both time and memory, zkCNN is best for larger models.
For a broader understanding & analysis, please do check out the paper here
Team
Itโs a stacked team of researcher, builders & advisors.
Hereโs an overview about them๐
Core Team:
Nick Cosby
Part-time Researchers:
Allison Qi
Advisors
Zhang Zhenfei (EF)
Riad Wahby (CMU)
Rand Hindi (Zama)
Partnerships & Support
The team has been working across the board with numerous projects & funds to drive the developments.
A few of them are
Lyra Protocol
Modulus Labs will be collaborating with Lyra to enhance their Automated Market Maker (AMM) with intelligent features.
The goal is to increase the capital efficiency of the Lyra Protocol
Astraly (discontinued)
Modulus Labs was collaborating with Astraly to develop an AI-based reputation system.
They planned to utilize clustering models to discern user/project traits, badges, and historical behaviors to trustlessly compute reputation ratings.
Though this is discontinued now & Astraly has taken a pivot into building a ZK orcale infrastructure for Pragma
Aztec Protocol
Aztec might be forced implement practices that could reduce the efficiency of their service, such as lowered transaction speeds and transaction limits.
Modulus Labs is collaborating with Aztec to develop trustless AI-driven compliance features at the contract level, aiming for contract-level compliance tools using Machine Learning.
Matchbox DAO
Modulus Labs & Matchbox DAO researched & gathered insights on trustless AI for enhanced on-chain gaming.
They proposed innovative game mechanics, such as chatbot-generated dialogues, AI-controlled in-game economies, and AI alliances
Polychain Monster
The team worked together on developing the first on-chain AI artist.
Flood gate ventures: Theyโve helped them day one by working closely & providing the relevant resources & connections
What next for Modulus Labs?
They are working on the โRemainderโ paper - which will be published soon!
They are working on building the world's fastest zk-AI prover, aiming for a performance that's over 10x faster than current solutions.
A key goal for them is also exploring transparent intelligence, ensuring decentralized services not only maintain but enhance their trust and reliability.
They are looking forward to building AI-powered protocols that can autonomously administer compliance and security, including
biometric recovery
authentication for dApps interaction
How to get involved?
Thank you for taking the time to learn more about Modulus Labs & all the awesome research / developments theyโre doing across the ZK-ML space.
If youโd love to learn more, check them out ๐
References
Ofcourse, overall itโs an ecosystem still in development, but am super excited about it - probably because of my past data science background? maybe, maybe not :)
This is a great 101 to ZKML kinda list to get started.
Do reach out to have any discussions / share any ideas if youโd have.
A few research pieces to definitely check out:
zkML: Evolving the Intelligence of Smart Contracts Through Zero-Knowledge Cryptography
Checks and balances: Machine learning and zero-knowledge proofs