What is ZKML — and Why Does It Matter?
Imagine using an AI model to approve a loan or verify a piece of news — but without anyone seeing the input, the output, or the model itself. Sounds like magic? That’s ZKML in action.
This article is part of my personal learning journey — I’m not part of the Giza team, just a curious builder who learns best by documenting and teaching others. If you’re like me and enjoy unpacking emerging tech by writing it out, then you’re in good company.
Let’s explore:
What ZKML actually isWhy it’s a game-changer in web3 and AIHow it works under the hoodPractical use casesA glimpse into the future (and where Giza fits in)
What is ZKML?
ZKML = Zero-Knowledge + Machine Learning.
It allows you to prove that a machine learning model was run correctly without revealing:
the input datathe model weightsor even the output
In short: “You can verify the result, without knowing the details.”
Think of it like showing someone you solved a Rubik’s cube without them watching — but they can still verify it was solved fairly.
Why Does ZKML Matter?
1. Trust Without Transparency
Most ML models today are black boxes. ZKML proves they worked correctly, without showing what’s inside.
2. Privacy
Healthcare? Finance? Personal data? ZKML ensures the model’s inputs remain private.
3. Onchain Verification
ZKML allows AI outputs to be verified on-chain without rerunning the model.
Imagine a game that uses AI enemies. With ZKML, their decisions can be proven fair — even if the logic is hidden.
How Does ZKML Work?
Here’s a simplified flow:
Train a Modelimport torch
model = torch.nn.Linear(2, 1) # simple linear model
2. Compile Model to a Provable Circuit
Using Giza or another compiler, convert your model to Cairo (or a ZK-friendly format):
giza compile model.onnx –output model.cairo
3. Run Inference + Generate Proof
giza prove –input input.json –model model.cairo –output proof.json
4. Verify Proof (onchain)
@external
fn verify_prediction(proof: Proof) -> bool {
assert(is_valid_proof(proof));
return true;
}
Use Cases
Healthcare: Private diagnosis validation
Finance: Verifiable credit scoring
Gaming: AI logic for enemies that can’t cheat
Identity: Proof-of-personality or proof-of-reputation
Oracles: Onchain DeFi platforms using ML signals
Projects Leading the Way
This isn’t an endorsement — just part of what I’ve been exploring while learning.
Giza Protocol
Compiles PyTorch models to CairoVerifies ML outputs on Starknet
EZKL
Uses Halo2-based proofs for ONNX models
Modulus Labs
Research-focused ZKML tooling
Giza from a Learner’s Perspective
Giza caught my attention because:
I could still use familiar ML tools like PyTorchI could learn Cairo while applying AI conceptsIt shows how real ZKML systems might work in practiceAgain, I’m not affiliated with them — just documenting how their tooling helps me think through ZKML better.
The Future of ZKML
More efficient proof generationRicher model supportTooling to train, prove, and deploy seamlessly
ZKML may soon become a standard for responsible, verifiable AI — especially in decentralised systems.
Final Thoughts
ZKML isn’t just theory. It’s a powerful new way to build trust in AI systems, especially in blockchain.
If you’re passionate about:
AIPrivacyWeb3Cairo/Starknet
… then ZKML is a playground worth exploring.
As for me — I’ll keep learning by writing.
Let’s Connect
Are you trying Giza or EZKL?
Working on your own ZKML setup?
Trying to understand how ZK and ML come together?
Let’s learn together. Drop a comment or say hi on X/Twitter. I’d love to swap notes and questions.
What is ZKML — and Why Does It Matter? was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.