@oskarth, ZK Summit 2024
Let's put the "Zero Knowledge" back in ZK.
Note:
A lot of focus on ZK for succinctness in L2 context,
Not enough for many apps where you want privacy or interop.
Let's look at examples
Note:
ZK identity solution: has to be mobile, 95% usage
Zuzalu last year, Devconnect and more this year
Allowed you to catch frogs (ECDSA signatures), need mobile
Note:
Anon-Aadhaar project to do ZK on this
Take traditional ID thing and permissionlessly use
RSA verification in PDF
Selective disclosure, Gitcoin Passport/PoH
Other similar solutions, proof of passport EU, japan etc
This is a lot more complex in terms of circuits
Note:
Outside of ZK-Identity, a big one is fungible money
Bitcoin origin, make like cash, private txs
Private finances more generally
Also private social networks
And ZK-ML projects use priv data photos, hackathon
User wants to generate proof on their phone
Note:
What properties we want?
Trust-minimized and secure, user gen proof
Fast: ECDSA/RSA ~1m constraints, much bigger than Semaphore, good UX
Helps with large anonymity sets
Should just work incl on all devices (accessible)
easy, good devex
Note:
When I say mobile, I don’t just mean browsers
Why bother?
OS-level security (secure storage, biometric auth); Isolation - important for secrets like real-world id! Not webview
Native perf; multi threading, GPU; can get on browser but limited
Better integration with camera/sensors/secure enclave/push notif; more native and fluent experience
Tradeoff: no need app ok; poss censorship; platform specific; complex to develop app, esp ZK
Leads us to mopro
Note:
Modularity - easy to add proof systems
Dev friendly fast to get started
Fast proving
Works on many platforms
# Create a Circom project with iOS and Android support
mopro init --platforms ios, android
# Prepare circuit and artifacts
mopro prepare
# Build for iOS
mopro build --platforms ios
# Also options for testing, exporting bindings, etc
Note:
New, main interface point
Get started in under 5m
> tree -L 1
.
├── README.md
├── android # Android project
├── core # Circom circuits, Rust wrapper
├── ios # iOS project
├── mopro-config.toml # Project config
├── ptau
└── target
[build]
ios_device_type = "device" # x86_64, simulator, device
android_device_type = "arm64" # x86_64, x86, arm, arm64
build_mode = "release" # debug, release (recommended)
[circuit]
dir = "core/circuits/keccak256"
name = "keccak256_256_test"
ptau = "19"
[dylib]
use_dylib = true # true, false
name = "keccak256" # Name of the dylib file
Note:
Specify relevant options
Note:
Generate some example app with basic proving/verifying
We'll look at more examples later
Note:
We can think of this flow as multiple layers
Starting with the user, then app, tooling, then towards proving systems and computer science
Let's zoom in
(Skip this slide?)
Note:
The key idea is separation of concerns, modularity
A user has no brain, they just want to use an app
Circuit dev only cares circuit, and likewise app dev
A lot of things going on: Circom circuits, mopro-core, circom-compat, arkworks, mopro modules, UniFFI bindings, Swift library, iOS app…
We take a slice of one thing at each layer (proof system, platform)
How do all of these things fit together?
Most widely used DSL for client-side proving
Note:
mopro prepare, compile, run trusted setup, gen arkzkey
Bring your own circuit setup
Note:
Trivial to add new adapters, WIP
.wasm/dylib for witness calc with wasmer, arkzkey
wt
Note:
Foreign function interface
Recently added Android
RN support separate via bridge from Yanis PSE
Note:
How do we build complex cross-platform applications?
What Firefox developed to build complex cross-platform applications
More modern version of cbindgen
Keep business logic in Rust
With native binds can make app
Note:
In the end you have an app like Anon-Aadhaar
Will get back to later
Just wants things to work
Note:
Users have no brain, just want things to work
This means fast proofs, few actions etc
Create experiences that hide ZK voodoo and integrate seamlessly into app and user’s life
Making life of app developer easy
Note:
Can only focus on so much at a time
UX, App development, Swift libraries, architectures/linking, Rust, ZK, circuits, proving systems, infra…
Requires a lot of people, and doing this takes away from focusing on "business problem"
With mopro, we split this up and create tooling to allow developers to focus on their area of expertise
Details not important; make life easy
# Create a Circom project with iOS and Android support
mopro init --platforms ios, android
# Prepare circuit and artifacts
mopro prepare
# Build for iOS
mopro build --platforms ios
# Also options for testing, exporting bindings, etc
Note:
Write your circuit
UniFFI ibindings, can test in isolation
Xcode painful
App dev POV: No Rust/ZK, just another app
Embed Rust lib, hide complexity, linking/architecture, Cocoapods etc
Note:
Modularity as a design goal; Easy to add new platforms; new proof system (wrap Rust API+expose bindings)
Rust fast, secure, flexible, developers
Not tied to some specific proof system, whatever is useful to people, agnostic
Note:
Three main areas of focus
Proof of passport cool, also similar Myna JP
Late last year, increase complexity due to sel disc/nullifier
Note:
Memory biggest bottleneck, up to 4GB OK
Not gonna go into other perf details
10s witness gen, ~20s prover time, load zkey, smalelr zkey arkzkey
Other proof systems and techniques
Next part coming up
Note:
ZK-ML hackathon Oxford Confidenti used
GH user or TG
Foundry for ZK
Note:
RN integrate better, desktop/web
Proof systems Kimchi PoC wknd
Halo2/Noir, some interest, Nova, VOLE, binius?
Perf: Native wtns gen, GPU grant WIP, load zkey
Also docs/API
Note:
Everything from upstream deps, main contributions and downstream
Note:
Qs?