@mikeargento/bitgraph 1.9.1 → 1.10.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.
Files changed (248) hide show
  1. package/README.md +21 -21
  2. package/dist/fuse-cli.js +2 -2
  3. package/dist/fuse-cli.js.map +1 -1
  4. package/dist/fuse.d.ts +15 -1
  5. package/dist/fuse.d.ts.map +1 -1
  6. package/dist/fuse.js +29 -12
  7. package/dist/fuse.js.map +1 -1
  8. package/package.json +12 -8
  9. package/src/fuse-cli.ts +2 -2
  10. package/src/fuse.ts +46 -13
  11. package/dist/__tests__/audit-anchors.test.d.ts +0 -2
  12. package/dist/__tests__/audit-anchors.test.d.ts.map +0 -1
  13. package/dist/__tests__/audit-anchors.test.js +0 -152
  14. package/dist/__tests__/audit-anchors.test.js.map +0 -1
  15. package/dist/__tests__/audit-anomalies.test.d.ts +0 -2
  16. package/dist/__tests__/audit-anomalies.test.d.ts.map +0 -1
  17. package/dist/__tests__/audit-anomalies.test.js +0 -663
  18. package/dist/__tests__/audit-anomalies.test.js.map +0 -1
  19. package/dist/__tests__/audit-attestation.test.d.ts +0 -2
  20. package/dist/__tests__/audit-attestation.test.d.ts.map +0 -1
  21. package/dist/__tests__/audit-attestation.test.js +0 -403
  22. package/dist/__tests__/audit-attestation.test.js.map +0 -1
  23. package/dist/__tests__/audit-bench-smoke.test.d.ts +0 -2
  24. package/dist/__tests__/audit-bench-smoke.test.d.ts.map +0 -1
  25. package/dist/__tests__/audit-bench-smoke.test.js +0 -87
  26. package/dist/__tests__/audit-bench-smoke.test.js.map +0 -1
  27. package/dist/__tests__/audit-boundary.test.d.ts +0 -20
  28. package/dist/__tests__/audit-boundary.test.d.ts.map +0 -1
  29. package/dist/__tests__/audit-boundary.test.js +0 -84
  30. package/dist/__tests__/audit-boundary.test.js.map +0 -1
  31. package/dist/__tests__/audit-cli.test.d.ts +0 -2
  32. package/dist/__tests__/audit-cli.test.d.ts.map +0 -1
  33. package/dist/__tests__/audit-cli.test.js +0 -239
  34. package/dist/__tests__/audit-cli.test.js.map +0 -1
  35. package/dist/__tests__/audit-dependencies.test.d.ts +0 -2
  36. package/dist/__tests__/audit-dependencies.test.d.ts.map +0 -1
  37. package/dist/__tests__/audit-dependencies.test.js +0 -116
  38. package/dist/__tests__/audit-dependencies.test.js.map +0 -1
  39. package/dist/__tests__/audit-fixtures.d.ts +0 -265
  40. package/dist/__tests__/audit-fixtures.d.ts.map +0 -1
  41. package/dist/__tests__/audit-fixtures.js +0 -511
  42. package/dist/__tests__/audit-fixtures.js.map +0 -1
  43. package/dist/__tests__/audit-ingest.test.d.ts +0 -2
  44. package/dist/__tests__/audit-ingest.test.d.ts.map +0 -1
  45. package/dist/__tests__/audit-ingest.test.js +0 -473
  46. package/dist/__tests__/audit-ingest.test.js.map +0 -1
  47. package/dist/__tests__/audit-memory-ingest.test.d.ts +0 -12
  48. package/dist/__tests__/audit-memory-ingest.test.d.ts.map +0 -1
  49. package/dist/__tests__/audit-memory-ingest.test.js +0 -135
  50. package/dist/__tests__/audit-memory-ingest.test.js.map +0 -1
  51. package/dist/__tests__/audit-property.test.d.ts +0 -2
  52. package/dist/__tests__/audit-property.test.d.ts.map +0 -1
  53. package/dist/__tests__/audit-property.test.js +0 -771
  54. package/dist/__tests__/audit-property.test.js.map +0 -1
  55. package/dist/__tests__/audit-real-fixtures.test.d.ts +0 -2
  56. package/dist/__tests__/audit-real-fixtures.test.d.ts.map +0 -1
  57. package/dist/__tests__/audit-real-fixtures.test.js +0 -132
  58. package/dist/__tests__/audit-real-fixtures.test.js.map +0 -1
  59. package/dist/__tests__/audit-real-live.test.d.ts +0 -2
  60. package/dist/__tests__/audit-real-live.test.d.ts.map +0 -1
  61. package/dist/__tests__/audit-real-live.test.js +0 -107
  62. package/dist/__tests__/audit-real-live.test.js.map +0 -1
  63. package/dist/__tests__/audit-reconstruct.test.d.ts +0 -2
  64. package/dist/__tests__/audit-reconstruct.test.d.ts.map +0 -1
  65. package/dist/__tests__/audit-reconstruct.test.js +0 -287
  66. package/dist/__tests__/audit-reconstruct.test.js.map +0 -1
  67. package/dist/__tests__/audit-report.test.d.ts +0 -2
  68. package/dist/__tests__/audit-report.test.d.ts.map +0 -1
  69. package/dist/__tests__/audit-report.test.js +0 -186
  70. package/dist/__tests__/audit-report.test.js.map +0 -1
  71. package/dist/__tests__/audit-roundtrip.test.d.ts +0 -2
  72. package/dist/__tests__/audit-roundtrip.test.d.ts.map +0 -1
  73. package/dist/__tests__/audit-roundtrip.test.js +0 -368
  74. package/dist/__tests__/audit-roundtrip.test.js.map +0 -1
  75. package/dist/__tests__/audit-temporal.test.d.ts +0 -2
  76. package/dist/__tests__/audit-temporal.test.d.ts.map +0 -1
  77. package/dist/__tests__/audit-temporal.test.js +0 -364
  78. package/dist/__tests__/audit-temporal.test.js.map +0 -1
  79. package/dist/__tests__/audit-tiers.test.d.ts +0 -2
  80. package/dist/__tests__/audit-tiers.test.d.ts.map +0 -1
  81. package/dist/__tests__/audit-tiers.test.js +0 -282
  82. package/dist/__tests__/audit-tiers.test.js.map +0 -1
  83. package/dist/__tests__/audit-witness-real.test.d.ts +0 -19
  84. package/dist/__tests__/audit-witness-real.test.d.ts.map +0 -1
  85. package/dist/__tests__/audit-witness-real.test.js +0 -82
  86. package/dist/__tests__/audit-witness-real.test.js.map +0 -1
  87. package/dist/__tests__/audit-witness.test.d.ts +0 -2
  88. package/dist/__tests__/audit-witness.test.d.ts.map +0 -1
  89. package/dist/__tests__/audit-witness.test.js +0 -308
  90. package/dist/__tests__/audit-witness.test.js.map +0 -1
  91. package/dist/__tests__/canonical.test.d.ts +0 -2
  92. package/dist/__tests__/canonical.test.d.ts.map +0 -1
  93. package/dist/__tests__/canonical.test.js +0 -162
  94. package/dist/__tests__/canonical.test.js.map +0 -1
  95. package/dist/__tests__/chain-hash-anchor.test.d.ts +0 -22
  96. package/dist/__tests__/chain-hash-anchor.test.d.ts.map +0 -1
  97. package/dist/__tests__/chain-hash-anchor.test.js +0 -55
  98. package/dist/__tests__/chain-hash-anchor.test.js.map +0 -1
  99. package/dist/__tests__/commit-service.integration.test.d.ts +0 -2
  100. package/dist/__tests__/commit-service.integration.test.d.ts.map +0 -1
  101. package/dist/__tests__/commit-service.integration.test.js +0 -95
  102. package/dist/__tests__/commit-service.integration.test.js.map +0 -1
  103. package/dist/__tests__/constructor.test.d.ts +0 -2
  104. package/dist/__tests__/constructor.test.d.ts.map +0 -1
  105. package/dist/__tests__/constructor.test.js +0 -267
  106. package/dist/__tests__/constructor.test.js.map +0 -1
  107. package/dist/__tests__/declared-proof-fixture.d.ts +0 -66
  108. package/dist/__tests__/declared-proof-fixture.d.ts.map +0 -1
  109. package/dist/__tests__/declared-proof-fixture.js +0 -66
  110. package/dist/__tests__/declared-proof-fixture.js.map +0 -1
  111. package/dist/__tests__/fuse-inline.test.d.ts +0 -2
  112. package/dist/__tests__/fuse-inline.test.d.ts.map +0 -1
  113. package/dist/__tests__/fuse-inline.test.js +0 -181
  114. package/dist/__tests__/fuse-inline.test.js.map +0 -1
  115. package/dist/__tests__/fuse-placement.test.d.ts +0 -2
  116. package/dist/__tests__/fuse-placement.test.d.ts.map +0 -1
  117. package/dist/__tests__/fuse-placement.test.js +0 -31
  118. package/dist/__tests__/fuse-placement.test.js.map +0 -1
  119. package/dist/__tests__/fuse-roundtrip.test.d.ts +0 -2
  120. package/dist/__tests__/fuse-roundtrip.test.d.ts.map +0 -1
  121. package/dist/__tests__/fuse-roundtrip.test.js +0 -241
  122. package/dist/__tests__/fuse-roundtrip.test.js.map +0 -1
  123. package/dist/__tests__/fuse-sdk.test.d.ts +0 -2
  124. package/dist/__tests__/fuse-sdk.test.d.ts.map +0 -1
  125. package/dist/__tests__/fuse-sdk.test.js +0 -117
  126. package/dist/__tests__/fuse-sdk.test.js.map +0 -1
  127. package/dist/__tests__/fuse-set-sdk.test.d.ts +0 -2
  128. package/dist/__tests__/fuse-set-sdk.test.d.ts.map +0 -1
  129. package/dist/__tests__/fuse-set-sdk.test.js +0 -721
  130. package/dist/__tests__/fuse-set-sdk.test.js.map +0 -1
  131. package/dist/__tests__/fuse-set.test.d.ts +0 -2
  132. package/dist/__tests__/fuse-set.test.d.ts.map +0 -1
  133. package/dist/__tests__/fuse-set.test.js +0 -889
  134. package/dist/__tests__/fuse-set.test.js.map +0 -1
  135. package/dist/__tests__/fuse-set2.test.d.ts +0 -2
  136. package/dist/__tests__/fuse-set2.test.d.ts.map +0 -1
  137. package/dist/__tests__/fuse-set2.test.js +0 -294
  138. package/dist/__tests__/fuse-set2.test.js.map +0 -1
  139. package/dist/__tests__/fuse-vectors.test.d.ts +0 -2
  140. package/dist/__tests__/fuse-vectors.test.d.ts.map +0 -1
  141. package/dist/__tests__/fuse-vectors.test.js +0 -175
  142. package/dist/__tests__/fuse-vectors.test.js.map +0 -1
  143. package/dist/__tests__/fuse-verify.test.d.ts +0 -2
  144. package/dist/__tests__/fuse-verify.test.d.ts.map +0 -1
  145. package/dist/__tests__/fuse-verify.test.js +0 -250
  146. package/dist/__tests__/fuse-verify.test.js.map +0 -1
  147. package/dist/__tests__/hello-world.test.d.ts +0 -2
  148. package/dist/__tests__/hello-world.test.d.ts.map +0 -1
  149. package/dist/__tests__/hello-world.test.js +0 -9
  150. package/dist/__tests__/hello-world.test.js.map +0 -1
  151. package/dist/__tests__/mock-proof-fixture.d.ts +0 -15
  152. package/dist/__tests__/mock-proof-fixture.d.ts.map +0 -1
  153. package/dist/__tests__/mock-proof-fixture.js +0 -34
  154. package/dist/__tests__/mock-proof-fixture.js.map +0 -1
  155. package/dist/__tests__/policy-enforcement.test.d.ts +0 -2
  156. package/dist/__tests__/policy-enforcement.test.d.ts.map +0 -1
  157. package/dist/__tests__/policy-enforcement.test.js +0 -188
  158. package/dist/__tests__/policy-enforcement.test.js.map +0 -1
  159. package/dist/__tests__/proof-hash-regression.test.d.ts +0 -2
  160. package/dist/__tests__/proof-hash-regression.test.d.ts.map +0 -1
  161. package/dist/__tests__/proof-hash-regression.test.js +0 -95
  162. package/dist/__tests__/proof-hash-regression.test.js.map +0 -1
  163. package/dist/__tests__/proof-hash.test.d.ts +0 -2
  164. package/dist/__tests__/proof-hash.test.d.ts.map +0 -1
  165. package/dist/__tests__/proof-hash.test.js +0 -116
  166. package/dist/__tests__/proof-hash.test.js.map +0 -1
  167. package/dist/__tests__/proof-integrity.test.d.ts +0 -2
  168. package/dist/__tests__/proof-integrity.test.d.ts.map +0 -1
  169. package/dist/__tests__/proof-integrity.test.js +0 -454
  170. package/dist/__tests__/proof-integrity.test.js.map +0 -1
  171. package/dist/__tests__/realistic-proof-fixture.d.ts +0 -56
  172. package/dist/__tests__/realistic-proof-fixture.d.ts.map +0 -1
  173. package/dist/__tests__/realistic-proof-fixture.js +0 -57
  174. package/dist/__tests__/realistic-proof-fixture.js.map +0 -1
  175. package/dist/__tests__/run.test.d.ts +0 -2
  176. package/dist/__tests__/run.test.d.ts.map +0 -1
  177. package/dist/__tests__/run.test.js +0 -178
  178. package/dist/__tests__/run.test.js.map +0 -1
  179. package/dist/__tests__/verifier.test.d.ts +0 -2
  180. package/dist/__tests__/verifier.test.d.ts.map +0 -1
  181. package/dist/__tests__/verifier.test.js +0 -531
  182. package/dist/__tests__/verifier.test.js.map +0 -1
  183. package/dist/canonical.d.ts +0 -54
  184. package/dist/canonical.d.ts.map +0 -1
  185. package/dist/canonical.js +0 -119
  186. package/dist/canonical.js.map +0 -1
  187. package/dist/proof-hash.d.ts +0 -9
  188. package/dist/proof-hash.d.ts.map +0 -1
  189. package/dist/proof-hash.js +0 -75
  190. package/dist/proof-hash.js.map +0 -1
  191. package/dist/types.d.ts +0 -705
  192. package/dist/types.d.ts.map +0 -1
  193. package/dist/types.js +0 -3
  194. package/dist/types.js.map +0 -1
  195. package/dist/verifier.d.ts +0 -27
  196. package/dist/verifier.d.ts.map +0 -1
  197. package/dist/verifier.js +0 -844
  198. package/dist/verifier.js.map +0 -1
  199. package/src/__tests__/audit-anchors.test.ts +0 -188
  200. package/src/__tests__/audit-anomalies.test.ts +0 -815
  201. package/src/__tests__/audit-attestation.test.ts +0 -529
  202. package/src/__tests__/audit-bench-smoke.test.ts +0 -108
  203. package/src/__tests__/audit-boundary.test.ts +0 -96
  204. package/src/__tests__/audit-cli.test.ts +0 -288
  205. package/src/__tests__/audit-dependencies.test.ts +0 -141
  206. package/src/__tests__/audit-fixtures.ts +0 -736
  207. package/src/__tests__/audit-ingest.test.ts +0 -575
  208. package/src/__tests__/audit-memory-ingest.test.ts +0 -156
  209. package/src/__tests__/audit-property.test.ts +0 -892
  210. package/src/__tests__/audit-real-fixtures.test.ts +0 -153
  211. package/src/__tests__/audit-real-live.test.ts +0 -128
  212. package/src/__tests__/audit-reconstruct.test.ts +0 -353
  213. package/src/__tests__/audit-report.test.ts +0 -222
  214. package/src/__tests__/audit-roundtrip.test.ts +0 -464
  215. package/src/__tests__/audit-temporal.test.ts +0 -446
  216. package/src/__tests__/audit-tiers.test.ts +0 -343
  217. package/src/__tests__/audit-witness-real.test.ts +0 -92
  218. package/src/__tests__/audit-witness.test.ts +0 -345
  219. package/src/__tests__/canonical.test.ts +0 -253
  220. package/src/__tests__/chain-hash-anchor.test.ts +0 -67
  221. package/src/__tests__/commit-service.integration.test.ts +0 -117
  222. package/src/__tests__/constructor.test.ts +0 -340
  223. package/src/__tests__/declared-proof-fixture.ts +0 -65
  224. package/src/__tests__/fuse-inline.test.ts +0 -211
  225. package/src/__tests__/fuse-placement.test.ts +0 -32
  226. package/src/__tests__/fuse-roundtrip.test.ts +0 -243
  227. package/src/__tests__/fuse-sdk.test.ts +0 -142
  228. package/src/__tests__/fuse-set-sdk.test.ts +0 -852
  229. package/src/__tests__/fuse-set.test.ts +0 -1027
  230. package/src/__tests__/fuse-set2.test.ts +0 -343
  231. package/src/__tests__/fuse-vectors.test.ts +0 -218
  232. package/src/__tests__/fuse-verify.test.ts +0 -278
  233. package/src/__tests__/hello-world.test.ts +0 -10
  234. package/src/__tests__/mock-proof-fixture.ts +0 -36
  235. package/src/__tests__/policy-enforcement.test.ts +0 -226
  236. package/src/__tests__/proof-hash-regression.test.ts +0 -107
  237. package/src/__tests__/proof-hash.test.ts +0 -129
  238. package/src/__tests__/proof-integrity.test.ts +0 -576
  239. package/src/__tests__/real-fixtures/anchor-after-112762.json +0 -47
  240. package/src/__tests__/real-fixtures/anchor-with-ethereum-112758.json +0 -47
  241. package/src/__tests__/real-fixtures/live-proof-0.json +0 -42
  242. package/src/__tests__/real-fixtures/live-proof-1.json +0 -43
  243. package/src/__tests__/real-fixtures/live-proof-2.json +0 -43
  244. package/src/__tests__/real-fixtures/successor-112760.json +0 -38
  245. package/src/__tests__/real-fixtures/witness-25525146.json +0 -6
  246. package/src/__tests__/real-fixtures/witness-25525147.json +0 -6
  247. package/src/__tests__/realistic-proof-fixture.ts +0 -57
  248. package/src/__tests__/verifier.test.ts +0 -624
package/src/fuse-cli.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  import { readFile, writeFile, mkdir } from "node:fs/promises";
22
22
  import { basename, extname, join, resolve } from "node:path";
23
23
  import { sha256 } from "@noble/hashes/sha256";
24
- import { parseFrame, verifyFuse, verifyFuseMember, bytesToBase64 } from "@mikeargento/bitgraph-verify";
24
+ import { parseFrame, verifyFuse, verifyFuseMember, bytesToBase64, isFuseMarkerName } from "@mikeargento/bitgraph-verify";
25
25
  import type { BitGraphProof, PlacementId, FuseVerifyResult, FuseMemberResult } from "@mikeargento/bitgraph-verify";
26
26
  import { fuse, fuseSet, builderFor, placementForBytes, fusedNamesFor, FuseError } from "./fuse.js";
27
27
  import type { FuseTransport } from "./fuse.js";
@@ -219,7 +219,7 @@ async function runCheck(args: Args): Promise<number> {
219
219
  const policy = typeof max === "string" ? { maxPositions: BigInt(max) } : {};
220
220
  // A set proof and a file that is not its manifest: the member verifier answers.
221
221
  const a = proof.attribution;
222
- if (a?.name === "bitgraph-fuse/1" && a.title === "set/1" && bytesToBase64(sha256(bytes)) !== proof.artifact.digestB64) {
222
+ if (isFuseMarkerName(a?.name) && a?.title === "set/1" && bytesToBase64(sha256(bytes)) !== proof.artifact.digestB64) {
223
223
  const manifestArg = args.flags.get("manifest");
224
224
  const manifest = typeof manifestArg === "string" ? new Uint8Array(await readFile(resolve(manifestArg))) : undefined;
225
225
  const r = await verifyFuseMember({ proof, bytes, ...(manifest !== undefined ? { manifest } : {}), ...policy });
package/src/fuse.ts CHANGED
@@ -51,6 +51,7 @@ import {
51
51
  bytesToBase64,
52
52
  bytesToHex,
53
53
  computeSlotCommitment,
54
+ producerCommitment,
54
55
  computeSlotRecordHash,
55
56
  fuseAttribution,
56
57
  getPlacement,
@@ -86,11 +87,22 @@ export async function digest(bytes: Uint8Array): Promise<Uint8Array> {
86
87
 
87
88
  export type { FuseFrame, PlacementId, SlotAllocation, BitGraphProof, SetManifest, FuseMemberResult, FuseVerifyResult } from "@mikeargento/bitgraph-verify";
88
89
 
90
+ /** The floor anchor an enclave v9 allocation hands back: the one it signs at commit as commit.slotAnchor. */
91
+ export interface AnchorMark {
92
+ counter: string;
93
+ blockNumber: number;
94
+ blockHash: string;
95
+ }
96
+
89
97
  /** What the builder receives. The raw nonce is deliberately absent. */
90
98
  export interface BuilderInput {
91
- /** 32-byte commitment to the signed slot record. Write this into the artifact. */
99
+ /** 32-byte commitment to the signed slot record (bitgraph-fuse/2 also binds the floor block). Write this into the artifact. */
92
100
  commitment: Uint8Array;
93
101
  commitmentHex: string;
102
+ /** Which commitment this is: 2 when the boundary returned its floor anchor (enclave v9 and later), else 1. */
103
+ fuseVersion: 1 | 2;
104
+ /** The floor bound into a fuse/2 commitment, when there is one. */
105
+ floor?: AnchorMark;
94
106
  /** The origin digest, when the fused artifact names a source. */
95
107
  originDigest?: Uint8Array;
96
108
  /** The signed slot record, for producers that want to embed its fields. Contains the nonce: do not copy it into the artifact. */
@@ -321,8 +333,21 @@ async function recover(
321
333
  return null;
322
334
  }
323
335
 
324
- /** 1. nonce. The signed slot record from the boundary; it must sit on the anchored chain. */
325
- async function allocateSlot(t: BoundTransport): Promise<SlotAllocation> {
336
+ function isAnchorMark(x: unknown): x is AnchorMark {
337
+ if (x === null || typeof x !== "object" || Array.isArray(x)) return false;
338
+ const a = x as Record<string, unknown>;
339
+ return typeof a.counter === "string" && /^(0|[1-9][0-9]*)$/.test(a.counter)
340
+ && typeof a.blockNumber === "number" && Number.isSafeInteger(a.blockNumber) && a.blockNumber >= 0
341
+ && typeof a.blockHash === "string" && /^0x[0-9a-f]{64}$/.test(a.blockHash);
342
+ }
343
+
344
+ /**
345
+ * 1. nonce. The signed slot record from the boundary; it must sit on the
346
+ * anchored chain. Since enclave v9 the response also carries the floor anchor
347
+ * the boundary will sign at commit; with it the producer makes a
348
+ * bitgraph-fuse/2 commitment, without it a fuse/1 one.
349
+ */
350
+ async function allocateSlot(t: BoundTransport): Promise<{ slot: SlotAllocation; anchor: AnchorMark | null }> {
326
351
  const alloc = await request(t, t.allocatePath, { method: "POST", body: {} });
327
352
  if (alloc.status === 503 && codeOf(alloc.json) === "tee-restarting") throw new FuseError("tee-restarting", messageOf(alloc.json, "the boundary is restarting"), 503);
328
353
  if (alloc.status !== 200) throw new FuseError("allocate-failed", messageOf(alloc.json, `allocation failed (${alloc.status})`), alloc.status);
@@ -330,7 +355,8 @@ async function allocateSlot(t: BoundTransport): Promise<SlotAllocation> {
330
355
  const slot = (alloc.json as { slot?: unknown } | null)?.slot;
331
356
  if (!isSlotRecord(slot) || slotId !== slot.nonceB64) throw new FuseError("allocate-failed", "the allocation response is not a slot record", alloc.status);
332
357
  if (slot.chainId !== "bitgraph:main") throw new FuseError("allocate-failed", "the slot is not on the anchored chain; a fused floor needs bitgraph:main");
333
- return slot;
358
+ const anchorRaw = (alloc.json as { anchor?: unknown } | null)?.anchor;
359
+ return { slot, anchor: isAnchorMark(anchorRaw) ? anchorRaw : null };
334
360
  }
335
361
 
336
362
  /**
@@ -407,13 +433,13 @@ export async function fuse(builder: FuseBuilder, options: FuseOptions): Promise<
407
433
  const originDigestB64 = originDigest !== undefined ? bytesToBase64(originDigest) : null;
408
434
 
409
435
  // 1. nonce
410
- const slot = await allocateSlot(t);
436
+ const { slot, anchor } = await allocateSlot(t);
411
437
 
412
438
  // 2. fuse
413
- const commitment = computeSlotCommitment(slot);
439
+ const { commitment, version } = producerCommitment(slot, anchor);
414
440
  let fused: Uint8Array;
415
441
  try {
416
- fused = await builder({ commitment, commitmentHex: bytesToHex(commitment), ...(originDigest !== undefined ? { originDigest } : {}), slot });
442
+ fused = await builder({ commitment, commitmentHex: bytesToHex(commitment), fuseVersion: version, ...(anchor !== null ? { floor: anchor } : {}), ...(originDigest !== undefined ? { originDigest } : {}), slot });
417
443
  } catch (err) {
418
444
  throw new FuseError("builder-failed", `the builder threw: ${err instanceof Error ? err.message : String(err)}`);
419
445
  }
@@ -425,13 +451,15 @@ export async function fuse(builder: FuseBuilder, options: FuseOptions): Promise<
425
451
  const artifactDigestB64 = bytesToBase64(artifactDigest);
426
452
 
427
453
  // 4. fill
428
- const attribution = fuseAttribution(placement.id, originDigest);
454
+ const attribution = fuseAttribution(placement.id, originDigest, version);
429
455
  const body: Record<string, unknown> = {
430
456
  digests: [{ digestB64: artifactDigestB64, hashAlg: "sha256" }],
431
457
  slotId: slot.nonceB64,
432
458
  slot,
433
459
  chainId: "bitgraph:main",
434
460
  attribution,
461
+ // fuse/2: the boundary checks the bound floor against its ledger before spending the slot.
462
+ ...(version === 2 ? { anchor } : {}),
435
463
  };
436
464
  if (options.agency !== undefined) body.agency = options.agency;
437
465
  const { proof, recovered } = await commitUnderSlot(t, body, artifactDigestB64, slot);
@@ -482,6 +510,10 @@ export type SetMemberPlacement = "trailer/1" | "container/1" | "container/2";
482
510
 
483
511
  /** What a hashed member's fused digest is computed for: the held slot and its commitment. */
484
512
  export interface FusedDigestInput {
513
+ /** Which commitment this is: 2 when the boundary returned its floor anchor, else 1. */
514
+ fuseVersion: 1 | 2;
515
+ /** The floor bound into a fuse/2 commitment, when there is one. */
516
+ floor?: AnchorMark;
485
517
  commitment: Uint8Array;
486
518
  commitmentHex: string;
487
519
  slot: SlotAllocation;
@@ -721,7 +753,7 @@ export async function fuseSet(members: readonly FuseSetMember[], options: FuseSe
721
753
  const t: BoundTransport = { ...DEFAULTS, ...(options.transport ?? {}) };
722
754
 
723
755
  // 1. nonce: one slot for the whole set
724
- const slot = await allocateSlot(t);
756
+ const { slot, anchor } = await allocateSlot(t);
725
757
 
726
758
  // 2. fuse: the commitment once, every member's digest under it. The slot
727
759
  // is held and its TTL is running; a throw here burns it but commits
@@ -729,7 +761,7 @@ export async function fuseSet(members: readonly FuseSetMember[], options: FuseSe
729
761
  // and released in turn, so memory holds one member's bytes at a time.
730
762
  // They are held only for a caller who keeps them or asks the full
731
763
  // verifier to read them.
732
- const commitment = computeSlotCommitment(slot);
764
+ const { commitment, version } = producerCommitment(slot, anchor);
733
765
  const commitmentHex = bytesToHex(commitment);
734
766
  const fusedBytes: (Uint8Array | null)[] = [];
735
767
  const rows: SetMember[] = [];
@@ -741,7 +773,7 @@ export async function fuseSet(members: readonly FuseSetMember[], options: FuseSe
741
773
  if (c.kind === "hashed") {
742
774
  let d: unknown;
743
775
  try {
744
- d = await c.fusedDigest!({ commitment, commitmentHex, slot });
776
+ d = await c.fusedDigest!({ commitment, commitmentHex, fuseVersion: version, ...(anchor !== null ? { floor: anchor } : {}), slot });
745
777
  } catch (err) {
746
778
  throw new FuseError("builder-failed", `member ${i}: fusedDigest threw: ${err instanceof Error ? err.message : String(err)}; ${expiring}`, null, i);
747
779
  }
@@ -766,7 +798,7 @@ export async function fuseSet(members: readonly FuseSetMember[], options: FuseSe
766
798
  const builder = c.builder ?? builderFor(c.id, original);
767
799
  let fused: Uint8Array;
768
800
  try {
769
- fused = await builder({ commitment, commitmentHex, originDigest: c.originDigest, slot });
801
+ fused = await builder({ commitment, commitmentHex, fuseVersion: version, ...(anchor !== null ? { floor: anchor } : {}), originDigest: c.originDigest, slot });
770
802
  } catch (err) {
771
803
  throw new FuseError("builder-failed", `member ${i}: the builder threw: ${err instanceof Error ? err.message : String(err)}`, null, i);
772
804
  }
@@ -817,8 +849,9 @@ export async function fuseSet(members: readonly FuseSetMember[], options: FuseSe
817
849
  slotId: slot.nonceB64,
818
850
  slot,
819
851
  chainId: "bitgraph:main",
820
- attribution: fuseAttribution(setKind === "set/1" ? SET_PLACEMENT_ID_LOCAL : SET2_PLACEMENT_ID),
852
+ attribution: fuseAttribution(setKind === "set/1" ? SET_PLACEMENT_ID_LOCAL : SET2_PLACEMENT_ID, undefined, version),
821
853
  metadata: { [SET_METADATA_KEY]: manifest },
854
+ ...(version === 2 ? { anchor } : {}),
822
855
  };
823
856
  if (options.agency !== undefined) body.agency = options.agency;
824
857
  report("commit", 0, 1);
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=audit-anchors.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit-anchors.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/audit-anchors.test.ts"],"names":[],"mappings":""}
@@ -1,152 +0,0 @@
1
- // Copyright (c) Argento Computing Inc. All rights reserved. See LICENSE.
2
- /**
3
- * Anchor identification tests (G5): the SIGNED attribution.name is the
4
- * discriminator; unsigned metadata.type is corroboration only, recorded
5
- * but never trusted; the block number comes only from the signed
6
- * Etherscan URL; no wall-clock time is ever derived from anything here.
7
- */
8
- import { describe, it } from "node:test";
9
- import * as assert from "node:assert/strict";
10
- import { identifyAnchors, ingestBundle, verifyObservedProofs, } from "@mikeargento/bitgraph-audit";
11
- import { makeAnchorProof, makeChainIdProof, makeTempDir, proofJson, writeBundleDir, } from "./audit-fixtures.js";
12
- const BLOCK_HASH = "0x28ed3639cd705fb8cb2b915c1991e9f808b40e775bc8eb540702942729fec2c0";
13
- async function ingestAndVerify(files) {
14
- const dir = await makeTempDir("bg-audit-anchors-");
15
- await writeBundleDir(dir, files);
16
- const ingest = await ingestBundle(dir);
17
- await verifyObservedProofs(ingest);
18
- return ingest;
19
- }
20
- describe("audit anchors: identification by signed attribution", () => {
21
- it("identifies an anchor by attribution.name and extracts the signed facts", async () => {
22
- const anchor = await makeAnchorProof({
23
- blockHash: BLOCK_HASH,
24
- blockNumber: "24800448",
25
- epochId: "EPOCH-A",
26
- counter: "4",
27
- slotCounter: "3",
28
- chainId: "bitgraph:main",
29
- metadata: {
30
- type: "ethereum-anchor",
31
- anchor: { blockNumber: 24800448, blockHash: BLOCK_HASH, blockTime: 1750000000 },
32
- },
33
- });
34
- const user = await makeChainIdProof({ chainId: "bitgraph:main", counter: "6", epochId: "EPOCH-A" });
35
- const ingest = await ingestAndVerify({
36
- "proofs/anchor.json": proofJson(anchor.proof),
37
- "proofs/user.json": proofJson(user.proof),
38
- });
39
- const result = identifyAnchors(ingest);
40
- assert.equal(result.anchors.length, 1);
41
- const record = result.anchors[0];
42
- assert.equal(record.proofHash, anchor.proofHash);
43
- assert.equal(record.epochId, "EPOCH-A");
44
- assert.equal(record.chainId, "bitgraph:main");
45
- assert.equal(record.counter, "4");
46
- assert.equal(record.slotCounter, "3");
47
- assert.equal(record.blockHash, BLOCK_HASH);
48
- assert.equal(record.blockNumber, "24800448");
49
- assert.equal(record.metadataCorroboration, "agrees");
50
- // The unsigned metadata carries a blockTime; no time field of any kind
51
- // may appear on the record.
52
- assert.ok(!("timestamp" in record));
53
- assert.ok(!("blockTime" in record));
54
- assert.equal(result.findings.length, 0);
55
- });
56
- it("copies the run verification status onto the record", async () => {
57
- const good = await makeAnchorProof({ blockHash: BLOCK_HASH, blockNumber: "1", epochId: "E", counter: "2" });
58
- const bad = await makeAnchorProof({ blockHash: BLOCK_HASH.replace("28", "29"), blockNumber: "2", epochId: "E", counter: "4" });
59
- // Tamper the signature after signing: identification still works (it
60
- // reads the signed body fields), and the failed status is copied.
61
- bad.proof.signer.signatureB64 = `AA${bad.proof.signer.signatureB64.slice(2)}`;
62
- const ingest = await ingestAndVerify({
63
- "proofs/good.json": proofJson(good.proof),
64
- "proofs/bad.json": proofJson(bad.proof),
65
- });
66
- const result = identifyAnchors(ingest);
67
- assert.equal(result.anchors.length, 2);
68
- const goodRecord = result.anchors.find((a) => a.proofHash === good.proofHash);
69
- assert.equal(goodRecord.verificationTier, "integrity");
70
- assert.equal(goodRecord.verificationStatus, "artifact-unavailable");
71
- const badRecord = result.anchors.find((a) => a.proofHash !== good.proofHash);
72
- assert.equal(badRecord.verificationStatus, "failed");
73
- assert.ok(badRecord.verificationReason !== undefined);
74
- });
75
- it("never identifies an anchor from unsigned metadata alone", async () => {
76
- const user = await makeChainIdProof({ counter: "2", epochId: "E-META" });
77
- user.proof["metadata"] = { type: "ethereum-anchor" };
78
- const ingest = await ingestAndVerify({ "proofs/claimant.json": proofJson(user.proof) });
79
- const result = identifyAnchors(ingest);
80
- assert.equal(result.anchors.length, 0);
81
- assert.equal(result.metadataOnlyProofHashes.length, 1);
82
- const finding = result.findings.find((f) => f.code === "anchor-metadata-only-claim");
83
- assert.ok(finding !== undefined);
84
- assert.match(finding.message, /not treated as an anchor/);
85
- });
86
- it("records disagreement between the signed attribution and unsigned metadata", async () => {
87
- const anchor = await makeAnchorProof({
88
- blockHash: BLOCK_HASH,
89
- blockNumber: "7",
90
- epochId: "E-DIS",
91
- counter: "2",
92
- metadata: { type: "something-else" },
93
- });
94
- const ingest = await ingestAndVerify({ "proofs/anchor.json": proofJson(anchor.proof) });
95
- const result = identifyAnchors(ingest);
96
- assert.equal(result.anchors.length, 1, "the signed field governs: still an anchor");
97
- assert.equal(result.anchors[0].metadataCorroboration, "disagrees");
98
- assert.ok(result.findings.some((f) => f.code === "anchor-metadata-disagreement"));
99
- });
100
- it("treats absent metadata as absent corroboration, not disagreement", async () => {
101
- const anchor = await makeAnchorProof({ blockHash: BLOCK_HASH, blockNumber: "9", epochId: "E-ABS", counter: "2" });
102
- const ingest = await ingestAndVerify({ "proofs/anchor.json": proofJson(anchor.proof) });
103
- const result = identifyAnchors(ingest);
104
- assert.equal(result.anchors[0].metadataCorroboration, "absent");
105
- assert.equal(result.findings.filter((f) => f.code === "anchor-metadata-disagreement").length, 0);
106
- });
107
- });
108
- describe("audit anchors: block number from the signed title URL", () => {
109
- it("parses the number only from a strict Etherscan block URL", async () => {
110
- const good = await makeAnchorProof({ blockHash: BLOCK_HASH, blockNumber: "24800448", epochId: "E-URL", counter: "2" });
111
- const foreign = await makeAnchorProof({
112
- blockHash: BLOCK_HASH.replace("28", "30"),
113
- title: "https://example.com/block/99",
114
- epochId: "E-URL",
115
- counter: "4",
116
- });
117
- const missing = await makeAnchorProof({
118
- blockHash: BLOCK_HASH.replace("28", "31"),
119
- noTitle: true,
120
- epochId: "E-URL",
121
- counter: "6",
122
- });
123
- const ingest = await ingestAndVerify({
124
- "proofs/good.json": proofJson(good.proof),
125
- "proofs/foreign.json": proofJson(foreign.proof),
126
- "proofs/missing.json": proofJson(missing.proof),
127
- });
128
- const result = identifyAnchors(ingest);
129
- const byHash = new Map(result.anchors.map((a) => [a.proofHash, a]));
130
- assert.equal(byHash.get(good.proofHash).blockNumber, "24800448");
131
- assert.equal(byHash.get(foreign.proofHash).blockNumber, undefined);
132
- assert.equal(byHash.get(missing.proofHash).blockNumber, undefined);
133
- assert.equal(result.findings.filter((f) => f.code === "anchor-title-unparseable").length, 2);
134
- });
135
- });
136
- describe("audit anchors: non-anchor proofs are untouched", () => {
137
- it("produces no records or findings for ordinary proofs and mutates nothing", async () => {
138
- const a = await makeChainIdProof({ counter: "2", epochId: "E-PLAIN" });
139
- const b = await makeChainIdProof({ counter: "4", epochId: "E-PLAIN" });
140
- const ingest = await ingestAndVerify({
141
- "proofs/a.json": proofJson(a.proof),
142
- "proofs/b.json": proofJson(b.proof),
143
- });
144
- const statusesBefore = ingest.proofs.map((p) => p.verification?.status);
145
- const result = identifyAnchors(ingest);
146
- assert.equal(result.anchors.length, 0);
147
- assert.equal(result.metadataOnlyProofHashes.length, 0);
148
- assert.equal(result.findings.length, 0);
149
- assert.deepEqual(ingest.proofs.map((p) => p.verification?.status), statusesBefore, "identification is read-only");
150
- });
151
- });
152
- //# sourceMappingURL=audit-anchors.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit-anchors.test.js","sourceRoot":"","sources":["../../src/__tests__/audit-anchors.test.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,YAAY,EACZ,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,MAAM,UAAU,GAAG,oEAAoE,CAAC;AAExF,KAAK,UAAU,eAAe,CAAC,KAA0C;IACvE,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACnD,MAAM,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,QAAQ,CAAC,qDAAqD,EAAE,GAAG,EAAE;IACnE,EAAE,CAAC,wEAAwE,EAAE,KAAK,IAAI,EAAE;QACtF,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC;YACnC,SAAS,EAAE,UAAU;YACrB,WAAW,EAAE,UAAU;YACvB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,GAAG;YACZ,WAAW,EAAE,GAAG;YAChB,OAAO,EAAE,eAAe;YACxB,QAAQ,EAAE;gBACR,IAAI,EAAE,iBAAiB;gBACvB,MAAM,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;aAChF;SACF,CAAC,CAAC;QACH,MAA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C,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;SACpC,CAAC,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAExE,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QAEvC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,SAAS,CACd,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,EAChD,cAAc,EACd,6BAA6B,CAC9B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=audit-anomalies.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit-anomalies.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/audit-anomalies.test.ts"],"names":[],"mappings":""}