@mikeargento/bitgraph-verify 1.4.0 → 1.6.0
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/dist/fuse-member.d.ts +34 -0
- package/dist/fuse-member.d.ts.map +1 -0
- package/dist/fuse-member.js +306 -0
- package/dist/fuse-member.js.map +1 -0
- package/dist/fuse-verify.d.ts +3 -0
- package/dist/fuse-verify.d.ts.map +1 -1
- package/dist/fuse-verify.js +6 -2
- package/dist/fuse-verify.js.map +1 -1
- package/dist/fuse.d.ts +111 -2
- package/dist/fuse.d.ts.map +1 -1
- package/dist/fuse.js +258 -5
- package/dist/fuse.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/fuse-member.ts +432 -0
- package/src/fuse-verify.ts +7 -4
- package/src/fuse.ts +285 -6
- package/src/index.ts +8 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { BitGraphProof, VerificationPolicy } from "./types.js";
|
|
2
|
+
import { type FuseVerifyResult } from "./fuse-verify.js";
|
|
3
|
+
export type FuseMemberCategory = "SET_MEMBER_DIRECT" | "SET_MEMBER_FROM_ORIGIN" | "SET_NOT_MEMBER" | "RECONSTRUCTION_MISMATCH" | "INVALID_SET_MANIFEST" | "INVALID_SLOT_COMMITMENT" | "INVALID_ORIGIN_ATTRIBUTION" | "INVALID_UNDERLYING_PROOF" | "UNDETERMINED_PLACEMENT" | "NO_MATCH";
|
|
4
|
+
export interface FuseSetEvidence {
|
|
5
|
+
/** Where the manifest bytes came from: the proof's metadata, or the caller's argument. */
|
|
6
|
+
manifestSource: "metadata" | "argument";
|
|
7
|
+
/** SHA-256 of the bound manifest bytes; equals artifactDigestB64 once bound. */
|
|
8
|
+
manifestDigestB64: string;
|
|
9
|
+
memberCount: number;
|
|
10
|
+
/** The matched row. Non-null ONLY on the two member categories. */
|
|
11
|
+
member: {
|
|
12
|
+
index: number;
|
|
13
|
+
placement: string;
|
|
14
|
+
fusedDigestB64: string;
|
|
15
|
+
originDigestB64: string;
|
|
16
|
+
} | null;
|
|
17
|
+
}
|
|
18
|
+
export interface FuseMemberOptions {
|
|
19
|
+
proof: BitGraphProof;
|
|
20
|
+
bytes: Uint8Array;
|
|
21
|
+
/** Canonical set manifest bytes; when given they replace proof.metadata as the source and are never silently replaced by it. */
|
|
22
|
+
manifest?: Uint8Array | null;
|
|
23
|
+
trustAnchors?: VerificationPolicy;
|
|
24
|
+
/** Refuse to accept a span wider than this many positions (M - N). Never affects validity categories. */
|
|
25
|
+
maxPositions?: bigint | number;
|
|
26
|
+
}
|
|
27
|
+
/** Every FuseVerifyResult field keeps its name and type; `set` is the one added block. */
|
|
28
|
+
export type FuseMemberResult = Omit<FuseVerifyResult, "category"> & {
|
|
29
|
+
category: FuseMemberCategory;
|
|
30
|
+
/** Non-null ONLY once the manifest is bound (strict parse, hash, commitment). */
|
|
31
|
+
set: FuseSetEvidence | null;
|
|
32
|
+
};
|
|
33
|
+
export declare function verifyFuseMember(opts: FuseMemberOptions): Promise<FuseMemberResult>;
|
|
34
|
+
//# sourceMappingURL=fuse-member.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuse-member.d.ts","sourceRoot":"","sources":["../src/fuse-member.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAkBpE,OAAO,EAAyC,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEhG,MAAM,MAAM,kBAAkB,GAC1B,mBAAmB,GACnB,wBAAwB,GACxB,gBAAgB,GAChB,yBAAyB,GACzB,sBAAsB,GACtB,yBAAyB,GACzB,4BAA4B,GAC5B,0BAA0B,GAC1B,wBAAwB,GACxB,UAAU,CAAC;AAEf,MAAM,WAAW,eAAe;IAC9B,0FAA0F;IAC1F,cAAc,EAAE,UAAU,GAAG,UAAU,CAAC;IACxC,gFAAgF;IAChF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACtG;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,gIAAgI;IAChI,QAAQ,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,yGAAyG;IACzG,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,0FAA0F;AAC1F,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAClE,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,iFAAiF;IACjF,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;CAC7B,CAAC;AAoIF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA4MzF"}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Mike Argento. Licensed under the MIT License. See LICENSE.
|
|
2
|
+
/**
|
|
3
|
+
* BitGraph Sets, phase 1: verifying ONE MEMBER of a set.
|
|
4
|
+
*
|
|
5
|
+
* A set is N files fused under ONE slot. The committed artifact is the
|
|
6
|
+
* canonical set manifest (placement set/1, see fuse.ts) and every member's
|
|
7
|
+
* fused bytes carry the set's commitment via the member's own placement.
|
|
8
|
+
* verifyFuse answers for the manifest; this module answers for a member.
|
|
9
|
+
*
|
|
10
|
+
* Given a proof whose signed attribution declares set/1 and a file:
|
|
11
|
+
* 1. Verify the proof as an ordinary bitgraph/1 proof. Fail: stop.
|
|
12
|
+
* 2. Recompute the commitment c from the proof's own slot record.
|
|
13
|
+
* 3. Bind the manifest: strict parse, hash equal to the SIGNED artifact
|
|
14
|
+
* digest, commitment equal to c. proof.metadata is unsigned, so no row
|
|
15
|
+
* is read from it before this binding holds.
|
|
16
|
+
* 4. Hash equals a listed member's artifact digest: the bytes ARE the
|
|
17
|
+
* member; locate c in them per the row's placement, compare.
|
|
18
|
+
* 5. Hash equals a listed origin: rebuild that member from this file, c
|
|
19
|
+
* and the row's placement; the rebuilt hash must equal the row.
|
|
20
|
+
* 6. Neither, yet a registered placement locates exactly c in the bytes:
|
|
21
|
+
* the bytes were made after the slot existed but are not part of the
|
|
22
|
+
* committed set. Otherwise NO_MATCH: the proof proves nothing about them.
|
|
23
|
+
*
|
|
24
|
+
* INSEPARABILITY. A verifier that checks only the floor accepts the "51st
|
|
25
|
+
* file" (read c off any member, staple it to new content); one that checks
|
|
26
|
+
* only membership gives no floor. Here the two cannot be called apart:
|
|
27
|
+
* membership is tested only against a BoundSet, a list sealed to the signed
|
|
28
|
+
* artifact and to the proof's own slot; the floor and the membership run
|
|
29
|
+
* together inside admit(); and the only function able to emit a member
|
|
30
|
+
* category takes the Admitted token that admit() alone produces, and
|
|
31
|
+
* re-asserts both checks before it does. Nothing exported yields a verdict
|
|
32
|
+
* fragment: parseSetManifest returns rows and a commitment, readSetMetadata
|
|
33
|
+
* returns bytes, set/1.locate returns only the commitment.
|
|
34
|
+
*/
|
|
35
|
+
import { sha256 } from "@noble/hashes/sha256";
|
|
36
|
+
import { verifyProofIntegrity } from "./verifier.js";
|
|
37
|
+
import { base64ToBytes, bytesEqual, bytesToBase64, bytesToHex, computeSlotCommitment, getPlacement, PLACEMENTS, parseSetManifest, readFuseAttribution, readSetMetadata, SET_METADATA_KEY, SET_PLACEMENT_ID, } from "./fuse.js";
|
|
38
|
+
import { floorStatement, spanOf } from "./fuse-verify.js";
|
|
39
|
+
/**
|
|
40
|
+
* The only constructor of a BoundSet. In order: strict parse, SHA-256 of the
|
|
41
|
+
* bytes equal to the SIGNED artifact digest, manifest commitment equal to the
|
|
42
|
+
* commitment recomputed from the proof's own slot record.
|
|
43
|
+
*/
|
|
44
|
+
function bindSetManifest(proof, commitment, bytes, source) {
|
|
45
|
+
const manifest = parseSetManifest(bytes);
|
|
46
|
+
if (manifest === null) {
|
|
47
|
+
return { category: "INVALID_SET_MANIFEST", reason: "the set manifest is not canonical bitgraph-fuse/1 set/1 bytes" };
|
|
48
|
+
}
|
|
49
|
+
const digest = sha256(bytes);
|
|
50
|
+
const artifact = base64ToBytes(proof.artifact.digestB64);
|
|
51
|
+
if (artifact === null || !bytesEqual(digest, artifact)) {
|
|
52
|
+
return { category: "INVALID_SET_MANIFEST", reason: "the set manifest does not hash to the committed artifact digest" };
|
|
53
|
+
}
|
|
54
|
+
if (!bytesEqual(manifest.commitment, commitment)) {
|
|
55
|
+
return { category: "INVALID_SLOT_COMMITMENT", reason: "the commitment in the committed set manifest does not match the proof's slot record" };
|
|
56
|
+
}
|
|
57
|
+
const byArtifact = new Map();
|
|
58
|
+
const byOrigin = new Map();
|
|
59
|
+
manifest.members.forEach((row, index) => {
|
|
60
|
+
byArtifact.set(bytesToHex(row.artifact), index);
|
|
61
|
+
const origin = bytesToHex(row.origin);
|
|
62
|
+
byOrigin.set(origin, [...(byOrigin.get(origin) ?? []), index]);
|
|
63
|
+
});
|
|
64
|
+
const bound = { source, digestB64: bytesToBase64(digest), commitment, rows: manifest.members, byArtifact, byOrigin };
|
|
65
|
+
return bound;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The one place both checks run together. (a) Membership: the bytes hash to
|
|
69
|
+
* this row's artifact digest and the row belongs to the bound list. (b) The
|
|
70
|
+
* floor: the commitment located in the bytes per the row's placement equals
|
|
71
|
+
* the bound commitment. (c) Origin consistency: any origin the fused bytes
|
|
72
|
+
* embed agrees with the row. The direct path (supplied bytes) and the origin
|
|
73
|
+
* path (rebuilt bytes) both come through here; there is no second
|
|
74
|
+
* implementation.
|
|
75
|
+
*/
|
|
76
|
+
function admit(bound, fusedBytes, row) {
|
|
77
|
+
const index = bound.byArtifact.get(bytesToHex(row.artifact));
|
|
78
|
+
if (index === undefined || bound.rows[index] !== row || !bytesEqual(sha256(fusedBytes), row.artifact)) {
|
|
79
|
+
// Unreachable through verifyFuseMember, which admits only a row it found
|
|
80
|
+
// by this digest; kept so no refactor can admit without the check.
|
|
81
|
+
throw new Error("admit: the bytes are not the listed member");
|
|
82
|
+
}
|
|
83
|
+
const placement = getPlacement(row.placement);
|
|
84
|
+
if (placement === undefined) {
|
|
85
|
+
return { category: "UNDETERMINED_PLACEMENT", placement: null, reason: `placement "${row.placement}" is not registered; the commitment cannot be located` };
|
|
86
|
+
}
|
|
87
|
+
const located = placement.locate(fusedBytes);
|
|
88
|
+
if (located === null) {
|
|
89
|
+
return {
|
|
90
|
+
category: "INVALID_SLOT_COMMITMENT",
|
|
91
|
+
placement: placement.id,
|
|
92
|
+
reason: `listed in the committed set manifest, but no ${placement.id} commitment is found in the bytes; membership without the floor is not a member verdict`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (!bytesEqual(located.commitment, bound.commitment)) {
|
|
96
|
+
return {
|
|
97
|
+
category: "INVALID_SLOT_COMMITMENT",
|
|
98
|
+
placement: placement.id,
|
|
99
|
+
reason: "listed in the committed set manifest, but the bytes carry a commitment to a different slot; membership without the floor is not a member verdict",
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const embedded = located.originDigest ?? (located.originalBytes !== undefined ? sha256(located.originalBytes) : undefined);
|
|
103
|
+
let originCompared = false;
|
|
104
|
+
if (embedded !== undefined) {
|
|
105
|
+
if (!bytesEqual(embedded, row.origin)) {
|
|
106
|
+
return { category: "INVALID_ORIGIN_ATTRIBUTION", placement: placement.id, reason: "the origin digest listed for this member does not match the origin inside the fused bytes" };
|
|
107
|
+
}
|
|
108
|
+
originCompared = true;
|
|
109
|
+
}
|
|
110
|
+
const admitted = { bound, index, row, placement, located, originCompared };
|
|
111
|
+
return admitted;
|
|
112
|
+
}
|
|
113
|
+
/** The stray's two-part reason: made after the slot, yet not in the committed set. */
|
|
114
|
+
function strayReason(span, memberCount) {
|
|
115
|
+
const slot = span !== null ? `the slot allocated at position ${span.slotCounter}` : "its slot";
|
|
116
|
+
const commit = span !== null ? `committed at position ${span.commitCounter}` : "at its commit";
|
|
117
|
+
return `these bytes carry the commitment of ${slot}, so they were made after that slot existed, but their digest is not among the ${memberCount} members listed in the set manifest ${commit}; the set proof does not cover them`;
|
|
118
|
+
}
|
|
119
|
+
export async function verifyFuseMember(opts) {
|
|
120
|
+
const { proof, bytes } = opts;
|
|
121
|
+
const fileDigest = sha256(bytes);
|
|
122
|
+
const fileDigestB64 = bytesToBase64(fileDigest);
|
|
123
|
+
const artifactDigestB64 = proof?.artifact?.digestB64 ?? "";
|
|
124
|
+
const base = (category, extra, reason) => ({
|
|
125
|
+
category,
|
|
126
|
+
proof: extra.proof ?? { valid: true },
|
|
127
|
+
marker: extra.marker ?? null,
|
|
128
|
+
placement: extra.placement ?? null,
|
|
129
|
+
fileDigestB64,
|
|
130
|
+
artifactDigestB64,
|
|
131
|
+
originDigestB64: extra.originDigestB64 ?? null,
|
|
132
|
+
slotCommitmentB64: extra.slotCommitmentB64 ?? null,
|
|
133
|
+
span: extra.span ?? null,
|
|
134
|
+
policy: extra.policy ?? { spanExceeded: false, maxPositions: null },
|
|
135
|
+
statements: extra.statements ?? [],
|
|
136
|
+
reason,
|
|
137
|
+
set: extra.set ?? null,
|
|
138
|
+
});
|
|
139
|
+
// 1. The underlying proof.
|
|
140
|
+
const integrity = await verifyProofIntegrity(opts.trustAnchors !== undefined ? { proof, trustAnchors: opts.trustAnchors } : { proof });
|
|
141
|
+
if (!integrity.valid) {
|
|
142
|
+
const reason = integrity.reason ?? "proof failed verification";
|
|
143
|
+
return base("INVALID_UNDERLYING_PROOF", { proof: { valid: false, reason } }, reason);
|
|
144
|
+
}
|
|
145
|
+
// 2. The marker: signed fused, with the placement set/1 DECLARED. An
|
|
146
|
+
// undeclared title is refused so that this verifier and verifyFuse
|
|
147
|
+
// agree on one proof: set/1 is not in the undeclared scan, so verifyFuse
|
|
148
|
+
// finds no commitment in an undeclared set's manifest and reports
|
|
149
|
+
// INVALID_SLOT_COMMITMENT; admitting its members here would contradict
|
|
150
|
+
// that verdict. A set/1 marker carrying an origin digest is out of
|
|
151
|
+
// profile (a set has no single origin) and is refused as well.
|
|
152
|
+
const marker = readFuseAttribution(proof);
|
|
153
|
+
const span = spanOf(proof);
|
|
154
|
+
const maxPositions = opts.maxPositions === undefined ? null : BigInt(opts.maxPositions);
|
|
155
|
+
const policy = {
|
|
156
|
+
spanExceeded: maxPositions !== null && span !== null && BigInt(span.positions) > maxPositions,
|
|
157
|
+
maxPositions: maxPositions === null ? null : maxPositions.toString(),
|
|
158
|
+
};
|
|
159
|
+
const common = { proof: { valid: true }, marker, span, policy };
|
|
160
|
+
if (marker === null || marker.placement !== SET_PLACEMENT_ID) {
|
|
161
|
+
return base("INVALID_SET_MANIFEST", common, "the proof is not marked set/1; verifyFuse answers for this proof");
|
|
162
|
+
}
|
|
163
|
+
if (marker.originDigest !== undefined) {
|
|
164
|
+
return base("INVALID_SET_MANIFEST", common, "the proof is marked set/1 but its signed attribution names an origin digest; a set has no single origin");
|
|
165
|
+
}
|
|
166
|
+
// 3. The commitment, from the proof's own slot record.
|
|
167
|
+
const slot = proof.slotAllocation;
|
|
168
|
+
if (slot === undefined) {
|
|
169
|
+
return base("INVALID_SLOT_COMMITMENT", common, "the proof carries no slot record, so no commitment can be recomputed");
|
|
170
|
+
}
|
|
171
|
+
let commitment;
|
|
172
|
+
try {
|
|
173
|
+
commitment = computeSlotCommitment(slot);
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
return base("INVALID_SLOT_COMMITMENT", common, `commitment could not be recomputed: ${err instanceof Error ? err.message : String(err)}`);
|
|
177
|
+
}
|
|
178
|
+
const slotCommitmentB64 = bytesToBase64(commitment);
|
|
179
|
+
const withSlot = { ...common, slotCommitmentB64 };
|
|
180
|
+
// 4. Bind the manifest. An explicit argument replaces the metadata source
|
|
181
|
+
// and is never silently replaced by it.
|
|
182
|
+
const explicit = opts.manifest === undefined || opts.manifest === null ? null : opts.manifest;
|
|
183
|
+
const metadata = explicit === null ? readSetMetadata(proof) : null;
|
|
184
|
+
const source = explicit !== null ? { bytes: explicit, from: "argument" } : metadata !== null ? { bytes: metadata, from: "metadata" } : null;
|
|
185
|
+
if (source === null) {
|
|
186
|
+
return base("INVALID_SET_MANIFEST", withSlot, `no set manifest: none under proof.metadata["${SET_METADATA_KEY}"] and none supplied`);
|
|
187
|
+
}
|
|
188
|
+
const bound = bindSetManifest(proof, commitment, source.bytes, source.from);
|
|
189
|
+
if ("category" in bound)
|
|
190
|
+
return base(bound.category, withSlot, bound.reason);
|
|
191
|
+
const evidence = (member) => ({
|
|
192
|
+
manifestSource: bound.source,
|
|
193
|
+
manifestDigestB64: bound.digestB64,
|
|
194
|
+
memberCount: bound.rows.length,
|
|
195
|
+
member,
|
|
196
|
+
});
|
|
197
|
+
const withSet = { ...withSlot, set: evidence(null) };
|
|
198
|
+
// The only producer of a member category. It re-executes both checks on
|
|
199
|
+
// the token before answering, so a verdict cannot become true by token
|
|
200
|
+
// forgery or by an edit that reorders the steps above.
|
|
201
|
+
const memberResult = (admitted, path) => {
|
|
202
|
+
const { index, row, placement, located } = admitted;
|
|
203
|
+
if (admitted.bound !== bound || !bytesEqual(located.commitment, bound.commitment)) {
|
|
204
|
+
throw new Error("verifyFuseMember: floor re-assertion failed");
|
|
205
|
+
}
|
|
206
|
+
if (bound.byArtifact.get(bytesToHex(row.artifact)) !== index || bound.rows[index] !== row) {
|
|
207
|
+
throw new Error("verifyFuseMember: membership re-assertion failed");
|
|
208
|
+
}
|
|
209
|
+
const count = bound.rows.length;
|
|
210
|
+
const statements = [];
|
|
211
|
+
if (span !== null) {
|
|
212
|
+
if (path === "direct") {
|
|
213
|
+
statements.push(`These exact fused bytes are member ${index + 1} of ${count} listed in the set manifest committed at position ${span.commitCounter}.`);
|
|
214
|
+
if (admitted.originCompared) {
|
|
215
|
+
statements.push("The fused bytes carry an origin digest that matches the set manifest; the original itself was not supplied and was not checked.");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
statements.push(`The supplied original rebuilds member ${index + 1} of ${count} of the committed set byte for byte, so these exact original bytes existed no later than commit position ${span.commitCounter}.`);
|
|
220
|
+
}
|
|
221
|
+
statements.push(floorStatement(span));
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
category: path === "direct" ? "SET_MEMBER_DIRECT" : "SET_MEMBER_FROM_ORIGIN",
|
|
225
|
+
proof: { valid: true },
|
|
226
|
+
marker,
|
|
227
|
+
placement: placement.id,
|
|
228
|
+
fileDigestB64,
|
|
229
|
+
artifactDigestB64,
|
|
230
|
+
originDigestB64: bytesToBase64(row.origin),
|
|
231
|
+
slotCommitmentB64,
|
|
232
|
+
span,
|
|
233
|
+
policy,
|
|
234
|
+
statements,
|
|
235
|
+
reason: null,
|
|
236
|
+
set: evidence({ index, placement: placement.id, fusedDigestB64: bytesToBase64(row.artifact), originDigestB64: bytesToBase64(row.origin) }),
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
// 5. The bytes are the committed manifest itself: verifyFuse answers for it.
|
|
240
|
+
if (fileDigestB64 === artifactDigestB64) {
|
|
241
|
+
return base("NO_MATCH", withSet, "these bytes are the committed set manifest itself, not a member; verifyFuse answers for the manifest");
|
|
242
|
+
}
|
|
243
|
+
// 6. Direct path: the bytes hash to a listed member. Authoritative when it
|
|
244
|
+
// applies: its failure is the verdict, with no fall-through.
|
|
245
|
+
const fileHex = bytesToHex(fileDigest);
|
|
246
|
+
const directIndex = bound.byArtifact.get(fileHex);
|
|
247
|
+
if (directIndex !== undefined) {
|
|
248
|
+
const row = bound.rows[directIndex];
|
|
249
|
+
const verdict = admit(bound, bytes, row);
|
|
250
|
+
if ("category" in verdict) {
|
|
251
|
+
return base(verdict.category, { ...withSet, placement: verdict.placement, originDigestB64: bytesToBase64(row.origin) }, verdict.reason);
|
|
252
|
+
}
|
|
253
|
+
return memberResult(verdict, "direct");
|
|
254
|
+
}
|
|
255
|
+
// 7. Origin path: the bytes hash to a listed origin. This runs before any
|
|
256
|
+
// stray verdict: a fused file listed only as the origin of a further
|
|
257
|
+
// member is an origin here, not a stray.
|
|
258
|
+
const originRows = bound.byOrigin.get(fileHex);
|
|
259
|
+
if (originRows !== undefined) {
|
|
260
|
+
const unregistered = [];
|
|
261
|
+
const candidates = [];
|
|
262
|
+
for (const index of originRows) {
|
|
263
|
+
const row = bound.rows[index];
|
|
264
|
+
const p = getPlacement(row.placement);
|
|
265
|
+
if (p === undefined) {
|
|
266
|
+
unregistered.push(row.placement);
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
candidates.push(p.id);
|
|
270
|
+
if (!p.byteExact)
|
|
271
|
+
continue;
|
|
272
|
+
let rebuilt;
|
|
273
|
+
try {
|
|
274
|
+
rebuilt = p.build({ original: bytes, originDigest: fileDigest, commitment });
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
if (!bytesEqual(sha256(rebuilt), row.artifact))
|
|
280
|
+
continue;
|
|
281
|
+
const verdict = admit(bound, rebuilt, row);
|
|
282
|
+
if ("category" in verdict) {
|
|
283
|
+
return base(verdict.category, { ...withSet, placement: verdict.placement, originDigestB64: fileDigestB64 }, verdict.reason);
|
|
284
|
+
}
|
|
285
|
+
return memberResult(verdict, "origin");
|
|
286
|
+
}
|
|
287
|
+
if (candidates.length === 0) {
|
|
288
|
+
return base("UNDETERMINED_PLACEMENT", { ...withSet, originDigestB64: fileDigestB64 }, `placement "${unregistered.join('", "')}" is not registered; the fused bytes cannot be rebuilt`);
|
|
289
|
+
}
|
|
290
|
+
return base("RECONSTRUCTION_MISMATCH", { ...withSet, placement: candidates[0] ?? null, originDigestB64: fileDigestB64 }, `rebuilding ${candidates.join(" or ")} from this file and the proof's slot record does not reproduce the listed member digest`);
|
|
291
|
+
}
|
|
292
|
+
// 8. Stray scan: bytes that carry this slot's commitment yet are listed
|
|
293
|
+
// nowhere. Made after the slot, not part of the committed set: the
|
|
294
|
+
// two-part verdict, with no rendered floor.
|
|
295
|
+
for (const p of PLACEMENTS) {
|
|
296
|
+
const l = p.locate(bytes);
|
|
297
|
+
if (l === null)
|
|
298
|
+
continue;
|
|
299
|
+
if (bytesEqual(l.commitment, commitment)) {
|
|
300
|
+
return base("SET_NOT_MEMBER", { ...withSet, placement: p.id, statements: [] }, strayReason(span, bound.rows.length));
|
|
301
|
+
}
|
|
302
|
+
return base("NO_MATCH", withSet, "these bytes carry a commitment to a different slot; the proof proves nothing about them");
|
|
303
|
+
}
|
|
304
|
+
return base("NO_MATCH", withSet, "this file is neither a listed member nor a listed original and carries no commitment to this slot; the proof proves nothing about it");
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=fuse-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuse-member.js","sourceRoot":"","sources":["../src/fuse-member.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EACL,aAAa,EACb,UAAU,EACV,aAAa,EACb,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GAIjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,EAAwC,MAAM,kBAAkB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,GAAG,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,eAAe,EAAE,aAAa,EAAE,EAChF,cAAc,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,yFAAyF,CAC/H,CAAC;IACJ,CAAC;IAED,wEAAwE;IACxE,sEAAsE;IACtE,+CAA+C;IAC/C,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,IAAI;YAAE,SAAS;QACzB,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC;YACzC,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACvH,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,yFAAyF,CAAC,CAAC;IAC9H,CAAC;IACD,OAAO,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,sIAAsI,CAAC,CAAC;AAC3K,CAAC"}
|
package/dist/fuse-verify.d.ts
CHANGED
|
@@ -44,6 +44,9 @@ export interface FuseVerifyOptions {
|
|
|
44
44
|
/** Refuse to accept a span wider than this many positions (M - N). Never affects validity categories. */
|
|
45
45
|
maxPositions?: bigint | number;
|
|
46
46
|
}
|
|
47
|
+
export declare function spanOf(proof: BitGraphProof): FuseSpan | null;
|
|
48
|
+
/** The floor sentence every fused verdict ends with: bounded below by the slot, above by the commit. */
|
|
49
|
+
export declare function floorStatement(span: FuseSpan): string;
|
|
47
50
|
export declare function verifyFuse(opts: FuseVerifyOptions): Promise<FuseVerifyResult>;
|
|
48
51
|
/**
|
|
49
52
|
* Strict ordering between two proofs where counters are comparable (same
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fuse-verify.d.ts","sourceRoot":"","sources":["../src/fuse-verify.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAUL,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,cAAc,GACd,mBAAmB,GACnB,yBAAyB,GACzB,yBAAyB,GACzB,4BAA4B,GAC5B,0BAA0B,GAC1B,wBAAwB,GACxB,UAAU,CAAC;AAEf,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,YAAY,CAAC;IACvB,mEAAmE;IACnE,KAAK,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,wDAAwD;IACxD,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,sEAAsE;IACtE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iFAAiF;IACjF,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,8EAA8E;IAC9E,MAAM,EAAE;QAAE,YAAY,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;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
|
|
27
27
|
import { bytesEqual, bytesToBase64, computeSlotCommitment, getPlacement, PLACEMENTS, mergeMarkers, parseFrame, readFrameMarker, readFuseAttribution, } from "./fuse.js";
|
|
28
|
-
function spanOf(proof) {
|
|
28
|
+
export function spanOf(proof) {
|
|
29
29
|
const c = proof.commit;
|
|
30
30
|
if (typeof c.counter !== "string" || typeof c.slotCounter !== "string" || typeof c.epochId !== "string")
|
|
31
31
|
return null;
|
|
@@ -44,6 +44,10 @@ function spanOf(proof) {
|
|
|
44
44
|
positions,
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
/** The floor sentence every fused verdict ends with: bounded below by the slot, above by the commit. */
|
|
48
|
+
export function floorStatement(span) {
|
|
49
|
+
return `The exact fused bytes could not feasibly have been finalized before their signed slot allocation at position ${span.slotCounter}, and were committed no later than position ${span.commitCounter}.`;
|
|
50
|
+
}
|
|
47
51
|
function statements(category, span, originMatched) {
|
|
48
52
|
if (span === null)
|
|
49
53
|
return [];
|
|
@@ -60,7 +64,7 @@ function statements(category, span, originMatched) {
|
|
|
60
64
|
out.push("The fused bytes carry an origin digest that matches the signed marker; the original itself was not supplied and was not checked.");
|
|
61
65
|
}
|
|
62
66
|
if (category === "FUSED_DIRECT" || category === "FUSED_FROM_ORIGIN") {
|
|
63
|
-
out.push(
|
|
67
|
+
out.push(floorStatement(span));
|
|
64
68
|
}
|
|
65
69
|
if (category === "RECORDED") {
|
|
66
70
|
out.push(`These exact bytes existed no later than commit position ${span.commitCounter}.`);
|
package/dist/fuse-verify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fuse-verify.js","sourceRoot":"","sources":["../src/fuse-verify.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EACL,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Uint8Array;
|
|
61
61
|
} | null;
|
|
62
|
-
export type PlacementId = "trailer/1" | "container/1" | "produced/1";
|
|
62
|
+
export type PlacementId = "trailer/1" | "container/1" | "container/2" | "produced/1" | "set/1";
|
|
63
63
|
export interface Located {
|
|
64
64
|
/** The commitment found in the fused bytes. */
|
|
65
65
|
commitment: Uint8Array;
|
|
@@ -68,6 +68,11 @@ export interface Located {
|
|
|
68
68
|
/** The original's bytes as carried inside the fused bytes, for placements that carry them. */
|
|
69
69
|
originalBytes?: Uint8Array;
|
|
70
70
|
}
|
|
71
|
+
/** What a Form A or B placement puts around the original: fused = prefix, original, suffix. */
|
|
72
|
+
export interface FusedFrame {
|
|
73
|
+
prefix: Uint8Array;
|
|
74
|
+
suffix: Uint8Array;
|
|
75
|
+
}
|
|
71
76
|
export interface Placement {
|
|
72
77
|
readonly id: PlacementId;
|
|
73
78
|
/** A: in-file placement of an existing original; B: container; C: produced artifact. */
|
|
@@ -82,11 +87,115 @@ export interface Placement {
|
|
|
82
87
|
}): Uint8Array;
|
|
83
88
|
/** Find the commitment in fused bytes, or null when the marker is absent or malformed. */
|
|
84
89
|
locate(fused: Uint8Array): Located | null;
|
|
90
|
+
/**
|
|
91
|
+
* Forms A and B: the bytes around the original, such that
|
|
92
|
+
* build({original, originDigest, commitment}) is exactly prefix, original,
|
|
93
|
+
* suffix. A producer that streams the original once can hash the prefix and
|
|
94
|
+
* the original as they pass and finish with the suffix later.
|
|
95
|
+
*/
|
|
96
|
+
frame?(input: {
|
|
97
|
+
originalSize: number;
|
|
98
|
+
originDigest: Uint8Array;
|
|
99
|
+
commitment: Uint8Array;
|
|
100
|
+
}): FusedFrame;
|
|
101
|
+
/**
|
|
102
|
+
* The prefix when it depends on the original's size alone, so a scanner can
|
|
103
|
+
* hash it before any slot exists; null when the prefix carries the
|
|
104
|
+
* commitment (container/1) and the fused digest needs the bytes again.
|
|
105
|
+
*/
|
|
106
|
+
scanPrefix?(originalSize: number): Uint8Array | null;
|
|
85
107
|
}
|
|
86
108
|
/** Registered placements in the fixed order a verifier tries them when none is declared. */
|
|
87
109
|
export declare const PLACEMENTS: readonly Placement[];
|
|
110
|
+
export declare const SET_PLACEMENT_ID: "set/1";
|
|
111
|
+
/**
|
|
112
|
+
* The proof.metadata key under which a set proof carries its manifest as a
|
|
113
|
+
* parsed plain object: the profile id itself, namespaced so it cannot collide
|
|
114
|
+
* with a site's own metadata keys. metadata is UNSIGNED and advisory. The
|
|
115
|
+
* manifest is protected only because its canonical bytes must hash to the
|
|
116
|
+
* signed artifact digest, which verifyFuseMember checks before reading a row.
|
|
117
|
+
*/
|
|
118
|
+
export declare const SET_METADATA_KEY: "bitgraph-fuse/1";
|
|
119
|
+
/** One member of a set, bytes view: the build input and the parse output. */
|
|
120
|
+
export interface SetMember {
|
|
121
|
+
/** SHA-256 of the member's FUSED bytes. */
|
|
122
|
+
artifact: Uint8Array;
|
|
123
|
+
/** SHA-256 of the member's ORIGINAL bytes; selects the rebuild path and feeds lookup by original. */
|
|
124
|
+
origin: Uint8Array;
|
|
125
|
+
/** The placement that carries the commitment inside this member's fused bytes. */
|
|
126
|
+
placement: string;
|
|
127
|
+
}
|
|
128
|
+
/** The manifest as JSON: the type of the value under proof.metadata[SET_METADATA_KEY]. */
|
|
129
|
+
export interface SetManifest {
|
|
130
|
+
members: Array<{
|
|
131
|
+
artifact: {
|
|
132
|
+
algorithm: "sha256";
|
|
133
|
+
digest: string;
|
|
134
|
+
};
|
|
135
|
+
origin: {
|
|
136
|
+
algorithm: "sha256";
|
|
137
|
+
digest: string;
|
|
138
|
+
};
|
|
139
|
+
placement: string;
|
|
140
|
+
}>;
|
|
141
|
+
placement: typeof SET_PLACEMENT_ID;
|
|
142
|
+
slotCommitment: {
|
|
143
|
+
algorithm: "sha256";
|
|
144
|
+
digest: string;
|
|
145
|
+
};
|
|
146
|
+
type: typeof FUSE_PROFILE;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Build the canonical set manifest bytes. Rows are sorted strictly ascending
|
|
150
|
+
* by artifact digest (byte order, which is the lexicographic order of the
|
|
151
|
+
* lowercase hex), so the same members in any input order give the same bytes.
|
|
152
|
+
* Throws on a commitment or digest that is not 32 bytes, an empty list, a
|
|
153
|
+
* malformed placement id, a member placement of "set/1" (no nesting in v1),
|
|
154
|
+
* or a duplicate artifact digest. Duplicate ORIGIN digests are permitted: one
|
|
155
|
+
* original fused two ways is two members with two artifact digests.
|
|
156
|
+
*/
|
|
157
|
+
export declare function buildSetManifest(commitment: Uint8Array, members: readonly SetMember[]): Uint8Array;
|
|
158
|
+
/**
|
|
159
|
+
* Strict parse of set manifest bytes, in the style of parseFusePayload. The
|
|
160
|
+
* bytes must be valid UTF-8 JSON, a plain object with exactly the keys
|
|
161
|
+
* {members, placement, slotCommitment, type}, the profile type, placement
|
|
162
|
+
* "set/1", a lowercase-hex 32-byte commitment, at least one row, every row
|
|
163
|
+
* exactly {artifact, origin, placement} with 32-byte digests and a
|
|
164
|
+
* well-formed placement id other than "set/1", and finally must equal
|
|
165
|
+
* buildSetManifest over what was read byte for byte. That one comparison
|
|
166
|
+
* rejects whitespace, key reordering, duplicate JSON keys (a duplicate cannot
|
|
167
|
+
* survive a round trip), unsorted or duplicated rows, non-canonical escapes
|
|
168
|
+
* and trailing bytes. Registration of a row's placement is NOT checked here:
|
|
169
|
+
* a v2 placement must not poison v1 readers, and it surfaces per row as
|
|
170
|
+
* UNDETERMINED_PLACEMENT at verify time. Returns null on any deviation.
|
|
171
|
+
*/
|
|
172
|
+
export declare function parseSetManifest(bytes: Uint8Array): {
|
|
173
|
+
commitment: Uint8Array;
|
|
174
|
+
members: SetMember[];
|
|
175
|
+
} | null;
|
|
176
|
+
/**
|
|
177
|
+
* The manifest bytes a proof carries under proof.metadata[SET_METADATA_KEY],
|
|
178
|
+
* re-canonicalized from the parsed object, or null when there is none or it
|
|
179
|
+
* is not a plain object. UNBOUND and UNVALIDATED: metadata is unsigned, so
|
|
180
|
+
* this returns bytes only, never rows. Nothing reads a member from it except
|
|
181
|
+
* through verifyFuseMember, which first requires these bytes to parse
|
|
182
|
+
* strictly and to hash to the signed artifact digest.
|
|
183
|
+
*/
|
|
184
|
+
export declare function readSetMetadata(proof: BitGraphProof): Uint8Array | null;
|
|
185
|
+
/**
|
|
186
|
+
* Resolve a placement by id. set/1 resolves here but is NOT in PLACEMENTS:
|
|
187
|
+
* the undeclared scan is for bytes whose placement was not declared, whereas
|
|
188
|
+
* a set manifest is identified by hashing to the signed artifact digest and
|
|
189
|
+
* by its signed title, so the scan order of every existing fixture is
|
|
190
|
+
* literally unchanged.
|
|
191
|
+
*/
|
|
88
192
|
export declare function getPlacement(id: string): Placement | undefined;
|
|
89
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* attribution.name = "bitgraph-fuse/1" (the profile id), title = placement id,
|
|
195
|
+
* message = origin digest in standard base64. A set has no single origin, so
|
|
196
|
+
* set/1 refuses an origin digest: a set/1 marker carrying one is out of
|
|
197
|
+
* profile and verifyFuseMember refuses it.
|
|
198
|
+
*/
|
|
90
199
|
export declare function fuseAttribution(placement: PlacementId, originDigest?: Uint8Array): Attribution;
|
|
91
200
|
export type MarkerSource = "attribution" | "manifest";
|
|
92
201
|
/**
|
package/dist/fuse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fuse.d.ts","sourceRoot":"","sources":["../src/fuse.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM7E,eAAO,MAAM,YAAY,EAAG,iBAA0B,CAAC;AAEvD,gFAAgF;AAChF,eAAO,MAAM,WAAW,EAAE,UAMtB,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,mBAAe,CAAC;AAElD,0FAA0F;AAC1F,eAAO,MAAM,aAAa,EAAG,UAAmB,CAAC;AACjD,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,gDAAgD;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