🔐 What if you could prove your trading strategy was profitable — without revealing the strategy itself?
zkBacktest is live on my GitHub. Here's what it does. 🧵
---------------------------------------------------------
TL;DR ✅
📊 Prove correct backtests of trading strategies over committed price data
🔒 Keep your strategy private — nobody sees your Pine Script
⚙️ Two proof backends: Winterfell AIR (custom STARK) + RISC Zero zkVM
✨ Blake3-committed dataset — no cherry-picking bars
🧮 In-circuit financial metrics: total return, Sharpe ratio, max drawdown
🚫 No-look-ahead enforced as a circuit invariant
---------------------------------------------------------
🔍 What is zkBacktest?
You write a trading strategy. You run it against historical price data. You get a ZK proof that says: "This secret strategy, on this exact public dataset, produced these exact results."
No trust needed. No fake backtests. No reveal of your strategy. Just math.
---------------------------------------------------------
⚔️ Why it matters:
Backtesting has a credibility problem. Anyone can show you a pretty equity curve and claim their strategy worked. Without verifiable execution, it's hard to know what's real.
zkBacktest addresses this directly: The proof commits to the dataset via
#Blake3. The circuit enforces causal order: bar `t` cannot see bar `t+1`. Cherry-picking is structurally impossible.
---------------------------------------------------------
⚙️ How it works — two backends:
Phase 1,2:
#Winterfell AIR (
#STARK)
Custom STARK over the Goldilocks field. Strategy parameters are public. The AIR circuit verifies prices, positions, returns, and drawdown peaks across the trace. All constraints are degree ≤ 2.
Phase 3:
@RiscZero zkVM
A
#PineScript subset interpreter runs inside a zkVM. Strategy is private witness. Only the public journal is revealed: total return, Sharpe, drawdown, dataset, and its commit.
The verifier cannot see your strategy. That's not a feature; it's a cryptographic guarantee. 🔒
---------------------------------------------------------
🧩 The interesting part:
No-look-ahead isn't enforced by convention; it's a circuit invariant.
You cannot encode a look-ahead bug. The circuit won't allow it 🙅♂️
And the dataset commitment? Blake3 hash of every bar, in order. Swap one bar: proof breaks.
---------------------------------------------------------
🚀 Why this matters long-term:
On-chain strategy marketplaces where sellers prove performance without revealing alpha. DeFi vaults that publish verifiable backtests before accepting capital. Quant funds where "here's a ZK proof" replaces "trust me."
ZK applied to finance is still early. But the primitive is here.
---------------------------------------------------------
Would you use something like this to verify a strategy before trusting a vault? Curious what people think. 👇
#ZK #ZKP #Ethereum #Cryptography #DeFi #STARK #RiscZero $ETH #zkBacktest @Starknet @EliBenSasson @SuccinctLabs @pumatheuma