You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+29-4Lines changed: 29 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ To solve this, we created **ZKLoRA** a zero-knowledge verification protocol that
32
32
33
33
This implementation uses a native Halo2 backend for transcript-bound proof artifacts. The v2 proof contract verifies exact quantized LoRA delta correctness for the statement the base user actually sent and received, and binds the proof to a pre-inference adapter manifest. It does not claim an end-to-end proof that the base model computed those activations.
34
34
35
+
Verifier trust boundary: `expected_adapters` must be obtained and pinned by the verifier out-of-band before inference starts, for example by recording the exact manifest file or digest. A contributor-generated adapter manifest is only a convenience handoff artifact; if it is first generated after inference or supplied only alongside proofs, it is not trusted verifier input.
36
+
35
37
For detailed information about this research, please refer to [our paper](https://arxiv.org/abs/2501.13965).
36
38
37
39
<h2align="center">Quick Usage Instructions</h2>
@@ -45,7 +47,7 @@ pip install zklora
45
47
46
48
Use `src/scripts/lora_contributor_sample_script.py` to:
47
49
- Host LoRA submodules
48
-
- Write a pre-inference adapter manifest
50
+
- Write a pre-inference adapter manifest for the verifier to pin out-of-band
49
51
- Handle inference requests
50
52
- Generate proof artifacts
51
53
@@ -57,18 +59,36 @@ import time
57
59
from zklora import LoRAServer, LoRAServerSocket
58
60
59
61
defmain():
60
-
parser = argparse.ArgumentParser()
62
+
parser = argparse.ArgumentParser(
63
+
description=(
64
+
"Run a sample LoRA contributor server and write the adapter manifest "
65
+
"that the verifier should pin out-of-band before inference."
print(f"[A-Server] wrote adapter manifest => {args.adapter_manifest}")
88
+
print(
89
+
"[A-Server] verifier must pin this manifest out-of-band before inference; "
90
+
"post-inference manifests are not trusted expected_adapters."
91
+
)
72
92
t = LoRAServerSocket(args.host, args.port_a, server_obj, stop_event)
73
93
t.start()
74
94
@@ -141,6 +161,8 @@ if __name__=="__main__":
141
161
142
162
Use `src/scripts/verify_proofs.py` to validate the proof artifacts:
143
163
164
+
`--expected_adapters` must point to the verifier's pinned pre-inference adapter manifest. Do not accept a contributor manifest that was generated after inference, or first delivered with the proof bundle, as trusted verifier input; it is useful only as a handoff artifact to compare against the pinned expectation.
165
+
144
166
```python
145
167
#!/usr/bin/env python3
146
168
"""
@@ -173,7 +195,10 @@ def main():
173
195
"--expected_adapters",
174
196
type=str,
175
197
required=True,
176
-
help="Pre-inference adapter manifest JSON agreed by the verifier."
198
+
help=(
199
+
"Verifier-pinned pre-inference adapter manifest JSON. This must be "
200
+
"obtained out-of-band before inference, not first supplied with proofs."
Copy file name to clipboardExpand all lines: src/README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,12 @@ src/
28
28
The zero-knowledge proof system in ZKLoRA is built on transcript-bound LoRA delta statements and native Halo2 proofs. The `zk_proof_generator.py` module orchestrates the proof generation process by:
29
29
30
30
1. Capturing the base user's local transcript of activations and returned LoRA deltas
31
-
2. Binding each proof to a pre-inference adapter manifest with a Poseidon adapter commitment
31
+
2. Binding each proof to a verifier-pinned pre-inference adapter manifest with a Poseidon adapter commitment
32
32
3. Generating native `.zklora.*` proof artifacts for contributor-side LoRA invocations
33
33
4. Verifying proof artifacts against both the base user's transcript and expected adapter manifest before accepting a module
34
34
35
+
The verifier must obtain and pin `expected_adapters` out-of-band before inference starts. Contributor-generated adapter manifests are convenience handoff artifacts only; if a manifest is generated after inference or first delivered alongside proofs, it is not trusted to define the expected adapter.
36
+
35
37
### Multi-Party Inference Protocol
36
38
37
39
The MPI system enables interaction between the base model user (B) and LoRA provider (A) through:
In this example, `adapter-manifest.json` is the verifier's pre-inference pinned copy or digest-matched file, not a manifest first generated after inference.
119
+
116
120
For detailed implementation information, please refer to the individual module documentation.
0 commit comments