Skip to content

Commit f616a6a

Browse files
committed
Add zk-jam-service grant application
1 parent 9aa8c65 commit f616a6a

File tree

1 file changed

+320
-0
lines changed

1 file changed

+320
-0
lines changed

applications/zk-jam-service.md

Lines changed: 320 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,320 @@
1+
# zk-jam-service: ZK Proof-of-Concept for JAM
2+
3+
- **Team Name:** abutlabs
4+
- **Payment Details:**
5+
- **DOT Address (AssetHub):** 15AWQjAZ9Ev9uhcYJdfwQzXA2VRDn2oLgZTkBzRRT7sZNDgs
6+
- **USDC Address (AssetHub):** 15AWQjAZ9Ev9uhcYJdfwQzXA2VRDn2oLgZTkBzRRT7sZNDgs
7+
- **Level:** 1
8+
9+
## Project Overview :page_facing_up:
10+
11+
### Overview
12+
13+
**zk-jam-service** is a proof-of-concept ZK verification & benchmarking service for JAM (Join-Accumulate Machine) that demonstrates how zero-knowledge proofs can be verified within JAM's unique Refine → Accumulate architecture.
14+
15+
- **Tagline:** Educational ZK proof verification for JAM — learn by building. Benchmark various ZK proofs running natively and on polkajam-testnet
16+
17+
- **Description:** Building towards a public good that (1) implements ZK proof verification in a JAM service, (2) provides comprehensive documentation for JAM developers, (3) offers an interactive web dashboard for exploring ZK verification on testnet, and (4) provides a solid basis for a future production ready zk-jam-service
18+
19+
- **Relation to Polkadot:** JAM is Polkadot's next-generation execution environment. This project explores ZK integration patterns that will benefit future JAM service developers across the ecosystem.
20+
21+
- **Motivation:** JAM represents a paradigm shift in blockchain computation, but developer resources are scarce. I want to learn JAM deeply, document my journey, and create re-usable examples that lower the barrier for others.
22+
23+
### Project Details
24+
25+
#### Current Progress (Phases 0 Complete)
26+
27+
I have built and locally deployed a functional JAM service to Parity's polkajam binary here: [zk-jam-service](https://github.com/abutlabs/zk-jam-service)
28+
29+
- **Blake2s-256 hash verification service** — Demonstrates the full Refine → Accumulate pipeline
30+
- **CLI tooling** — TypeScript tools for submitting work items and querying state
31+
- **Web dashboard** — Next.js application with:
32+
- Interactive verification form
33+
- Block explorer showing verification history
34+
- Educational content designed for forking and experimentation
35+
36+
**Live Screenshots:**
37+
38+
![Hash Verification UI](./docs/images/HashVerify.png)
39+
![Block Explorer](./docs/images/Explorer.png)
40+
![Learn Page](./docs/images/Learn.png)
41+
42+
#### Technology Stack
43+
44+
| Component | Technology |
45+
|-----------|------------|
46+
| JAM Service | Rust (`no_std`), PolkaVM (RISC-V target) |
47+
| CLI Tools | TypeScript, Node.js |
48+
| Web Dashboard | Next.js 14, shadcn/ui, Tailwind CSS |
49+
| Testnet | Parity's PolkaJam (6-validator local testnet) |
50+
51+
#### Architecture
52+
53+
```
54+
┌─────────────────┐ ┌─────────────────────────────────┐ ┌──────────────┐
55+
│ Off-Chain │ │ JAM Network │ │ On-Chain │
56+
│ Prover │ submit │ ┌─────────┐ ┌────────────┐ │ finalize│ State │
57+
│ │ ───────>│ │ REFINE │───>│ ACCUMULATE │ │────────>│ │
58+
│ Generate proof │ work │ │ (6s) │ │ (<10ms) │ │ │ Immutable │
59+
│ │ item │ │ Verify │ │ Update │ │ │ Receipt │
60+
└─────────────────┘ │ └─────────┘ └────────────┘ │ └──────────────┘
61+
└─────────────────────────────────┘
62+
```
63+
64+
#### ZK Integration Strategy
65+
66+
**The Reality:** The most battle-tested, optimized ZK implementations exist in C++. Aztec's Barretenberg, libsnark, and similar libraries represent years of cryptographic research and performance tuning. However, JAM services run on PolkaVM—a RISC-V execution environment requiring `no_std` Rust, with no FFI support.
67+
68+
**Our Pragmatic Approach:**
69+
70+
| Approach | Feasibility | Risk | This Grant |
71+
|----------|-------------|------|------------|
72+
| **Rust-Native (Arkworks)** | High | Low | Primary focus |
73+
| **C++ → RISC-V Compilation** | Medium | Medium | Research & document |
74+
| **Custom Circuits** | Low | High | Out of scope |
75+
76+
**Primary Path (Milestone 1):** We integrate Arkworks—a mature Rust ZK library with full `no_std` support. This provides immediate, working ZK verification on JAM.
77+
78+
**Research Path (Milestone 2):** We investigate compiling C++ ZK libraries (specifically Barretenberg) to RISC-V bytecode for PolkaVM execution. This research benefits the entire JAM ecosystem by documenting:
79+
- What works and what doesn't
80+
- Performance comparisons (native C++ vs PVM-compiled)
81+
- Recommendations for future production services
82+
83+
**Why This Matters:** If C++ → PolkaVM compilation proves viable, JAM gains access to the entire battle-tested ZK ecosystem. If not, we document why and provide the Rust-native alternative. Either outcome advances the ecosystem.
84+
85+
#### What This Project Is
86+
87+
- A **proof-of-concept** demonstrating ZK verification is possible on JAM
88+
- A **benchmarking exercise** comparing native Rust ZK (Arkworks) with experimental C++ compilation paths
89+
- An **educational resource** project built with documentation as a primary focus
90+
- A **testnet tool** for developers to experiment with ZK on JAM and fork
91+
- A **public good** — all code and documentation freely available (Apache 2.0)
92+
93+
#### What This Project Is NOT
94+
95+
- NOT a production-ready, audited ZK verification service
96+
- NOT a complete ZK proving system (proofs generated off-chain by existing tools)
97+
- NOT a token or financial product
98+
99+
### Ecosystem Fit
100+
101+
**Where does this fit?**
102+
- JAM is new infrastructure with limited developer resources
103+
- This project creates foundational learning materials and working examples
104+
- Targets the gap between JAM specification (Graypaper) and practical implementation
105+
106+
**Target Audience:**
107+
- JAM service developers learning the platform
108+
- Upcoming PBA JAM course content
109+
- Researchers evaluating JAM's capabilities
110+
111+
**Needs Addressed:**
112+
- **Learning gap:** JAM documentation is sparse; developers need working examples
113+
- **ZK exploration:** No existing JAM services demonstrate ZK verification
114+
- **Tooling gap:** No web-based tools exist for interacting with JAM services
115+
116+
**Evidence of Need:**
117+
- Various JAM clients are currently in development by various teams. Building JAM services and JAM service documentation is the next step
118+
- We should be giving the various JAM implementation teams easy to use benchmarking tools to compare how their implementation compares to polkajam (binary)
119+
- Polkadot forum discussions highlight need for JAM developer resources and cool projects
120+
- No existing ZK verification services on JAM
121+
- If ZK technology is developed as a public good on Polkadot, the KSM/DOT ecosystem captures the value. We should not wait for someone to privatize this technology
122+
- Developers like myself want to become involved in the ecosystem, after various stages of uncertainty, JAM appears to be the endgame to polkadot's architecture
123+
124+
**Similar Projects:**
125+
- *In Polkadot:* None — JAM is too new for ZK services to exist
126+
- *In other ecosystems:* Aztec (Ethereum), Cairo (Starknet) — but these don't help JAM developers
127+
128+
Aztec's recent success ($60M raised, $557M FDV) validates market demand for ZK infrastructure. This project aims to bring battle-tested ZK technology to JAM, crediting original authors while leveraging JAM's unique architecture for improved performance.
129+
130+
## Team :busts_in_silhouette:
131+
132+
### Team members
133+
134+
- Austin Kloske
135+
136+
### Contact
137+
138+
- **Contact Name:** Austin Kloske
139+
- **Contact Email:** abutlabs@gmx.com
140+
- **Website:** https://github.com/abutlabs
141+
142+
### Legal Structure
143+
144+
- **Registered Address:** N/A (Individual applicant)
145+
- **Registered Legal Entity:** None. If this grant is successful and I continue Web3 Foundation work, I will form a B.V. in the Netherlands.
146+
147+
### Team's experience
148+
149+
**Austin Kloske** — Senior Software Developer & Architect with 15+ years of enterprise software experience.
150+
151+
- **Enterprise Background:** Most of my professional work is in the SAP ecosystem (ABAP, system migrations, complex landscape architecture) where code is proprietary and not publicly visible. I've led large-scale SAP system migrations and worked as an architect for complex multi-system integrations.
152+
- **Relevant Skills:** TypeScript, Rust, Kubernetes, blockchain development, ZK cryptography concepts
153+
- **Polkadot Ecosystem:**
154+
- [PBA-X Wave 1 Graduate](https://assethub-polkadot.subscan.io/account/15AWQjAZ9Ev9uhcYJdfwQzXA2VRDn2oLgZTkBzRRT7sZNDgs) — Completed Polkadot Blockchain Academy coursework
155+
- Polkadot crowdloan participant since 2021
156+
- **This Project:** The [zk-jam-service repository](https://github.com/abutlabs/zk-jam-service) demonstrates my current capabilities — a working JAM service with web dashboard, built from scratch over the past months.
157+
158+
### Team Code Repos
159+
160+
- https://github.com/abutlabs/zk-jam-service (this project)
161+
- https://github.com/abutlabs
162+
163+
### Team GitHub Profiles
164+
165+
- https://github.com/austinkloske22 (personal)
166+
- https://github.com/abutlabs (organization)
167+
168+
### Team LinkedIn Profiles
169+
170+
- https://www.linkedin.com/in/akloske/
171+
172+
173+
## Development Status :open_book:
174+
175+
**Repository:** https://github.com/abutlabs/zk-jam-service
176+
177+
I have already completed significant development work:
178+
179+
| Phase | Status | Description |
180+
|-------|--------|-------------|
181+
| 0.1 Initial Infrastructure | ✅ Complete | Project setup, build pipeline, deployment to PolkaJam testnet |
182+
| 0.2 Hash Verification | ✅ Complete | Blake2s-256 verification demonstrating Refine → Accumulate |
183+
| 0.3 Web Dashboard | ✅ Complete | Interactive UI for verification, exploration, and learning |
184+
| 1.0 Grant Approval | 🔄 This Grant | Web3 Foundation feedback and approval |
185+
| 2.0 Milestone 1 | 🔄 Pending | ZK Proof Verification Integration |
186+
| 3.0 Milestone 2 | 🔄 Pending | Benchmarking & Documentation |
187+
188+
189+
## Development Roadmap :nut_and_bolt:
190+
191+
### Overview
192+
193+
- **Total Estimated Duration:** 2 months
194+
- **Full-Time Equivalent (FTE):** 0.5 (part-time, ~20 hrs/week)
195+
- **Total Costs:** $10,000 USD
196+
- **DOT %:** 100%
197+
198+
### Milestone 1 — ZK Proof Verification Integration
199+
200+
- **Estimated duration:** 1 month
201+
- **FTE:** 0.5
202+
- **Costs:** $5,000 USD
203+
204+
| Number | Deliverable | Specification |
205+
| -----: | ----------- | ------------- |
206+
| **0a.** | License | Apache 2.0 |
207+
| **0b.** | Documentation | Inline code documentation + tutorial: "How to Deploy Your First JAM Service" covering project setup, building for PolkaVM, and deployment to testnet |
208+
| **0c.** | Testing Guide | Unit tests for ZK verification logic; integration tests for work package submission; guide explaining how to run tests locally |
209+
| **0d.** | Docker | Docker Compose setup for local development environment including PolkaJam testnet node, service deployment, and CLI tools |
210+
| 1. | ZK Verifier Research | Evaluate Arkworks (Groth16) for `no_std` PolkaVM compatibility. Document integration challenges, compile sizes, and verification times. Preliminary investigation of C++ → RISC-V compilation paths. |
211+
| 2. | JAM Service: ZK Verification | Implement Groth16 proof verification in `refine()` function using Arkworks. Accept proof bytes + public inputs, return verification result. |
212+
| 3. | CLI: Proof Submission | Extend TypeScript CLI to submit ZK proofs (generated externally) to the service |
213+
| 4. | Web Dashboard: ZK UI | Add proof upload interface, verification status display, and public inputs visualization |
214+
215+
216+
### Milestone 2 — Benchmarking & Documentation
217+
218+
- **Estimated Duration:** 1 month
219+
- **FTE:** 0.5
220+
- **Costs:** $5,000 USD
221+
222+
| Number | Deliverable | Specification |
223+
| -----: | ----------- | ------------- |
224+
| **0a.** | License | Apache 2.0 |
225+
| **0b.** | Documentation | Complete API documentation for zk-jam-service; architecture decision records |
226+
| **0c.** | Testing Guide | End-to-end testing guide covering full proof generation → submission → verification flow |
227+
| **0d.** | Docker | Docker setup with example proof generation |
228+
| **0e.** | Article | Blog post: "Building a ZK Verification Service on JAM: Lessons Learned" covering technical challenges, solutions, and recommendations |
229+
| 1. | Benchmark Suite | Dual-tier benchmarking: Rust (`criterion`) for execution + k6 for load testing |
230+
| 2. | Performance Report | Published analysis of ZK verification performance on JAM with recommendations |
231+
| 3. | C++ Integration Research | Document findings from C++ → RISC-V compilation experiments (Barretenberg). Include feasibility assessment, blockers encountered, and recommendations |
232+
| 4. | Tutorial Series | Three-part tutorial: (1) JAM Basics, (2) Building Your First Service, (3) Adding ZK Verification |
233+
| 5. | Example Proofs | Sample ZK proofs and generation scripts for developer testing |
234+
235+
236+
## Benchmarking Strategy
237+
238+
We employ a **dual-tier testing strategy** to establish baseline performance metrics:
239+
240+
### Tier 1: Execution Benchmarking (Rust)
241+
242+
Using `criterion` to measure within the PolkaVM environment:
243+
244+
| Metric | Tool | Purpose |
245+
|--------|------|---------|
246+
| Verification Time | criterion | Ensure < 6s Refine budget |
247+
| Memory Consumption | custom profiler | Stay within PVM limits |
248+
| PVM Overhead | comparative benchmarks | Native vs PVM execution |
249+
250+
### Tier 2: Load Testing (k6)
251+
252+
Simulating production conditions via the TypeScript bridge:
253+
254+
| Metric | Tool | Purpose |
255+
|--------|------|---------|
256+
| End-to-End Latency | k6 | Submission to finalization |
257+
| Concurrent Load | k6 | Multiple simultaneous verifications |
258+
| Network Reliability | k6 | Failure modes and recovery |
259+
260+
### Target Benchmark Results
261+
262+
```
263+
┌─────────────────────────────────────────────────────────────────────────┐
264+
│ Verification Time Comparison │
265+
├─────────────────┬───────────┬───────────┬────────────┬─────────────────┤
266+
│ Proof System │ Native │ PVM │ Overhead │ Fits 6s Budget? │
267+
├─────────────────┼───────────┼───────────┼────────────┼─────────────────┤
268+
│ Groth16 │ ~5ms │ TBD │ TBD │ TBD │
269+
│ PLONK │ ~30ms │ TBD │ TBD │ TBD │
270+
└─────────────────┴───────────┴───────────┴────────────┴─────────────────┘
271+
```
272+
273+
### Testing Environments
274+
275+
| Environment | Description | What We Measure |
276+
|-------------|-------------|-----------------|
277+
| **Native Benchmarks** | Development machine | Baseline times, memory |
278+
| **PolkaVM Simulation** | PVM without network | Overhead vs native |
279+
| **polkajam-testnet** | 6-validator local | Full pipeline latency |
280+
281+
## Future Plans
282+
283+
**Short-term (post-grant):**
284+
- Maintain the project as testnet infrastructure evolves
285+
- Engage with JAM developer community for feedback
286+
- Present at Polkadot developer meetups/events
287+
288+
**Long-term:**
289+
- If JAM reaches mainnet, evaluate production deployment (would require audit, separate funding)
290+
- Explore additional ZK proof systems based on community demand
291+
- Potentially apply for follow-up grant for advanced features (batching, aggregation)
292+
293+
**Sustainability:**
294+
- Core educational content will remain valuable regardless of further development
295+
- Open source community can fork/extend as needed
296+
- Low maintenance burden (testnet-focused, no production SLAs)
297+
298+
## Additional Information :heavy_plus_sign:
299+
300+
**How did you hear about the Grants Program?** Web3 Foundation Website and Polkadot developer documentation
301+
302+
**Previous W3F Grants:** None
303+
304+
**Other Funding:** No other funding received or applied for this project.
305+
306+
**Work Already Done:**
307+
- Phases 0.1, 0.2, and 0.3 completed without funding
308+
- Working service deployed on PolkaJam testnet
309+
- Web dashboard with verification UI and educational content
310+
- CLI tooling for service interaction
311+
312+
**Why Level 1:**
313+
- I am an individual developer without legal entity
314+
- Scope is appropriately sized: proof-of-concept + education, not production infrastructure
315+
- Senior Software developer looking to pivot into the Polkadot ecosystem
316+
317+
**Additional Context:**
318+
- JAM is nascent infrastructure; early educational resources have outsized impact
319+
- This project directly supports Polkadot's technical roadmap
320+
- All deliverables are public goods benefiting the entire ecosystem

0 commit comments

Comments
 (0)