verifyhash 0.1.1 → 0.1.2
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.
- package/docs/ANCHORING.md +43 -22
- package/package.json +3 -2
- package/verifier/README.md +29 -0
- package/verifier/dist/BUILD-PROVENANCE.json +6 -6
- package/verifier/dist/verify-vh-standalone.js +1005 -3
- package/verifier/dist/verify-vh-standalone.js.sha256 +1 -1
- package/verifier/package.json +1 -1
- package/verifier/verify-vh.js +1002 -0
package/docs/ANCHORING.md
CHANGED
|
@@ -43,11 +43,12 @@ logged), and a chainId outside the known local/testnet set refuses without `--i-
|
|
|
43
43
|
Exit contract: `0` anchored / `3` named reject (an invalid artifact, or the registry's own revert
|
|
44
44
|
such as `AlreadyAnchored`) / `2` usage / `1` IO-network-key.
|
|
45
45
|
|
|
46
|
-
`verify-anchored` is **OFFLINE by default** — no key, no network
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
`verify-anchored` is **OFFLINE by default** — no key, no network. The same offline binding leg also
|
|
47
|
+
runs with **zero producer stack**: the standalone `verifier/` tree recognizes `vh-anchored-receipt@1`
|
|
48
|
+
(`verify-vh <receipt> --anchored-artifact <sealed-file>`, see **Independent verification** below), so
|
|
49
|
+
"verify without installing the producer's stack" now covers the receipt too. Either way the check is
|
|
50
|
+
the same: the receipt is validated strictly and the artifact's digest is **recomputed** through the
|
|
51
|
+
same closed table; any deviation is a specific named reject (`digest-mismatch` /
|
|
51
52
|
`kind-mismatch` / `how-mismatch` / `bad-receipt` / the artifact's own named reject). With **both** `--rpc` and `--contract` it additionally authenticates the registry
|
|
52
53
|
(the standing identity probe — no record is believed until the contract self-identifies) and
|
|
53
54
|
re-checks every chain fact the receipt claims. Exit `0` ACCEPTED / `3` REJECTED / `2` / `1` — the
|
|
@@ -86,31 +87,51 @@ Spelled out:
|
|
|
86
87
|
`timestamp-request`/`timestamp-wrap`/`verify-timestamp`) is a third party's *existed-by-genTime*
|
|
87
88
|
attestation. An on-chain anchor (C) complements them; it does not replace them.
|
|
88
89
|
|
|
89
|
-
## Independent verification — the
|
|
90
|
+
## Independent verification — the anchored receipt verifies standalone too (T-70.4)
|
|
90
91
|
|
|
91
92
|
The verifyhash family's headline is that a counterparty can verify a sealed artifact **OFFLINE,
|
|
92
93
|
without installing the producer's stack**: the standalone `verifier/` bundle
|
|
93
94
|
([`../verifier/dist/verify-vh-standalone.js`](../verifier/dist/verify-vh-standalone.js)) is a single,
|
|
94
95
|
dependency-free file — **no `ethers`, no `npm install`** — that re-derives an evidence packet's or
|
|
95
|
-
agent packet's digest by itself. That promise
|
|
96
|
+
agent packet's digest by itself. That promise DOES cover the **sealed artifact underneath** an
|
|
96
97
|
anchored receipt: hand a counterparty the `*.vhevidence.json` (or any closed-table artifact) and they
|
|
97
98
|
verify it standalone, exactly as before, with no producer code.
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
Since **T-70.4** it also covers the **anchored receipt's OFFLINE binding leg itself**:
|
|
101
|
+
`vh-anchored-receipt@1` **IS a recognized kind in the standalone `verifier/verify-vh.js` tree**. A
|
|
102
|
+
counterparty handed a receipt plus the sealed artifact it anchors checks the binding with zero
|
|
103
|
+
producer code — from this repo, or from the single-file bundle:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
node verifier/verify-vh.js examples/anchoring/anchored-receipt.local.json \
|
|
107
|
+
--anchored-artifact examples/anchoring/sample-seal.vhevidence.json
|
|
108
|
+
# zero-install, same command: node verify-vh-standalone.js <receipt> --anchored-artifact <sealed-file>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The standalone validates the receipt strictly (an edited in-band trust note is the named
|
|
112
|
+
`bad-receipt`) and **recomputes** the artifact's digest through the SAME closed kind table the
|
|
113
|
+
producer core uses — each leg re-validating the artifact through a strict, `ethers`-free port of its
|
|
114
|
+
shipped validator, over the verifier's own dependency-free keccak/sha256. The verdicts match the
|
|
115
|
+
producer cli's on the same inputs: ACCEPTED exit `0`, or the specific named reject
|
|
116
|
+
(`digest-mismatch` / `kind-mismatch` / `how-mismatch` / `bad-receipt` / the artifact's own named
|
|
117
|
+
reject) exit `3` — the packaging gap disclosed here before T-70.4 is **closed**.
|
|
118
|
+
|
|
119
|
+
**Chain-class guidance (so a local-dev receipt is never mistaken for a public proof).** On ACCEPT the
|
|
120
|
+
standalone also classifies the chain the receipt *claims* and surfaces it as a stable, machine-gateable
|
|
121
|
+
part of the `--json` contract — `chainClass` (`local-dev` / `public-testnet` / `unknown`) plus a
|
|
122
|
+
`publiclyMeaningful` boolean (and a leading human-readable `WARNING`/`ADVISORY` line). The offline leg
|
|
123
|
+
cannot (by definition) confirm the digest is actually on-chain, but it *can* tell a counterparty that a
|
|
124
|
+
receipt from a **local dev chain** proves mechanism only and is worth nothing publicly (STRATEGY.md
|
|
125
|
+
**P-2**) — the committed `chainId 31337` fixture is flagged exactly that way. The classification never
|
|
126
|
+
changes the accept/reject decision; it is additive trust context the counterparty's own tooling can
|
|
127
|
+
gate on. The id sets mirror the producer's `cli/anchor.js` known-testnet set (pinned by a drift guard).
|
|
128
|
+
|
|
129
|
+
**The honest remaining boundary.** The standalone checks the OFFLINE **binding leg only**: the
|
|
130
|
+
receipt's `chain` facts remain the **anchorer's claim** until re-checked against the chain, and that
|
|
131
|
+
re-check needs a chain endpoint by definition — it stays with the producer cli
|
|
132
|
+
(`vh verify-anchored --rpc <url> --contract <addr>`, whose `cli/` stack loads `ethers` at module
|
|
133
|
+
load: `cli/anchor-artifact.js` → `cli/core/attestation.js`). What a receipt proves — and does NOT
|
|
134
|
+
prove — is unchanged either way (see the trust note above).
|
|
114
135
|
|
|
115
136
|
## The free line
|
|
116
137
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "verifyhash",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Tamper-evident, permissionless on-chain registry of code-contribution hashes, plus an offline data-provenance toolkit (the `vh` CLI).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "index.js",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"!docs/ADOPTION.json",
|
|
39
39
|
"!docs/DECIDE.md",
|
|
40
40
|
"!docs/DEPLOY-PUBLIC-SITE.md",
|
|
41
|
-
"!docs/AUDIT.md"
|
|
41
|
+
"!docs/AUDIT.md",
|
|
42
|
+
"!docs/VENDOR-PROVENANCE.md"
|
|
42
43
|
],
|
|
43
44
|
"engines": {
|
|
44
45
|
"node": ">=18"
|
package/verifier/README.md
CHANGED
|
@@ -403,6 +403,35 @@ self-asserted (the packet's own in-band trust note says the same).
|
|
|
403
403
|
|
|
404
404
|
---
|
|
405
405
|
|
|
406
|
+
## 2d. Verify an ANCHORED RECEIPT's binding (`vh-anchored-receipt@1`) — zero producer stack (T-70.4)
|
|
407
|
+
|
|
408
|
+
The producer's `vh anchor-artifact` binds a sealed artifact's ONE canonical digest into an on-chain
|
|
409
|
+
registry record and emits a canonical **`vh-anchored-receipt@1`** container. The receipt's OFFLINE
|
|
410
|
+
**binding leg** verifies here — same zero-install posture, no `ethers`, no producer code:
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
node verify-vh.js receipt.vhanchored.json --anchored-artifact packet.vhevidence.json
|
|
414
|
+
# same flags on the single-file bundle: node verify-vh-standalone.js <receipt> --anchored-artifact <sealed-file>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
The receipt is validated STRICTLY (unknown/missing fields, malformed chain facts, or an edited
|
|
418
|
+
in-band trust note are each a named `bad-receipt`), and the sealed artifact's digest is RECOMPUTED
|
|
419
|
+
through the SAME closed six-kind table the producer core uses (evidence seal, agent-session packet,
|
|
420
|
+
journal tree head, TrustLedger reconciliation seal, dataset/parcel attestation — each re-validated
|
|
421
|
+
through a strict, dependency-free port of its shipped validator first). ACCEPT is exit `0`; any
|
|
422
|
+
deviation is the specific named reject — `digest-mismatch` / `kind-mismatch` / `how-mismatch` /
|
|
423
|
+
`bad-receipt` / the artifact's own named reject — exit `3`, matching the producer cli's verdicts on
|
|
424
|
+
the same inputs. On ACCEPT the verdict also **classifies the chain the receipt claims** — `chainClass`
|
|
425
|
+
(`local-dev` / `public-testnet` / `unknown`) and a `publiclyMeaningful` boolean in `--json`, plus a
|
|
426
|
+
leading `WARNING`/`ADVISORY` line — so a receipt from a **local dev chain** (worth nothing publicly,
|
|
427
|
+
STRATEGY.md P-2) is never mistaken for a public proof. **The honest boundary:** this is the OFFLINE
|
|
428
|
+
binding leg ONLY — the receipt's `chain` facts remain the *anchorer's claim* until re-checked against
|
|
429
|
+
the chain, which needs a chain endpoint by definition and stays with the producer cli
|
|
430
|
+
(`vh verify-anchored --rpc --contract`). See
|
|
431
|
+
[`docs/ANCHORING.md`](../docs/ANCHORING.md) for what an anchored receipt proves and does NOT.
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
406
435
|
## 3. The exact bytes verified, and the scheme
|
|
407
436
|
|
|
408
437
|
Nothing here is magic; it is two standard primitives you can re-implement in an afternoon.
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"verify": {
|
|
6
6
|
"bundle": "verify-vh-standalone.js",
|
|
7
7
|
"sidecar": "verify-vh-standalone.js.sha256",
|
|
8
|
-
"bundleBytes":
|
|
9
|
-
"bundleSha256": "
|
|
10
|
-
"sidecarLine": "
|
|
8
|
+
"bundleBytes": 247462,
|
|
9
|
+
"bundleSha256": "6de719e11e3885c733aca329a10e4d25f0dff1e5f24d85934a43b3f766d4c0b0",
|
|
10
|
+
"sidecarLine": "6de719e11e3885c733aca329a10e4d25f0dff1e5f24d85934a43b3f766d4c0b0 verify-vh-standalone.js",
|
|
11
11
|
"modules": [
|
|
12
12
|
{
|
|
13
13
|
"id": "keccak256-vendored",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"id": "verify-vh",
|
|
70
70
|
"synthetic": false,
|
|
71
71
|
"sourceFile": "verifier/verify-vh.js",
|
|
72
|
-
"sourceSha256": "
|
|
73
|
-
"inlinedSha256": "
|
|
72
|
+
"sourceSha256": "35e04d3adc1f66125f282c76553a33d5551f6c9783948d410c6a52ffa401a807",
|
|
73
|
+
"inlinedSha256": "fd2eb607800118cafc0d5a79c077150cbe9eb03f5de4a8898cbd30031d412ccc",
|
|
74
74
|
"entry": true
|
|
75
75
|
}
|
|
76
76
|
]
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"id": "verify-vh-engine",
|
|
184
184
|
"synthetic": false,
|
|
185
185
|
"sourceFile": "verifier/verify-vh.js",
|
|
186
|
-
"sourceSha256": "
|
|
186
|
+
"sourceSha256": "35e04d3adc1f66125f282c76553a33d5551f6c9783948d410c6a52ffa401a807",
|
|
187
187
|
"inlinedSha256": "0e7069b4e04d7602110fed07f90a086822750040054da07335b8bbae16c945c0",
|
|
188
188
|
"entry": true,
|
|
189
189
|
"note": "the marked T-66.1 pure-engine slice of verifier/verify-vh.js (the bytes between its BEGIN/END engine markers), wrapped in a build-generated __require preamble + exports postamble; sourceSha256 pins the WHOLE verify-vh.js source file"
|