aetherproof 0.2.1__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aetherproof-0.2.3/LICENSE +61 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/MANIFEST.in +26 -26
- aetherproof-0.2.3/PKG-INFO +346 -0
- aetherproof-0.2.3/README.md +316 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/__init__.py +1 -1
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/__main__.py +5 -5
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/cli.py +164 -164
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/core/keystore.py +100 -100
- aetherproof-0.2.3/aetherproof/core/receipt.py +222 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/ui/display.py +7 -3
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/ui/easy_mode.py +449 -449
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/ui/expert_mode.py +372 -372
- aetherproof-0.2.3/aetherproof.egg-info/PKG-INFO +346 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof.egg-info/SOURCES.txt +4 -1
- {aetherproof-0.2.1 → aetherproof-0.2.3}/pyproject.toml +3 -3
- {aetherproof-0.2.1 → aetherproof-0.2.3}/tests/security/README.md +32 -32
- {aetherproof-0.2.1 → aetherproof-0.2.3}/tests/security/test_cli_contract.py +66 -66
- aetherproof-0.2.3/tests/security/test_cloud_api_attested.py +71 -0
- aetherproof-0.2.3/tests/security/test_cloud_models_matrix.py +55 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/tests/security/test_parsing_and_types.py +48 -48
- {aetherproof-0.2.1 → aetherproof-0.2.3}/tests/security/test_preimage_injectivity.py +83 -83
- aetherproof-0.2.3/tests/security/test_v12_extensions.py +82 -0
- aetherproof-0.2.1/LICENSE +0 -661
- aetherproof-0.2.1/PKG-INFO +0 -208
- aetherproof-0.2.1/README.md +0 -178
- aetherproof-0.2.1/aetherproof/core/receipt.py +0 -124
- aetherproof-0.2.1/aetherproof.egg-info/PKG-INFO +0 -208
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/core/__init__.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/core/hash.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/core/log.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/core/signer.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/core/verifier.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/ui/__init__.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof/ui/menus.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof.egg-info/dependency_links.txt +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof.egg-info/entry_points.txt +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof.egg-info/requires.txt +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/aetherproof.egg-info/top_level.txt +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/setup.cfg +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/tests/conftest.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/tests/test_log.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/tests/test_receipt.py +0 -0
- {aetherproof-0.2.1 → aetherproof-0.2.3}/tests/test_verifier.py +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
10
|
+
|
|
11
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
12
|
+
|
|
13
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity.
|
|
14
|
+
|
|
15
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
16
|
+
|
|
17
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
18
|
+
|
|
19
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
20
|
+
|
|
21
|
+
"Work" shall mean the work of authorship made available under the License, as indicated by a copyright notice that is included in or attached to the work.
|
|
22
|
+
|
|
23
|
+
"Derivative Works" shall mean any work that is based on the Work, for which the editorial revisions, annotations, elaborations, or other transformations represent, as a whole, an original work of authorship.
|
|
24
|
+
|
|
25
|
+
"Contribution" shall mean any work of authorship submitted to the Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner.
|
|
26
|
+
|
|
27
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of whom a Contribution has been received by the Licensor and included in the Work.
|
|
28
|
+
|
|
29
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
30
|
+
|
|
31
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work.
|
|
32
|
+
|
|
33
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
34
|
+
|
|
35
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
36
|
+
|
|
37
|
+
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
38
|
+
|
|
39
|
+
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work; and
|
|
40
|
+
|
|
41
|
+
(d) If the Work includes a "NOTICE" text file, you must include a readable copy of the attribution notices contained within such NOTICE file.
|
|
42
|
+
|
|
43
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions.
|
|
44
|
+
|
|
45
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor.
|
|
46
|
+
|
|
47
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. You are solely responsible for determining the appropriateness of using the Work.
|
|
48
|
+
|
|
49
|
+
8. Limitation of Liability. In no event and under no legal theory shall any Contributor be liable for damages arising from this License or out of the use or inability to use the Work.
|
|
50
|
+
|
|
51
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work, You may offer acceptance of warranty, liability, or other conditions consistent with this License. However, in accepting such obligations, You act on Your own behalf alone.
|
|
52
|
+
|
|
53
|
+
END OF TERMS AND CONDITIONS
|
|
54
|
+
|
|
55
|
+
Copyright 2024-2025 Pulkit Srivastava
|
|
56
|
+
|
|
57
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
58
|
+
|
|
59
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
60
|
+
|
|
61
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# What ships in the source distribution. Explicit allow-list + hard prunes so no
|
|
2
|
-
# local data, keys, internal docs, or build junk can leak into a published build.
|
|
3
|
-
|
|
4
|
-
include README.md
|
|
5
|
-
include LICENSE
|
|
6
|
-
include pyproject.toml
|
|
7
|
-
recursive-include aetherproof *.py
|
|
8
|
-
recursive-include tests *.py *.md
|
|
9
|
-
|
|
10
|
-
# Hard prunes (defense in depth — setuptools does NOT read .gitignore)
|
|
11
|
-
prune receipts
|
|
12
|
-
prune build
|
|
13
|
-
prune dist
|
|
14
|
-
prune target
|
|
15
|
-
prune docs
|
|
16
|
-
recursive-exclude * __pycache__
|
|
17
|
-
recursive-exclude * *.py[cod]
|
|
18
|
-
recursive-exclude * *.pem
|
|
19
|
-
recursive-exclude * *.pub
|
|
20
|
-
recursive-exclude * *.key
|
|
21
|
-
recursive-exclude * *.db
|
|
22
|
-
recursive-exclude * *.receipt
|
|
23
|
-
recursive-exclude * *.bin
|
|
24
|
-
global-exclude AetherProof_*.html
|
|
25
|
-
global-exclude .env
|
|
26
|
-
global-exclude *.log
|
|
1
|
+
# What ships in the source distribution. Explicit allow-list + hard prunes so no
|
|
2
|
+
# local data, keys, internal docs, or build junk can leak into a published build.
|
|
3
|
+
|
|
4
|
+
include README.md
|
|
5
|
+
include LICENSE
|
|
6
|
+
include pyproject.toml
|
|
7
|
+
recursive-include aetherproof *.py
|
|
8
|
+
recursive-include tests *.py *.md
|
|
9
|
+
|
|
10
|
+
# Hard prunes (defense in depth — setuptools does NOT read .gitignore)
|
|
11
|
+
prune receipts
|
|
12
|
+
prune build
|
|
13
|
+
prune dist
|
|
14
|
+
prune target
|
|
15
|
+
prune docs
|
|
16
|
+
recursive-exclude * __pycache__
|
|
17
|
+
recursive-exclude * *.py[cod]
|
|
18
|
+
recursive-exclude * *.pem
|
|
19
|
+
recursive-exclude * *.pub
|
|
20
|
+
recursive-exclude * *.key
|
|
21
|
+
recursive-exclude * *.db
|
|
22
|
+
recursive-exclude * *.receipt
|
|
23
|
+
recursive-exclude * *.bin
|
|
24
|
+
global-exclude AetherProof_*.html
|
|
25
|
+
global-exclude .env
|
|
26
|
+
global-exclude *.log
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aetherproof
|
|
3
|
+
Version: 0.2.3
|
|
4
|
+
Summary: AetherProof — the open-source receipt engine. Prototype of Signet.
|
|
5
|
+
Author: Pulkit Srivastava
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Keywords: cryptography,ai,audit,compliance,ed25519,receipt,tamper-proof
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Security :: Cryptography
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: cryptography>=41.0.0
|
|
22
|
+
Requires-Dist: rich>=13.0.0
|
|
23
|
+
Requires-Dist: questionary>=2.0.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
27
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="docs/signet-logo.png" alt="Signet" width="240">
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
# AetherProof
|
|
36
|
+
|
|
37
|
+
**The open-source receipt engine. Prototype of Signet.**
|
|
38
|
+
|
|
39
|
+
Generate cryptographic receipts that prove an AI output is real and unmodified — no servers, no dependencies, verifiable forever offline.
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
pip install aetherproof
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Run `aetherproof` with no arguments for the interactive menu:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
.+######+. AETHERPROOF
|
|
49
|
+
## ## v0.2.2
|
|
50
|
+
# /\ # Cryptographic receipt engine
|
|
51
|
+
# / \ # Prototype of Signet · R0/L2
|
|
52
|
+
# / /\ \ #
|
|
53
|
+
# / / \ \ # github.com/pulkit6732/aetherproof
|
|
54
|
+
# /______\ \ # Verify(receipt, pk, log) = TRUE
|
|
55
|
+
# \______/ #
|
|
56
|
+
## ##
|
|
57
|
+
'######'
|
|
58
|
+
────────────────────────────────────────────────
|
|
59
|
+
Sign · Verify · Inspect · Log · Keygen
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## What it does
|
|
63
|
+
|
|
64
|
+
Every time an AI model produces output, AetherProof issues a tamper-proof signed receipt:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Receipt ID : ap_8694dae2
|
|
68
|
+
Model Root : abcdef0123456789... (SHA-256 Merkle of model weights)
|
|
69
|
+
Model Root Type : artifact_hash (bound to the weights) | name_only (claim only)
|
|
70
|
+
Output Hash : fedcba9876543210... (SHA-256 of the output)
|
|
71
|
+
Timestamp : 2026-06-11T15:30:00Z
|
|
72
|
+
Signature : ✓ Ed25519 VALID
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The `Model Root Type` field is honest about what the root proves:
|
|
76
|
+
`artifact_hash` (you signed a real weights file), `api_attested` (a cloud API
|
|
77
|
+
returned the model id), or `name_only` (you typed a name). The receipt never
|
|
78
|
+
pretends a name is the weights — see [Local vs Cloud](#local-models-vs-cloud-models)
|
|
79
|
+
below.
|
|
80
|
+
|
|
81
|
+
**One bit changes → signature fails instantly.**
|
|
82
|
+
|
|
83
|
+
## Quick start
|
|
84
|
+
|
|
85
|
+
### Easy mode (for anyone)
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
aetherproof
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Step-by-step wizard:
|
|
92
|
+
1. What model did you use?
|
|
93
|
+
2. Paste the output
|
|
94
|
+
3. Receipt is signed and saved
|
|
95
|
+
|
|
96
|
+
### Expert mode (for developers)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Generate a receipt
|
|
100
|
+
aetherproof sign model.onnx output.txt
|
|
101
|
+
|
|
102
|
+
# Verify it (offline, forever)
|
|
103
|
+
aetherproof verify receipt.json
|
|
104
|
+
|
|
105
|
+
# Inspect all fields
|
|
106
|
+
aetherproof inspect receipt.json
|
|
107
|
+
|
|
108
|
+
# Test tamper detection
|
|
109
|
+
aetherproof tamper receipt.json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Local models vs Cloud models
|
|
113
|
+
|
|
114
|
+
This is the most important distinction in AetherProof. **What can be proven
|
|
115
|
+
depends on whether you can see the weights.**
|
|
116
|
+
|
|
117
|
+
| | Local / self-hosted (Llama, custom, on-prem) | Cloud API (GPT-4o, Claude, Grok, DeepSeek, Gemini…) |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| Who holds the weights | **You** | The provider |
|
|
120
|
+
| Can you hash the weights? | **Yes** | **No — ever** |
|
|
121
|
+
| `model_root_type` | `artifact_hash` | `api_attested` |
|
|
122
|
+
| Proves the exact model ran? | **Yes** | **No** (only the provider can attest that) |
|
|
123
|
+
| Proves input + output unaltered? | Yes | **Yes** |
|
|
124
|
+
| Proves *which model the API claimed* + when? | Yes | **Yes** |
|
|
125
|
+
|
|
126
|
+
### Why a cloud receipt can't prove the weights — and why that's honest
|
|
127
|
+
|
|
128
|
+
`model_weight_root` requires reading the weights. With GPT-4o or Grok, **the
|
|
129
|
+
weights live on the provider's servers — you never see them, so you cannot hash
|
|
130
|
+
them.** No client-side tool can. Anyone claiming to "cryptographically prove the
|
|
131
|
+
cloud model ran" is overstating it, and a sharp auditor will reject that.
|
|
132
|
+
|
|
133
|
+
What a cloud receipt *does* prove is the part **you are liable for**: the exact
|
|
134
|
+
input your system sent, the exact output it acted on, the model the API *claimed*,
|
|
135
|
+
the time, and that none of it was altered or back-dated. That is your
|
|
136
|
+
record-keeping obligation (SEC 17a-4, FRE 902(14)). The provider owns their
|
|
137
|
+
infrastructure attestation; AetherProof owns the faithfulness of your record.
|
|
138
|
+
|
|
139
|
+
### How the model name is captured (you don't type it)
|
|
140
|
+
|
|
141
|
+
For `api_attested`, the model identity comes **from the API response**, not from a
|
|
142
|
+
guess. Every major API returns the resolved id:
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
# OpenAI / DeepSeek / xAI (Grok) — OpenAI-compatible
|
|
146
|
+
resp = client.chat.completions.create(model="gpt-4o", messages=[...])
|
|
147
|
+
resp.model # "gpt-4o-2024-08-06" ← the RESOLVED id (dated snapshot)
|
|
148
|
+
resp.system_fingerprint # "fp_a7d06e42bc" ← backend config snapshot
|
|
149
|
+
resp.id, resp.created # call id + provider timestamp
|
|
150
|
+
|
|
151
|
+
# Anthropic (Claude)
|
|
152
|
+
resp = client.messages.create(model="claude-opus-4-8", ...)
|
|
153
|
+
resp.model # "claude-opus-4-8"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
You asked for `"gpt-4o"`; the API answers `"gpt-4o-2024-08-06"` — the exact
|
|
157
|
+
snapshot that served you. You bind that returned string + `system_fingerprint`,
|
|
158
|
+
so the user can't fake it (it comes back inside the response you're hashing).
|
|
159
|
+
|
|
160
|
+
### Signing a cloud call
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
from aetherproof.core.receipt import Receipt
|
|
164
|
+
from aetherproof.core.keystore import load_or_create_signer
|
|
165
|
+
from aetherproof.core.log import ReceiptLog
|
|
166
|
+
|
|
167
|
+
resp = client.chat.completions.create(model="gpt-4o", messages=[...])
|
|
168
|
+
|
|
169
|
+
r = Receipt.for_api_call(
|
|
170
|
+
provider="openai",
|
|
171
|
+
model_id=resp.model, # read FROM the response
|
|
172
|
+
prompt=user_prompt,
|
|
173
|
+
output_text=resp.choices[0].message.content,
|
|
174
|
+
response_metadata={
|
|
175
|
+
"system_fingerprint": resp.system_fingerprint,
|
|
176
|
+
"response_id": resp.id,
|
|
177
|
+
"created": resp.created,
|
|
178
|
+
},
|
|
179
|
+
)
|
|
180
|
+
# r.model_root_type == "api_attested"
|
|
181
|
+
signer = load_or_create_signer()
|
|
182
|
+
r.signature = signer.sign(r.signing_bytes())
|
|
183
|
+
ReceiptLog().append(r)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
This works for **any** OpenAI-compatible or Anthropic-style provider — OpenAI,
|
|
187
|
+
Azure OpenAI, DeepSeek, xAI/Grok, Mistral, Together, Groq, etc. (tested across 17
|
|
188
|
+
model families in `tests/security/test_cloud_models_matrix.py`).
|
|
189
|
+
|
|
190
|
+
### "But what if they have no provider attestation? Won't they get rejected?"
|
|
191
|
+
|
|
192
|
+
No — the honest answer *passes* the security review. When asked "prove Grok's
|
|
193
|
+
weights ran," the answer is:
|
|
194
|
+
|
|
195
|
+
> "No client-side tool can prove a closed cloud model's weights — only the
|
|
196
|
+
> provider can, and they don't expose it. What we prove is the part you're liable
|
|
197
|
+
> for: the exact input, the exact output, the model the API claimed, the time,
|
|
198
|
+
> and that none of it was altered. That's your record-keeping obligation."
|
|
199
|
+
|
|
200
|
+
In a real dispute (a wrongful denial, a bad summary), the fight is almost never
|
|
201
|
+
"was it GPT-4o or GPT-4-turbo" — it's **"did the AI actually output this, or was
|
|
202
|
+
the record edited afterward?"** AetherProof answers that completely, for any cloud
|
|
203
|
+
model, with zero provider cooperation. The model-identity gap upgrades to a real
|
|
204
|
+
hardware root only when the provider signs their infrastructure (AWS Bedrock +
|
|
205
|
+
Nitro, future) — at which point **Signet** imports that signature and the tier
|
|
206
|
+
graduates `api_attested → hardware-rooted`, with no change to the receipt format.
|
|
207
|
+
|
|
208
|
+
## The invariant (what makes this real)
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
Verify(receipt, public_key, log) = TRUE
|
|
212
|
+
|
|
213
|
+
using ONLY those three inputs, forever, with zero dependency on
|
|
214
|
+
AetherProof servers, any vendor SDK, or any hardware driver.
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
This is not a claim. It's built in. Offline verification uses only:
|
|
218
|
+
1. The receipt file
|
|
219
|
+
2. The public key (PEM file)
|
|
220
|
+
3. (Optional) transparency log entry
|
|
221
|
+
|
|
222
|
+
No network. No API calls. No special hardware. Works in 2026, 2035, 2050.
|
|
223
|
+
|
|
224
|
+
## How offline verification actually works
|
|
225
|
+
|
|
226
|
+
You can prove a receipt is genuine with **no internet and no AetherProof code at
|
|
227
|
+
all** — the math is open. Here is the exact process.
|
|
228
|
+
|
|
229
|
+
### What you need (the three inputs)
|
|
230
|
+
1. **The receipt** (`ap_xxxx.json`) — the signed claim.
|
|
231
|
+
2. **The public key** (`ap_xxxx.pub`, a PEM file) — shipped beside the receipt.
|
|
232
|
+
3. **(Optional) the original output file** — only if you also want to prove the
|
|
233
|
+
output itself wasn't changed.
|
|
234
|
+
|
|
235
|
+
### The steps
|
|
236
|
+
1. **Rebuild the signed message.** The receipt is signed over a canonical,
|
|
237
|
+
length-prefixed preimage of its fields (version, model root, model-root-type,
|
|
238
|
+
input commitment, output hash, timestamp, log sequence, hardware evidence, log
|
|
239
|
+
anchor). The encoding is injective, so no two distinct receipts can share a
|
|
240
|
+
preimage (and thus a signature).
|
|
241
|
+
2. **Check the Ed25519 signature** of that preimage against the public key. If it
|
|
242
|
+
verifies, the receipt's contents are exactly what was signed — a single
|
|
243
|
+
changed bit fails this check.
|
|
244
|
+
3. **(Optional) Re-hash the output file** with SHA-256 (raw bytes, streamed) and
|
|
245
|
+
compare to the receipt's `output_hash`. If they match, the output is unchanged.
|
|
246
|
+
|
|
247
|
+
### The one-command way
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# signature only
|
|
251
|
+
aetherproof verify ap_xxxx.json
|
|
252
|
+
|
|
253
|
+
# signature + confirm the output file still matches
|
|
254
|
+
aetherproof verify ap_xxxx.json --output original_output.txt
|
|
255
|
+
|
|
256
|
+
# scripting / CI: machine-readable, exits non-zero on any failure
|
|
257
|
+
aetherproof verify ap_xxxx.json --output original_output.txt --quiet
|
|
258
|
+
# -> {"valid": true, "signature_valid": true, "output_unmodified": true}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Exit code is `0` only when everything checks out, `1` on any tampering — so
|
|
262
|
+
`aetherproof verify … && deploy` is safe in a pipeline.
|
|
263
|
+
|
|
264
|
+
### Verify without AetherProof (any Ed25519 library)
|
|
265
|
+
|
|
266
|
+
Because the format is open, anyone can verify with a standard crypto library —
|
|
267
|
+
no dependency on this tool. In Python with `cryptography`:
|
|
268
|
+
|
|
269
|
+
```python
|
|
270
|
+
import json, hashlib
|
|
271
|
+
from cryptography.hazmat.primitives.serialization import load_pem_public_key
|
|
272
|
+
|
|
273
|
+
r = json.load(open("ap_xxxx.json"))
|
|
274
|
+
pub = load_pem_public_key(open("ap_xxxx.pub", "rb").read())
|
|
275
|
+
|
|
276
|
+
# rebuild the injective preimage: "<len>:<field>" for each field, in order
|
|
277
|
+
fields = [
|
|
278
|
+
r["receipt_version"], r["model_weight_root"], r["model_root_type"],
|
|
279
|
+
r["input_commitment"], r["output_hash"], str(r["timestamp_ms"]),
|
|
280
|
+
str(r["log_sequence"]),
|
|
281
|
+
json.dumps(r["hw_evidence"], sort_keys=True, separators=(",", ":")),
|
|
282
|
+
r["log_anchor"],
|
|
283
|
+
]
|
|
284
|
+
preimage = "".join(f"{len(f)}:{f}" for f in fields).encode("utf-8")
|
|
285
|
+
|
|
286
|
+
pub.verify(bytes.fromhex(r["signature"]), preimage) # raises if invalid
|
|
287
|
+
print("signature OK")
|
|
288
|
+
|
|
289
|
+
# optional: prove the output file is unchanged
|
|
290
|
+
digest = hashlib.sha256(open("original_output.txt", "rb").read()).hexdigest()
|
|
291
|
+
print("output unmodified:", digest == r["output_hash"])
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
That is the whole trust model: **a public key and some SHA-256 + Ed25519 math you
|
|
295
|
+
can run anywhere, forever.**
|
|
296
|
+
|
|
297
|
+
## Agent-chain context (receipt v1.2)
|
|
298
|
+
|
|
299
|
+
A receipt can optionally commit to **namespaced runtime context** — which agent
|
|
300
|
+
action, run, or policy decision an output belongs to — *inside* the signature.
|
|
301
|
+
This binds a receipt to the exact decision it was issued for, so a valid receipt
|
|
302
|
+
can't be replayed in a different context.
|
|
303
|
+
|
|
304
|
+
```python
|
|
305
|
+
from aetherproof.core.receipt import Receipt
|
|
306
|
+
|
|
307
|
+
r = Receipt(
|
|
308
|
+
model_weight_root="...",
|
|
309
|
+
output_hash="...",
|
|
310
|
+
signed_extensions={
|
|
311
|
+
"org.liminal.agent_chain/v0.1": {
|
|
312
|
+
"purpose": "generate",
|
|
313
|
+
"actor_id": "agent:planner",
|
|
314
|
+
"run_id": "run_42",
|
|
315
|
+
"policy_decision_id": "pol_7",
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
)
|
|
319
|
+
# r.receipt_version is now "1.2"; the SHA-256 commitment over the canonicalized
|
|
320
|
+
# extensions is folded into the signing preimage — tampering any field breaks it.
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
- **Empty extensions → the receipt stays v1.1, byte-identical.** No impact on
|
|
324
|
+
existing receipts or verifiers.
|
|
325
|
+
- **Non-empty → v1.2.** Per-extension SHA-256 commitments (RFC 8785 JCS
|
|
326
|
+
canonicalization) are aggregated and appended to the injective preimage, so a
|
|
327
|
+
namespace can be disclosed or omitted without breaking the others.
|
|
328
|
+
|
|
329
|
+
This is the AetherProof side of the [agent-chain context spec](https://github.com/pulkit6732/aetherproof/issues/1).
|
|
330
|
+
Multi-hop pipeline aggregation (signing each hop, identifying a tampered hop) is
|
|
331
|
+
**Signet Layer 3** and builds on this primitive.
|
|
332
|
+
|
|
333
|
+
## Architecture (god file)
|
|
334
|
+
|
|
335
|
+
AetherProof is **Layer 2** of the **Signet** stack. Signet adds hardware roots, compliance packs, and a transparency network on top.
|
|
336
|
+
|
|
337
|
+
## License
|
|
338
|
+
|
|
339
|
+
Apache 2.0. Use it, deploy it, fork it, embed it in commercial products —
|
|
340
|
+
no restrictions. See LICENSE for full terms.
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
**AetherProof is what you get when you need tamper-proof proof.**
|
|
345
|
+
|
|
346
|
+
**Signet is what you get when you need hardware roots, compliance packs, and a transparency log.**
|