entropy-protocol 0.1.0__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.
Files changed (80) hide show
  1. entropy_protocol-0.1.0/LICENSE +201 -0
  2. entropy_protocol-0.1.0/NOTICE +4 -0
  3. entropy_protocol-0.1.0/PKG-INFO +255 -0
  4. entropy_protocol-0.1.0/README.md +224 -0
  5. entropy_protocol-0.1.0/pyproject.toml +37 -0
  6. entropy_protocol-0.1.0/setup.cfg +4 -0
  7. entropy_protocol-0.1.0/src/entropy_protocol/__init__.py +11 -0
  8. entropy_protocol-0.1.0/src/entropy_protocol/_unicode14.py +120 -0
  9. entropy_protocol-0.1.0/src/entropy_protocol/attest.py +62 -0
  10. entropy_protocol-0.1.0/src/entropy_protocol/attested/__init__.py +6 -0
  11. entropy_protocol-0.1.0/src/entropy_protocol/attested/amd.py +221 -0
  12. entropy_protocol-0.1.0/src/entropy_protocol/attested/appraise.py +325 -0
  13. entropy_protocol-0.1.0/src/entropy_protocol/attested/attester.py +58 -0
  14. entropy_protocol-0.1.0/src/entropy_protocol/attested/authority.py +239 -0
  15. entropy_protocol-0.1.0/src/entropy_protocol/attested/azure_cgpu.py +186 -0
  16. entropy_protocol-0.1.0/src/entropy_protocol/attested/binding.py +71 -0
  17. entropy_protocol-0.1.0/src/entropy_protocol/attested/capture.py +109 -0
  18. entropy_protocol-0.1.0/src/entropy_protocol/attested/ear.py +94 -0
  19. entropy_protocol-0.1.0/src/entropy_protocol/attested/enroll.py +119 -0
  20. entropy_protocol-0.1.0/src/entropy_protocol/attested/evidence.py +106 -0
  21. entropy_protocol-0.1.0/src/entropy_protocol/attested/hcl.py +109 -0
  22. entropy_protocol-0.1.0/src/entropy_protocol/attested/nvidia.py +168 -0
  23. entropy_protocol-0.1.0/src/entropy_protocol/attested/ocsp.py +90 -0
  24. entropy_protocol-0.1.0/src/entropy_protocol/attested/pki.py +121 -0
  25. entropy_protocol-0.1.0/src/entropy_protocol/attested/rim.py +130 -0
  26. entropy_protocol-0.1.0/src/entropy_protocol/attested/service.py +242 -0
  27. entropy_protocol-0.1.0/src/entropy_protocol/attested/tpm.py +259 -0
  28. entropy_protocol-0.1.0/src/entropy_protocol/backend_hf.py +439 -0
  29. entropy_protocol-0.1.0/src/entropy_protocol/batch.py +537 -0
  30. entropy_protocol-0.1.0/src/entropy_protocol/calibrate.py +99 -0
  31. entropy_protocol-0.1.0/src/entropy_protocol/canon.py +321 -0
  32. entropy_protocol-0.1.0/src/entropy_protocol/canongen.py +325 -0
  33. entropy_protocol-0.1.0/src/entropy_protocol/cli.py +493 -0
  34. entropy_protocol-0.1.0/src/entropy_protocol/cose.py +260 -0
  35. entropy_protocol-0.1.0/src/entropy_protocol/crypto.py +140 -0
  36. entropy_protocol-0.1.0/src/entropy_protocol/delivery.py +31 -0
  37. entropy_protocol-0.1.0/src/entropy_protocol/detect.py +246 -0
  38. entropy_protocol-0.1.0/src/entropy_protocol/gateway.py +370 -0
  39. entropy_protocol-0.1.0/src/entropy_protocol/hpke.py +105 -0
  40. entropy_protocol-0.1.0/src/entropy_protocol/mcp.py +159 -0
  41. entropy_protocol-0.1.0/src/entropy_protocol/pack.py +217 -0
  42. entropy_protocol-0.1.0/src/entropy_protocol/plain.py +122 -0
  43. entropy_protocol-0.1.0/src/entropy_protocol/predicates.py +37 -0
  44. entropy_protocol-0.1.0/src/entropy_protocol/profiles.py +45 -0
  45. entropy_protocol-0.1.0/src/entropy_protocol/record.py +116 -0
  46. entropy_protocol-0.1.0/src/entropy_protocol/scrapi.py +203 -0
  47. entropy_protocol-0.1.0/src/entropy_protocol/seal.py +232 -0
  48. entropy_protocol-0.1.0/src/entropy_protocol/statements.py +148 -0
  49. entropy_protocol-0.1.0/src/entropy_protocol/stats.py +20 -0
  50. entropy_protocol-0.1.0/src/entropy_protocol/tlog.py +147 -0
  51. entropy_protocol-0.1.0/src/entropy_protocol/ts3161.py +205 -0
  52. entropy_protocol-0.1.0/src/entropy_protocol/typography.py +73 -0
  53. entropy_protocol-0.1.0/src/entropy_protocol/verify.py +232 -0
  54. entropy_protocol-0.1.0/src/entropy_protocol.egg-info/PKG-INFO +255 -0
  55. entropy_protocol-0.1.0/src/entropy_protocol.egg-info/SOURCES.txt +78 -0
  56. entropy_protocol-0.1.0/src/entropy_protocol.egg-info/dependency_links.txt +1 -0
  57. entropy_protocol-0.1.0/src/entropy_protocol.egg-info/entry_points.txt +2 -0
  58. entropy_protocol-0.1.0/src/entropy_protocol.egg-info/requires.txt +20 -0
  59. entropy_protocol-0.1.0/src/entropy_protocol.egg-info/top_level.txt +1 -0
  60. entropy_protocol-0.1.0/tests/test_attested_evidence.py +197 -0
  61. entropy_protocol-0.1.0/tests/test_attested_run.py +181 -0
  62. entropy_protocol-0.1.0/tests/test_attested_units.py +233 -0
  63. entropy_protocol-0.1.0/tests/test_batch.py +192 -0
  64. entropy_protocol-0.1.0/tests/test_calibrate_positions.py +52 -0
  65. entropy_protocol-0.1.0/tests/test_canongen.py +161 -0
  66. entropy_protocol-0.1.0/tests/test_conformance_no_torch.py +30 -0
  67. entropy_protocol-0.1.0/tests/test_core.py +163 -0
  68. entropy_protocol-0.1.0/tests/test_delivery.py +70 -0
  69. entropy_protocol-0.1.0/tests/test_e2e.py +216 -0
  70. entropy_protocol-0.1.0/tests/test_fuzz.py +63 -0
  71. entropy_protocol-0.1.0/tests/test_gate.py +89 -0
  72. entropy_protocol-0.1.0/tests/test_gateway.py +230 -0
  73. entropy_protocol-0.1.0/tests/test_hpke.py +66 -0
  74. entropy_protocol-0.1.0/tests/test_identity.py +33 -0
  75. entropy_protocol-0.1.0/tests/test_joins.py +39 -0
  76. entropy_protocol-0.1.0/tests/test_mcp.py +78 -0
  77. entropy_protocol-0.1.0/tests/test_pack.py +169 -0
  78. entropy_protocol-0.1.0/tests/test_plain.py +87 -0
  79. entropy_protocol-0.1.0/tests/test_statements.py +176 -0
  80. entropy_protocol-0.1.0/tests/test_vectors.py +46 -0
@@ -0,0 +1,201 @@
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,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,4 @@
1
+ Entropy Protocol (ep1) — reference implementation
2
+ Copyright 2026 Roman Oliinyk and Serhii Nikolaichuk
3
+
4
+ This product includes software developed by the authors named above, licensed under the Apache License, Version 2.0.
@@ -0,0 +1,255 @@
1
+ Metadata-Version: 2.4
2
+ Name: entropy-protocol
3
+ Version: 0.1.0
4
+ Summary: Reference implementation of the Entropy Protocol: seal language-model text when it is written; verify it later, deterministically, with a record that reveals no text.
5
+ Author: Roman Oliinyk, Serhii Nikolaichuk
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/entropy-ep1/entropy-protocol
8
+ Project-URL: Repository, https://github.com/entropy-ep1/entropy-protocol
9
+ Project-URL: Issues, https://github.com/entropy-ep1/entropy-protocol/issues
10
+ Project-URL: Changelog, https://github.com/entropy-ep1/entropy-protocol/blob/main/CHANGELOG.md
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ License-File: NOTICE
15
+ Requires-Dist: cryptography>=43.0.3
16
+ Requires-Dist: cbor2>=5.6
17
+ Provides-Extra: model
18
+ Requires-Dist: torch>=2.2; extra == "model"
19
+ Requires-Dist: transformers>=4.44; extra == "model"
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=8; extra == "dev"
22
+ Requires-Dist: hypothesis>=6.100; extra == "dev"
23
+ Provides-Extra: markdown
24
+ Requires-Dist: markdown-it-py>=3; extra == "markdown"
25
+ Provides-Extra: attested
26
+ Requires-Dist: signxml>=4; extra == "attested"
27
+ Requires-Dist: lxml>=4.9; extra == "attested"
28
+ Provides-Extra: guest
29
+ Requires-Dist: nvidia-ml-py>=12.550.52; extra == "guest"
30
+ Dynamic: license-file
31
+
32
+ # Entropy Protocol (ep1)
33
+
34
+ **A receipt for machine-written text.** Seal text at the moment a language model writes it. Later, anyone you
35
+ give the receipt to can check — deterministically, without the prompt, and without the receipt revealing a word of
36
+ the text — whether a document is that text, and if it is not, exactly where it was changed.
37
+
38
+ > **What a missing mark means.** ep1 speaks only about text that was sealed. A text with no ep1 mark was not
39
+ > sealed; that says nothing about whether a person or a machine wrote it. ep1 is not a classifier of AI authorship
40
+ > and never judges unsealed text.
41
+
42
+ This repository is the reference implementation, the specification of its formats, test vectors, a second
43
+ independent implementation, and the evaluation program behind every number below.
44
+
45
+ ---
46
+
47
+ ## Why a receipt, not a guess
48
+
49
+ Tools that infer authorship from a single text cannot be both useful and fair: they must accuse some honest writers,
50
+ and their error rates are estimated, not known. Statistical watermarks report a score whose null distribution depends
51
+ on the model and the text. Metadata attached to a file does not survive a copy out of a chat window.
52
+
53
+ ep1 takes the other road. At generation it writes a **record** with two layers:
54
+
55
+ - a **content layer** — digests of the canonical text and of its sentence blocks: exact integrity and the location of
56
+ every edit;
57
+ - a **model layer** — checkpoints: a character offset and an ordinal property of the model's choice there (its first
58
+ choice, or not). No token, no word, no text.
59
+
60
+ A verifier re-reads the candidate once with the same model and returns a determination:
61
+
62
+ | Verdict | Meaning |
63
+ |---|---|
64
+ | `VERIFIED` | the candidate is the sealed text (canonical form: line endings, invisible characters, typographic quotes do not matter) |
65
+ | `VERIFIED_TEXT` | a rendered copy (Markdown shown as a reader sees it) whose visible text is the sealed one |
66
+ | `MODIFIED` | changed — with the changed blocks, deletion points and diverging ranges |
67
+ | `INDETERMINATE` | the verifier's numerics cannot decide; **an identical text is never reported as MODIFIED** |
68
+ | `NOT_VERIFIABLE` | no valid record |
69
+
70
+ Without any record, a holder of the **detection key** can test whether a text was sealed under that key. The
71
+ p-value is **exact**: for any text not sealed under the key, the count of matching checkpoints follows
72
+ Binomial(n, ½) by construction — no model- or text-dependent calibration of the null.
73
+
74
+ ## What ep1 proves — and what it does not
75
+
76
+ **Proves**, given a record: whether a candidate is the sealed text and, if not, where it differs.
77
+ **Proves**, given the detection key: whether a text was sealed under the key, with an exact false-positive
78
+ probability.
79
+
80
+ **Does not prove**, and we say so first:
81
+
82
+ | Limit | Detail |
83
+ |---|---|
84
+ | Unsealed text | no mark means *not sealed*, not *not AI*; ep1 does not judge unsealed text |
85
+ | Rewriting | paraphrase and translation are modifications and are reported as such; after a rewrite of about a quarter of the words the record-free signal is gone |
86
+ | Short text | below about 50 tokens record-free detection has too few checkpoints |
87
+ | The model | record-free detection is as strong as the model is numerically steady: OLMo-2-7B in fp16 leaves too few checkpoints at the quality operating point (52 % at p ≤ 0.01 on 400 tokens), while its records verify as every model's do — measure detection on your own model before relying on it |
88
+ | The issuer | whoever holds the master key can seal a text its model did not write — unless sealing runs attested (below): the signing key is then certified only for a confidential VM running the declared model and code; excluding the operator of that VM also needs a locked, measured image |
89
+ | Same model | the verifier needs the same weights and tokenizer, in a certified numerical class; outside it the answer is `INDETERMINATE`, never a false verdict |
90
+ | The key | a holder of the detection key can imitate the mark — hand it only to trusted detectors, or run detection as a service |
91
+ | Measured range | the exact null is measured down to 1e-6, on 2.1 million (text, key) pairs across four models; smaller p-values rest on the construction, not on a measurement |
92
+ | Cost | sealing adds 14–27 % latency at batch 1–8, 48–77 % at batch 32 and 83–109 % at batch 64 (four cards, four models) |
93
+ | Time stamps | we check a time-stamp token's imprint; validating the authority's signature and chain is the reader's trust decision |
94
+
95
+ ## Measured
96
+
97
+ One NVIDIA L40S, Qwen2.5-7B-Instruct, fp16, 128 texts of 400 tokens per corpus (phase A, 15.09.2026, total cost
98
+ $4.60). Every number is a file under [`runs_gpu/a1/`](runs_gpu/a1) and a command in [`bench/gpu/`](bench/gpu).
99
+
100
+ | | Result |
101
+ |---|---|
102
+ | Records of unchanged text in five verifier configurations — fp16; bf16 outside the calibration table; fp32; bf16 generation with fp16 measurement; the quality operating point | 100% `VERIFIED` (128 texts each; 32 for fp32 and for bf16 generation); **0 false `MODIFIED`** |
103
+ | Records after transport (CRLF, e-mail, no-break spaces, BOM, an embedded C2PA text manifest, invisible characters) | 0 failures |
104
+ | Edited texts (word replaced, one character, sentence deleted or inserted, tail truncated) | `MODIFIED` in 99.2–100%, with location |
105
+ | Exact null, 20,000 human C4 pairs | 155 at 1e-2 (200 allowed), 16 at 1e-3 (20), 1 at 1e-4 (2), 0 at 1e-5 and 1e-6 |
106
+ | Record-free detection at 1e-6, 200 / 400 tokens | 96.1% / 100% (strong) · 61.7% / 95.3% (quality) |
107
+ | GSM8K accuracy: unsealed / quality / strong | 87.5% / 85.2% / 39.1% |
108
+ | Verification throughput · peak memory | 9,275 tokens/s · 15.41 GB |
109
+
110
+ *Quality* (the default) leaves the model free where it is confident; *strong* enforces every checkpoint and breaks
111
+ arithmetic — use it only where the mark matters more than the answer.
112
+
113
+ **On other hardware** (phase B, 26.09.2026, [report](bench/results/phase_b/REPORT.md)). The same records, sealed on
114
+ the L40S, verified again on an L4 (Ada), an A10G (Ampere) and an H100 NVL in confidential-computing mode (Hopper), in
115
+ fp16, bf16 and fp32, on three clouds: **2,304 verifications, 100 % `VERIFIED`, 0 false `MODIFIED`**. Where machines
116
+ disagree at all — at most 1 position in 144,871 for fp16 and fp32, about 2 in 10,000 for bf16 — the answer is
117
+ `INDETERMINATE`, never `MODIFIED`.
118
+
119
+ | Card | Verification, tokens/s (batch 1) | Sealed generation, tokens/s (batch 1 · 64) |
120
+ |---|---|---|
121
+ | H100 NVL | 14,891 | 27 · 803 |
122
+ | L40S | 9,089 | 33 · 606 |
123
+ | A10G | 2,300 | 24 · 394 |
124
+ | L4 | 2,077 | 14 · 242 |
125
+
126
+ **The null at 10⁻⁶, two other watermarks, three more models** (phase C, 26.09.2026,
127
+ [report](bench/results/phase_c/REPORT.md)).
128
+
129
+ | | Result |
130
+ |---|---|
131
+ | Exact null: 2,127,680 (text, key) pairs of human and unsealed text, four models | 0.63–0.75 of the bound at every level down to 1e-5; at 1e-6, 4 against a bound of 2.1 (P = 0.17 under the bound) |
132
+ | The same check for KGW and SynthID-Text — their own p-values on 4,000 human texts | KGW flags 0.1 % at a nominal 1e-4 and 2.2 % at a nominal 1 % (400 tokens); SynthID about twice nominal at 1e-3 |
133
+ | Mistral-7B-v0.3, OLMo-2-7B, Qwen2.5-14B: records of unchanged text, fp16 and bf16 | 100 % `VERIFIED` (768 records, 1,152 verifications), 0 false `MODIFIED` |
134
+ | Record-free detection at 1e-6, 400 tokens, strong · quality | Mistral 99.2 · 83.6 %; OLMo-2 98.4 · 0.8 %; Qwen2.5-14B 100 · 82.8 % |
135
+ | GSM8K accuracy, quality operating point against unsealed, four models | no measurable cost (McNemar p = 0.51–0.71); *strong* breaks arithmetic on all four |
136
+
137
+ ## Attested sealing on a confidential H100
138
+
139
+ The keys, the model and the sealing code run in a confidential VM (AMD SEV-SNP) with an H100 in confidential-computing
140
+ mode. An authority appraises the hardware evidence — the processor's report, the vTPM quote and boot log, the GPU's
141
+ SPDM report — and certifies a key only if every check holds; each statement then carries the certificate and the digest
142
+ of the attestation result (EAR). Design: [ARCHITECTURE §7d](ARCHITECTURE.md). One run
143
+ ([files](bench/results/attested/run-20261027T172258Z): Azure `Standard_NCC40ads_H100_v5`, Qwen2.5-7B-Instruct, fp16):
144
+
145
+ | | Result |
146
+ |---|---|
147
+ | Enrollment of a statement key and a detection key, each generated inside the guest | certified after 48 checks each — 47 on the evidence and the handle's single use — none failed or skipped: AMD chain to the pinned ARK and AMD's CRL; the TCB floors of AMD's bulletins; the BadRAM and RMPocalypse fixes in the report; the paravisor's launch endorsed by its ID key; the binding (key, model, code, parameters) in the runtime claims and in the vTPM quote; the boot chain and the kernel image in the event log; the H100's report over the authority's nonce; NVIDIA's signed manifests; OCSP for seven certificates (nine checks: the two manifests share two) |
148
+ | 20 prose texts sealed in the VM, read by a separate verifier | as sealed 20/20 `VERIFIED`; one word changed 20/20 `MODIFIED`, with the range; after transport 20/20 `VERIFIED` |
149
+ | Record-free detection in the VM, 200 tokens, quality, 1e-6 | 14 of 20 sealed texts; 0 of 10 unsealed texts of the same model |
150
+ | Evidence packages | 20 of 20 check offline, 35 checks each, none failed: the appraisal repeated from AMD's and NVIDIA's roots at the result's issue time (47 checks per key), the certificates, the statements, log receipts, RFC 3161 time-stamp imprints; 5 more are the reader's: the authority's fingerprint, the time-stamp authority's signatures, the re-read with the model |
151
+
152
+ Refusals are tested on the run's own data ([`tests/test_attested_run.py`](tests/test_attested_run.py)): a request
153
+ bound to another key, evidence moved from another enrollment, a changed model digest, a spent handle, a changed text,
154
+ a result signed by another authority. A live refusal is kept as well: a host whose paravisor build had a launch
155
+ measurement the policy did not list ([files](bench/results/attested/run-20261027T170502Z-refused-launch-measurement));
156
+ the policy pins the key that signs the paravisor's launch instead. Not shown by this run: the operator had SSH access
157
+ to the guest. Excluding the operator needs a locked image — no interactive access, a measured root file system — whose
158
+ measurements become the reference values.
159
+
160
+ ```bash
161
+ pip install -e ".[attested]"
162
+ entropy evidence --check bench/results/attested/run-20261027T172258Z/packs/5aWyrqFNxAxJwkXE.cbor
163
+ ```
164
+
165
+ ## Quick start
166
+
167
+ ```bash
168
+ git clone https://github.com/entropy-ep1/entropy-protocol.git && cd entropy-protocol
169
+ pip install -e ".[model,markdown]" # Python >= 3.10; the model stack: torch and transformers
170
+ M=Qwen/Qwen2.5-0.5B-Instruct
171
+ entropy keygen --out master.key
172
+ entropy seal --model $M --key master.key --max-new-tokens 400 \
173
+ --prompt "Write a short story about a lighthouse keeper who finds a letter in a bottle." --out sealed.json
174
+ python3 -c 'import json; d = json.load(open("sealed.json")); open("candidate.txt", "w").write(d["text"])'
175
+ TOKEN=$(python3 -c 'import json; print(json.load(open("sealed.json"))["token"])')
176
+ entropy verify --model $M --text-file candidate.txt --token "$TOKEN" --key master.key # "verdict": "VERIFIED"
177
+ entropy detect --model $M --text-file candidate.txt --key master.key # "p_value", exact
178
+ ```
179
+
180
+ On a laptop CPU this takes under two minutes. One run ([files](bench/results/quickstart_2026-09-26)): `VERIFIED`
181
+ with all 51 checkpoints of the record matched; record-free detection found 42 of 44 checkpoints and reported
182
+ p = 5.6 × 10⁻¹¹. Change one word in `candidate.txt` and
183
+ verify again: `MODIFIED`, with the character range of the sentence that changed. Short or formulaic answers carry few checkpoints — detection needs
184
+ about 50 tokens or more, and is strongest on open-ended text.
185
+
186
+ The whole product in one command, on a CPU, nothing leaving the machine: [`bench/demo_review.sh`](bench/demo_review.sh)
187
+ (keys → an OpenAI-compatible sealing gateway on `127.0.0.1` → a sealed answer → three candidates checked: as
188
+ delivered, as a rendered copy, with one word changed → record-free detection with its exact p-value → the same
189
+ verdict through an MCP tool → signed statements, a transparency log and an evidence package checked offline).
190
+
191
+ `entropy --help` lists the rest: `serve` (sealing gateway), `mcp` (verifier as assistant tools), `commit` /
192
+ `register` / `serve-log` / `submit` (SCITT statements and receipts), `timestamp` (RFC 3161), `evidence` (a
193
+ single-file package with an offline check), `deliver` (a record encrypted to one verifier's public key).
194
+
195
+ ## Reproduce the numbers
196
+
197
+ The evaluation keys are **public by design**: key *i* is `SHA-256("ep-gpu-eval/2026-09/master/<i>")`
198
+ ([`bench/gpu/common.py`](bench/gpu/common.py)), so anyone can re-derive them and recompute every detection. The
199
+ phases are scripts with a hard cost cap per machine; each step leaves a log and resumes where it stopped.
200
+
201
+ | Phase | What | Script |
202
+ |---|---|---|
203
+ | A | every experiment on one 7B model | [`run_phase_a.sh`](bench/gpu/run_phase_a.sh) |
204
+ | B | the same records verified on other GPU architectures; calibration across machines | [`run_phase_b.sh`](bench/gpu/run_phase_b.sh) |
205
+ | C | a million-trial null; KGW and SynthID-Text against length-matched human nulls; three more model families | [`run_phase_c.sh`](bench/gpu/run_phase_c.sh) |
206
+
207
+ Each has a CPU dry run (`smoke_phase_*.sh`) that exercises every call on a small model before a paid machine starts.
208
+
209
+ ## Specification and a second implementation
210
+
211
+ - Formats: [`spec/ep1.cddl`](spec/ep1.cddl) — the record, the statements, receipts, the evidence package. No floating
212
+ point on the wire: tolerances in integer micro-units, p-values from counts.
213
+ - Test vectors: [`spec/test-vectors/ep1-vectors.json`](spec/test-vectors/ep1-vectors.json), regenerated by
214
+ [`spec/make_vectors.py`](spec/make_vectors.py).
215
+ - An independent JavaScript implementation of every model-free part: [`impl-js/`](impl-js) — 130/130 vector checks.
216
+ CI regenerates the vectors with the Python reference, requires them to be byte-identical to the committed file, and
217
+ runs the JavaScript implementation against them.
218
+ - The canonical form (v5) normalizes as Unicode 14.0 does, whatever Unicode version a library ships, so two
219
+ implementations agree on every text; both decode untrusted CBOR within one profile
220
+ ([ARCHITECTURE §7e](ARCHITECTURE.md)).
221
+ - Fuzzing: one target per parser of untrusted input, property and differential targets that give the same input to
222
+ both implementations, seed corpora from real data, replayed and driven by Hypothesis in every test run and run
223
+ coverage-guided with atheris ([`fuzz/`](fuzz)).
224
+ - Design and rationale: [`ARCHITECTURE.md`](ARCHITECTURE.md).
225
+
226
+ Built on published standards: SCITT architecture (RFC 9943), COSE Receipts (RFC 9942), Certificate Transparency
227
+ v2 Merkle trees (RFC 9162), COSE Hash Envelope (RFC 9995), CWT claims in COSE (RFC 9597), RFC 3161 time stamps
228
+ (carried per RFC 9921), SCRAPI (draft-ietf-scitt-scrapi), COSE-HPKE (draft-ietf-cose-hpke).
229
+
230
+ ## Status
231
+
232
+ 0.1.0 — a reference implementation ahead of standardization. Formats may change before a specification is adopted
233
+ by a standards body; records name their canonical form and version, and older records keep verifying.
234
+
235
+ ## Verify a release
236
+
237
+ Every file of a release is signed with Sigstore by this repository's release workflow (one bundle,
238
+ `<file>.sigstore.json`, per file), and `SHA256SUMS` lists them all. With cosign 3:
239
+
240
+ ```bash
241
+ f=entropy_protocol-0.1.0-py3-none-any.whl
242
+ cosign verify-blob --bundle "$f.sigstore.json" --certificate-oidc-issuer https://token.actions.githubusercontent.com \
243
+ --certificate-identity https://github.com/entropy-ep1/entropy-protocol/.github/workflows/release.yml@refs/tags/v0.1.0 "$f"
244
+ gh attestation verify "$f" --repo entropy-ep1/entropy-protocol # GitHub's build-provenance attestation
245
+ ```
246
+
247
+ ## License and patents
248
+
249
+ Code: [Apache License 2.0](LICENSE). Patent applications cover this work; see [PATENTS.md](PATENTS.md) for the
250
+ commitment made to implementers of the specification.
251
+
252
+ ## Authors
253
+
254
+ Roman Oliinyk and Serhii Nikolaichuk. Cite as in [CITATION.cff](CITATION.cff). Security reports:
255
+ [SECURITY.md](SECURITY.md).