@mikeargento/bitgraph 1.11.0 → 1.12.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/README.md CHANGED
@@ -1,12 +1,17 @@
1
1
  # BitGraph
2
2
 
3
- [![npm @mikeargento/bitgraph](https://img.shields.io/npm/v/@mikeargento/bitgraph?label=%40mikeargento%2Fbitgraph&color=cb3837)](https://www.npmjs.com/package/@mikeargento/bitgraph)
3
+ [![npm @mikeargento/bitgraph-sdk](https://img.shields.io/npm/v/@mikeargento/bitgraph-sdk?label=%40mikeargento%2Fbitgraph-sdk&color=cb3837)](https://www.npmjs.com/package/@mikeargento/bitgraph-sdk)
4
+ [![npm @mikeargento/bitgraph-verify](https://img.shields.io/npm/v/@mikeargento/bitgraph-verify?label=%40mikeargento%2Fbitgraph-verify&color=cb3837)](https://www.npmjs.com/package/@mikeargento/bitgraph-verify)
4
5
  [![Website](https://img.shields.io/badge/bitgraph.ing-live-0065A4)](https://bitgraph.ing)
5
6
  [![Docs](https://img.shields.io/badge/docs-0065A4)](https://bitgraph.ing/docs)
6
7
 
7
8
  ---
8
9
 
9
- BitGraphs are not labels or metadata added after the fact. They are new computations created when your file's hash *fills* a pre-existing, cryptographically reserved position, constraining the commitment so it cannot be retroactively constructed. The commit happens off-chain, inside the enclave, and produces a proof permanently bound to that exact digital state. Seconds later, a Merkle root over new records' proof hashes is written to Base, so each record also gets a ceiling in time.
10
+ **Position commitment for AI records.**
11
+
12
+ BitGraph begins the proof before the record arrives.
13
+
14
+ BitGraphs are not labels or metadata added after the fact. They are new computations created when your file's hash *fills* a pre-existing, cryptographically reserved position, constraining the commitment so it cannot be made after the fact. The commit happens off-chain, inside the enclave, and produces a proof permanently bound to that exact digital state. Seconds later, a Merkle root over new records' proof hashes is written to Base, so each record also gets a ceiling in time.
10
15
 
11
16
  Provenance can be enforced or it can be claimed. Most systems claim it: they bind a statement about the content to the content itself. That binding can be cryptographically strong, and it can be made at the moment of capture rather than afterward, so the weakness is not timing. The weakness is that a claim is something a trusted signer can attach to any artifact at all. The artifact does not have to satisfy any prior condition to receive one.
12
17
 
@@ -18,26 +23,25 @@ The first thing built on it is AI audit. A BitGraph is a verifiable receipt for
18
23
 
19
24
  ## Quickstart
20
25
 
21
- Make one in your browser at [bitgraph.ing/docs/try](https://bitgraph.ing/docs/try). The file never leaves your machine; only its fingerprint does. From an agent, connect the [MCP server](https://bitgraph.ing/docs/mcp) with one URL. To put a commitment inside a record your own system writes, follow the [integration guide](https://bitgraph.ing/docs/integration).
26
+ Make one in your browser at [bitgraph.ing/docs/try](https://bitgraph.ing/docs/try): the drop box. The file never leaves your machine; only its fingerprint does. From an agent, connect the [MCP server](https://bitgraph.ing/docs/mcp) at `bitgraph.ing/mcp` with one URL. From code, `npx -p @mikeargento/bitgraph-sdk bitgraph record <paths...>`. To put a commitment inside a record your own system writes, follow the [integration guide](https://bitgraph.ing/docs/integration).
27
+
28
+ Making a BitGraph of one or more files yields ONE position: a Merkle tree of the files (tree/1), one file a tree of one. What you keep is the **export** (bitgraph-export/1) beside the files, with `SPEC.md`, the exact text the proof pins. The owner's export lists every leaf and name; a member export holds one file's leaf and path. An export holds no copy of any file and no anchor proofs. `bitgraph export complete` adds the floor header, the Base ceiling and the Ethereum settlement later. If the export is lost, the file alone finds its proof again through its recovery entry (SPEC section 13).
22
29
 
23
- Verify a proof in code, with the MIT verifier:
30
+ Verify a file with its export in code, with the MIT verifier:
24
31
 
25
32
  ```bash
26
33
  npm install @mikeargento/bitgraph-verify
27
34
  ```
28
35
 
29
36
  ```ts
30
- import { verify, verifyFuse } from "@mikeargento/bitgraph-verify";
31
-
32
- const result = await verify({ proof, bytes });
33
- if (result.valid) {
34
- // structure, Ed25519 signature, position binding and the digest match all checked
35
- } else {
36
- console.error(result.reason);
37
- }
37
+ import { verifyExport } from "@mikeargento/bitgraph-verify";
38
+
39
+ const result = await verifyExport(exportJson, { bytes });
40
+ console.log(result.verdict); // TRUE, FALSE or UNDETERMINED
41
+ for (const c of result.claims) console.log(c.name, c.result, c.restsOn);
38
42
  ```
39
43
 
40
- `verify()` answers whether the proof is sound and whether these exact bytes are the ones it committed. Whether those bytes *carry* the position commitment is a separate question, and `verifyFuse()` in the same package is what answers it: that check is the one showing the bytes could not have been finished before the position existed. A fused file, or a record with its own commitment field, wants both.
44
+ `verifyExport()` answers one claim per line: the proof and its attestation, the spec pin, the tree root, this file's leaf, the floor, the Base ceiling and the Ethereum settlement, each saying what it rests on. `verify()` in the same package checks a bare bitgraph/1 proof against bytes, and `verifyCarrier()` judges a BitGraphed file (carrier/2), the single-file form that carries its own proof inside it.
41
45
 
42
46
  See [bitgraph.ing/docs](https://bitgraph.ing/docs) for the full proof format, verification checklist, attestation handling, and self-host instructions.
43
47
 
@@ -45,13 +49,15 @@ See [bitgraph.ing/docs](https://bitgraph.ing/docs) for the full proof format, ve
45
49
 
46
50
  | Path | What it is |
47
51
  |---|---|
48
- | [`packages/verify`](packages/verify) | `@mikeargento/bitgraph-verify`, MIT. The canonical verifier: the `bitgraph/1` schema, canonical serialization, proof and chain hashes, and the fuse checks. Every other component checks proofs through this one. |
49
- | [`packages/audit`](packages/audit) | `@mikeargento/bitgraph-audit`, MIT. Offline audit of a whole bundle: ingest, tiered verification, causal reconstruction, anomaly codes, CLI. |
50
- | [`src`](src) | `@mikeargento/bitgraph`. The SDK that makes a BitGraph: placements, sets, and the builders that write a commitment into new bytes. |
51
- | [`packages/mcp`](packages/mcp) | `@mikeargento/bitgraph-mcp`. The MCP server an agent connects to. |
52
+ | [`spec/SPEC.md`](spec/SPEC.md) | The specification, version 1, frozen 2026-10-04. Its SHA-256 (`QazdIR0JYtHQwQuIISo7bvH1gxUvTS2cY+tW6BjUIRs=`, [`spec/FROZEN.json`](spec/FROZEN.json)) is signed into every tree/1 proof. It never changes; a later version is added beside it. |
53
+ | [`packages/verify`](packages/verify) | `@mikeargento/bitgraph-verify`, MIT. The canonical verifier: the `bitgraph/1` schema, canonical serialization, proof and chain hashes, tree/1, exports, BitGraphed files, ceilings and settlement. Every other component checks proofs through this one. |
54
+ | [`packages/audit`](packages/audit) | `@mikeargento/bitgraph-audit`, MIT. Offline audit of a whole bundle: ingest, tiered verification, exports, causal reconstruction, anomaly codes, CLI. |
55
+ | [`packages/sdk`](packages/sdk) | `@mikeargento/bitgraph-sdk`. How software makes a BitGraph: the `BitGraph` class, the `bitgraph` CLI, and `bitgraph serve` on 127.0.0.1. New integrations start here. |
56
+ | [`src`](src) | `@mikeargento/bitgraph`. The older package the SDK is built on: the tree/1 pipeline, the placements, export building and recovery writes. Still published. |
57
+ | [`packages/mcp`](packages/mcp) | `@mikeargento/bitgraph-mcp`. The MCP server an agent connects to; the same engine as the SDK. |
52
58
  | [`packages/player`](packages/player) | `@mikeargento/bitgraph-player`. Deterministic evaluation of causal rules over verified evidence. |
53
59
  | [`server/commit-service`](server/commit-service) | The enclave that allocates and commits, its parent host, and the reproducible build whose published measurement is in [`PINS.md`](server/commit-service/reproducible-build/PINS.md). |
54
- | [`website`](website) | [bitgraph.ing](https://bitgraph.ing), including the browser drop and the hosted MCP endpoint. |
60
+ | [`website`](website) | [bitgraph.ing](https://bitgraph.ing), including the drop box, the recovery service and the hosted MCP endpoint. |
55
61
 
56
62
  Trust assumptions, and what each one buys, are in [The trust model](#the-trust-model) below and at [bitgraph.ing/docs/trust-model](https://bitgraph.ing/docs/trust-model).
57
63
 
@@ -97,8 +103,8 @@ A BitGraph proof is a portable proof object, a JSON document, that travels with
97
103
  | Signature | Verifies the proof was issued by the enclave-controlled key |
98
104
  | TEE measurement | Shows what code and environment produced the proof |
99
105
  | Attestation | Shows the proof came from measured hardware |
100
- | Public anchor | Tethers BitGraph logical time to a public reference |
101
- | Fuse marker | Signed: the placement the commitment was written at, and the digest of the original |
106
+ | Public floor | A Base block bound in when the position opened: tethers BitGraph logical time to a public reference |
107
+ | Tree marker | Signed: the format (tree/1) and the SHA-256 of SPEC.md, the exact text the proof pins. The artifact hash is then the tree's 84-byte root document; each file's leaf and path live in the export |
102
108
 
103
109
  Taken together: this hash was committed into this reserved position, by this measured environment, at this point in logical order, under this signing identity.
104
110
 
@@ -110,23 +116,27 @@ BitGraph proves causal order. It does not assert a clock time.
110
116
 
111
117
  ## Establishing wall clock time
112
118
 
113
- BitGraph's internal ordering does not require Ethereum. The chain creates internal order through position allocation, consumption, counters, signatures, and chained proof history. What that order lacks, on its own, is a clock. The enclave keeps no trusted one; any clock reading inside a proof is advisory.
119
+ BitGraph's internal ordering does not require a blockchain. The chain creates internal order through position allocation, consumption, counters, signatures, and chained proof history. What that order lacks, on its own, is a public clock. The recorded time is the enclave platform's signed clock, the AWS Nitro attestation time; the public bounds come from outside.
120
+
121
+ Base (Coinbase's Ethereum layer-2, a block every 2 seconds) is where the order meets the public wall clock. When a position opens, the enclave binds the newest Base block into it: it hashes the block's header itself, checks that the block's time is Base mainnet's schedule for its number, that it is not stamped after the enclave's clock, and that floors never go backwards, and signs the block into the proof (`commit.slotFloor`). The record was made after that block. This is the floor in time, and it runs in one direction: no earlier than. That the block is Base's own is one lookup on Base, by its number, comparing the hash; Coinbase runs Base's sequencer. Nothing is written to a chain for the floor.
122
+
123
+ The other side is stated apart, never merged. The ceiling in time is the Base block carrying a Merkle root over the record's proof hash, written seconds after the commit: the record existed by that block. Settlement is Ethereum's record of that Base block through Base's output root (bitgraph-output-root/1), so the Base time rests on Ethereum too. Order after the record is the next BitGraph in the chain, which carries this proof's hash: a bound in the sequence, never a clock time.
114
124
 
115
- Ethereum is where the order meets the wall clock. An anchor is an ordinary proof on the same chain whose artifact is the hash of a recent Ethereum block. A block hash does not exist before its block is produced, so the anchor, and every proof chained after it, came after that block and its public date. Anchors recur throughout every epoch. This is the wall-clock statement every proof carries, and it runs in one direction: no earlier than. Nothing in the proof bounds the other side.
125
+ The ceilings also fix history backward, through content. Each proof's hash is chained into the next, so once a proof hash sits in a Base transaction, the history behind it is fixed: alter any earlier proof and the chain no longer reaches it. When the epoch ends, its signing key is destroyed, and the set closes.
116
126
 
117
- The anchors also fix history backward, through content. Each anchor is hash-linked to everything before it, so once an anchor exists, the history behind it is fixed: alter any earlier proof and the chain no longer reaches the anchor. When the epoch ends, its signing key is destroyed, and the set closes.
127
+ Base is not asked to be a good source of randomness, and it is not asked to establish the artifact's position. BitGraph establishes the position. The public blocks tie the positions to the public timeline, so anyone, years later, can check the order and the earliest date each position could have existed.
118
128
 
119
- Ethereum is not asked to be a good source of randomness, and it is not asked to establish the artifact's position. BitGraph establishes the position. Ethereum ties the positions to the public timeline, so anyone, years later, can check the order and the earliest date each position could have existed.
129
+ Proofs made before the switch to the Base floor stand on an Ethereum floor instead: an anchor, an ordinary proof on the same chain whose artifact was the hash of a recent Ethereum block, fixed when the position was allocated and signed in as `commit.slotAnchor`. They verify exactly as before.
120
130
 
121
131
  ## Compromise and containment
122
132
 
123
133
  BitGraph assumes the boundary can be compromised and bounds the damage instead of claiming it cannot happen.
124
134
 
125
- The signing key exists only in enclave memory. Every restart destroys it and begins a new epoch with a fresh key and a fresh counter. Proofs from prior epochs were signed by keys that no longer exist, so a compromise cannot reach backward.
135
+ The signing key exists only in enclave memory. Every restart destroys it and begins a new epoch with a fresh key and a fresh counter. Proofs from prior epochs were signed by keys that no longer exist, so a compromise that begins later cannot reach backward.
126
136
 
127
- Forgery requires more than key theft. Every proof carries a hardware attestation whose user_data must equal the hash of that exact proof body, and only the enclave's secure module can produce one. A useful breach must execute inside the running enclave, and it dies at the next restart.
137
+ Forgery requires more than key theft. Every proof carries a hardware attestation whose user_data must equal the hash of that exact proof body, and only the enclave's secure module can produce one. A useful breach must execute inside the running enclave. A restart ends that foothold but not the flaw that allowed it: the same flaw could be used again in a later epoch, and proofs already forged stay valid.
128
138
 
129
- Damage control is precise. Every proof names its epoch permanently, so a suspect window is identified exactly: rotate the epoch, publish the affected epochId as quarantined, and every other epoch is untouched. Verifiers that pin measurements and track epochs account for the gap.
139
+ Damage control is precise. Every proof names its epoch permanently, so a suspect window is identified exactly: rotate the epoch, publish the affected epochId as quarantined; epochs that were not themselves compromised are unaffected. Verifiers that pin measurements and track epochs account for the gap.
130
140
 
131
141
  The production deployment makes rotation routine rather than exceptional: the boundary restarts every day at 23:59 UTC, destroying the epoch key and starting a fresh one, so a normally operating epoch runs about a day. An unexpected restart ends one early and a failed rotation extends one; either way the boundary is recorded in the proofs themselves. A breach that depends on staying resident inside the enclave cannot outlive its epoch without freshly re-compromising a new one. The schedule is deliberately public: rotation times are visible in BitGraph's public copy regardless, and the protection comes from the key dying, not from anyone guessing when.
132
142
 
@@ -141,7 +151,7 @@ BitGraph does not ask for blind trust in any single component. It has real depen
141
151
  | Atomic binding | Prevents post-hoc attachment |
142
152
  | Counters | Internal logical order |
143
153
  | Proof chain | Historical continuity |
144
- | Ethereum anchor | Public wall-clock bound |
154
+ | Base floor and ceiling | Public wall-clock bounds |
145
155
  | Epoch rotation | Damage containment |
146
156
  | Portable verification | Independence from the original server |
147
157
 
@@ -168,7 +178,7 @@ BitGraph is often confused with adjacent systems. The differences are structural
168
178
  | Signatures | This key signed this data | This key was controlled by a measured environment that consumed an unused position |
169
179
  | Timestamps | This hash existed by time T | This hash consumed a pre-existing position in causal order |
170
180
  | C2PA | Here are signed claims about this content | This exact digital state occupied this pre-existing position |
171
- | Blockchains | Public ordering of shared transactions | Ordering established inside a measured enclave, then anchored publicly |
181
+ | Blockchains | Public ordering of shared transactions | Ordering established inside a measured enclave, then bracketed by public blocks |
172
182
 
173
183
  Signatures, timestamps, content credentials, and blockchains all answer "who claimed what, when?" BitGraph answers "what position does this exact digital state occupy?" They are complementary, not competing. A signature can be inside a BitGraph proof. A timestamp can decorate one. Content credentials can ride alongside one. None of them, alone, do what BitGraph does.
174
184
 
@@ -180,7 +190,7 @@ BitGraph does not restore originality. It makes it unnecessary. The artifact's h
180
190
 
181
191
  ## The simplest version
182
192
 
183
- A measured TEE reserves a random unused position. The producer writes the position's commitment into the bytes, whether that is a new file around an original or a record with a field of its own, and hashes the finished bytes. That hash arrives. The TEE binds it to the position, consumes the position, signs the result, and links it into an ordered chain. Every restart begins a new epoch with a new key, so a compromised boundary is bounded, never retroactive. The same mechanism periodically commits an Ethereum block hash, fixing the history behind it and giving everything after it a public date it provably followed.
193
+ A measured TEE reserves a random unused position. The producer writes the position's commitment into the bytes, whether that is a new file around an original or a record with a field of its own, and hashes the finished bytes. That hash arrives. The TEE binds it to the position, consumes the position, signs the result, and links it into an ordered chain. Every restart begins a new epoch with a new key, so a compromised boundary is bounded, never retroactive. Each position opens on the newest Base block, a public date the record provably followed, and seconds after the commit the proof's hash is written to Base, fixing the history behind it.
184
194
 
185
195
  The result is a protocol that does not say "someone signed this."
186
196
 
@@ -192,9 +202,9 @@ The result is a protocol that does not say "someone signed this."
192
202
 
193
203
  Two MIT-licensed packages in this repository make BitGraph evidence checkable without permission:
194
204
 
195
- **[`@mikeargento/bitgraph-verify`](https://www.npmjs.com/package/@mikeargento/bitgraph-verify)** verifies one proof. `verify()` checks a proof against the original artifact bytes: structure, canonical Ed25519 signature, position binding, epoch link, and the digest match. `verifyProofIntegrity()` runs every check except the artifact binding for cases where the bytes are not available, and its result states explicitly that the binding was not checked.
205
+ **[`@mikeargento/bitgraph-verify`](https://www.npmjs.com/package/@mikeargento/bitgraph-verify)** (1.16.0) verifies one record. `verifyExport()` checks a tree/1 export with the file it is about, one claim per line, the three time claims kept apart. `verifyCarrier()` judges a BitGraphed file. `verify()` checks a bare proof against the artifact bytes: structure, canonical Ed25519 signature, position binding, epoch link, and the digest match. `verifyProofIntegrity()` runs every check except the artifact binding for cases where the bytes are not available, and its result states explicitly that the binding was not checked.
196
206
 
197
- **`@mikeargento/bitgraph-audit`** audits a whole bundle of proofs, fully offline. It ingests a directory, `.tar`, or `.tar.gz`, verifies every proof through the canonical verifier, reconstructs causal order from the hash links and counters, classifies anomalies with stable machine-readable codes, and preserves divergence between valid proofs for the reader to adjudicate instead of choosing a winner. It ships a CLI (`bitgraph-audit <bundle>`) that writes machine-readable and human-readable reports. The bundle format is specified in [docs/BUNDLE-FORMAT.md](docs/BUNDLE-FORMAT.md); the recipient walkthrough is [docs/HOW-TO-AUDIT.md](docs/HOW-TO-AUDIT.md).
207
+ **`@mikeargento/bitgraph-audit`** (0.9.0) audits a whole bundle of proofs, fully offline. It ingests a directory, `.tar`, or `.tar.gz`, or a single BitGraphed file; finds every export by its `format` field and checks it against each file it covers; verifies every proof through the canonical verifier, reconstructs causal order from the hash links and counters, classifies anomalies with stable machine-readable codes, and preserves divergence between valid proofs for the reader to adjudicate instead of choosing a winner. It ships a CLI (`bitgraph-audit <bundle>`) that writes machine-readable and human-readable reports. The bundle format is specified in [docs/BUNDLE-FORMAT.md](docs/BUNDLE-FORMAT.md); the recipient walkthrough is [docs/HOW-TO-AUDIT.md](docs/HOW-TO-AUDIT.md).
198
208
 
199
209
  ## License
200
210
 
package/dist/export.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { MerkleTree } from "@mikeargento/bitgraph-verify";
2
2
  import type { BitGraphExport, BitGraphProof, TreeLeaf } from "@mikeargento/bitgraph-verify";
3
3
  import type { FuseTreeResult } from "./fuse.js";
4
- /** An export's floor: the Ethereum block the proof signs as commit.slotAnchor, with its RLP header (0x hex). */
4
+ /** An export's floor: the block the proof signs (commit.slotAnchor on Ethereum, or commit.slotFloor on Base, with chain "base"), with its RLP header (0x hex). */
5
5
  export type ExportFloor = NonNullable<BitGraphExport["floor"]>;
6
6
  /** What an export is built from. A FuseTreeResult is one; so is the same data read back from an owner's export. */
7
7
  export interface TreeExportSource {
@@ -38,7 +38,8 @@ export declare function namesByLeaf(result: Pick<FuseTreeResult, "members" | "co
38
38
  /**
39
39
  * The floor for an export from a block header, or null unless the header
40
40
  * decodes and hashes to the block the proof signs as its floor, at that
41
- * height. The header is never trusted for anything it does not hash to.
41
+ * height (for a Base floor, also at the signed time, on Base mainnet's
42
+ * schedule). The header is never trusted for anything it does not hash to.
42
43
  */
43
44
  export declare function floorFromHeader(proof: BitGraphProof, headerHex: string): ExportFloor | null;
44
45
  export interface ExportFetchOptions {
@@ -46,13 +47,20 @@ export interface ExportFetchOptions {
46
47
  baseUrl?: string;
47
48
  /** Per request. Default 20 s. */
48
49
  timeoutMs?: number;
50
+ /** The Base node asked for a Base floor's header (enclave v10 floors), by height. Default https://mainnet.base.org. */
51
+ baseRpcUrl?: string;
49
52
  }
50
53
  type Fetcher = (input: string, init?: RequestInit) => Promise<Response>;
51
54
  /**
52
- * The floor header for a proof, from the site's witness route
53
- * (GET /api/proofs/witness?block=N&hash=0x...), checked against the floor
54
- * the proof signs. Null when the proof signs no floor, the route has no
55
- * header, or the header is not that block's.
55
+ * The floor header for a proof, checked against the floor the proof signs:
56
+ * for an Ethereum floor, from the site's witness route
57
+ * (GET /api/proofs/witness?block=N&hash=0x...); for a Base floor, the site's
58
+ * saved copy (GET /api/proofs/floor-header?chain=base&block=N&hash=0x...)
59
+ * when opts.baseUrl names the site, else the Base node's block at the signed
60
+ * height (eth_getBlockByNumber), its header rebuilt from the node's JSON;
61
+ * either kept only when it hashes to the signed block hash.
62
+ * Null when the proof signs no floor, nothing answered with a header, or the
63
+ * header is not that block's.
56
64
  */
57
65
  export declare function fetchFloorHeader(proof: BitGraphProof, fetcher?: Fetcher, opts?: ExportFetchOptions): Promise<ExportFloor | null>;
58
66
  export interface CompleteExportOptions extends ExportFetchOptions {
@@ -77,7 +85,9 @@ export interface CompletedExport {
77
85
  }
78
86
  /**
79
87
  * Fill what an export is waiting for, from read-only GETs on the site:
80
- * floor GET /api/proofs/witness?block=N&hash=0x... (or the ceiling sidecar's own floor header)
88
+ * floor GET /api/proofs/witness?block=N&hash=0x... for an Ethereum floor; a Base floor is
89
+ * GET /api/proofs/floor-header?chain=base&block=N&hash=0x..., else the Base node's
90
+ * block N (opts.baseRpcUrl); or the ceiling sidecar's own floor header
81
91
  * ceiling GET /api/ceilings/<proofHash, URL-safe> 404: still pending
82
92
  * settlement GET /api/ceilings/settlement/<Base block> 404: still pending
83
93
  * Each is verified here before it is embed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CAAC,CAkGhJ"}
package/dist/export.js CHANGED
@@ -14,7 +14,9 @@
14
14
  * rebuilt from it, and it lists every file, so it is
15
15
  * the owner's to keep.
16
16
  *
17
- * At make time the floor header can be in hand (the site's witness route);
17
+ * At make time the floor header can be in hand (the site's witness route for
18
+ * an Ethereum floor; for a Base floor, enclave v10, a Base node's block at the
19
+ * signed height);
18
20
  * the ceiling (a Base block, seconds after the commit) and the settlement
19
21
  * (Base's output root on Ethereum, much later) cannot, so they start as
20
22
  * { status: "pending" }. completeExport fetches all three. Nothing fetched is
@@ -24,7 +26,7 @@
24
26
  * own Base block. Nothing already in an export is ever overwritten.
25
27
  */
26
28
  import { sha256 } from "@noble/hashes/sha256";
27
- import { base64ToBytes, BASE_MAINNET_CHAIN_ID, BITGRAPH_CEILING_WRITER, buildExport, buildTreeMemberEvidence, bytesEqual, bytesToBase64, bytesToHex, computeProofHash, decodeHeader, encodeTreeLeaves, evmHexToBytes, MerkleTree, OUTPUT_ROOT_VERSION, parseExport, parseTreeRootDocument, treeLeafHash, treeRootFromMember, verifyCeiling, verifyOutputRootSettlement, verifyTreeLeaves, CEILING_VERSION, } from "@mikeargento/bitgraph-verify";
29
+ import { base64ToBytes, BASE_MAINNET_CHAIN_ID, BITGRAPH_CEILING_WRITER, buildExport, buildTreeMemberEvidence, bytesEqual, bytesToBase64, bytesToHex, checkFloorHeader, computeProofHash, encodeTreeLeaves, evmHexToBytes, MerkleTree, OUTPUT_ROOT_VERSION, parseExport, parseTreeRootDocument, treeLeafHash, treeRootFromMember, verifyCeiling, verifyOutputRootSettlement, verifyTreeLeaves, CEILING_VERSION, headerRlpFromRpc, signedFloorOf, evmBytesToHex, } from "@mikeargento/bitgraph-verify";
28
30
  /** Throws unless the root document is the one the proof signs and states this many leaves; returns its parse. */
29
31
  function boundDocument(source) {
30
32
  const doc = parseTreeRootDocument(source.rootDocument);
@@ -93,27 +95,41 @@ export function namesByLeaf(result) {
93
95
  names[m.leafIndex] = m.name ?? "";
94
96
  return names;
95
97
  }
98
+ /** The floor a proof signs, or null when it signs none or is ambiguous (two floors). */
99
+ function signedFloor(proof) {
100
+ try {
101
+ return signedFloorOf(proof);
102
+ }
103
+ catch {
104
+ return null;
105
+ }
106
+ }
96
107
  /**
97
108
  * The floor for an export from a block header, or null unless the header
98
109
  * decodes and hashes to the block the proof signs as its floor, at that
99
- * height. The header is never trusted for anything it does not hash to.
110
+ * height (for a Base floor, also at the signed time, on Base mainnet's
111
+ * schedule). The header is never trusted for anything it does not hash to.
100
112
  */
101
113
  export function floorFromHeader(proof, headerHex) {
102
- const signed = proof.commit?.slotAnchor;
114
+ const signed = signedFloor(proof);
103
115
  if (!signed || typeof headerHex !== "string")
104
116
  return null;
105
117
  try {
106
- const h = decodeHeader(evmHexToBytes(headerHex));
107
- if (h.hash !== signed.blockHash.toLowerCase() || h.number !== signed.blockNumber)
118
+ const r = checkFloorHeader(signed, evmHexToBytes(headerHex), signed.chain);
119
+ if (!r.ok)
108
120
  return null;
109
121
  const hex = headerHex.toLowerCase();
110
- return { blockNumber: h.number, blockHash: h.hash, header: hex.startsWith("0x") ? hex : `0x${hex}` };
122
+ const header = hex.startsWith("0x") ? hex : `0x${hex}`;
123
+ return signed.chain === "base"
124
+ ? { chain: "base", blockNumber: r.header.number, blockHash: r.header.hash, header }
125
+ : { blockNumber: r.header.number, blockHash: r.header.hash, header };
111
126
  }
112
127
  catch {
113
128
  return null;
114
129
  }
115
130
  }
116
131
  const DEFAULT_SITE = "https://bitgraph.ing";
132
+ const DEFAULT_BASE_RPC = "https://mainnet.base.org";
117
133
  function siteOf(opts) {
118
134
  return (opts.baseUrl ?? DEFAULT_SITE).replace(/\/+$/, "");
119
135
  }
@@ -135,19 +151,77 @@ async function getJson(fetcher, url, timeoutMs) {
135
151
  }
136
152
  }
137
153
  /**
138
- * The floor header for a proof, from the site's witness route
139
- * (GET /api/proofs/witness?block=N&hash=0x...), checked against the floor
140
- * the proof signs. Null when the proof signs no floor, the route has no
141
- * header, or the header is not that block's.
154
+ * The floor header for a proof, checked against the floor the proof signs:
155
+ * for an Ethereum floor, from the site's witness route
156
+ * (GET /api/proofs/witness?block=N&hash=0x...); for a Base floor, the site's
157
+ * saved copy (GET /api/proofs/floor-header?chain=base&block=N&hash=0x...)
158
+ * when opts.baseUrl names the site, else the Base node's block at the signed
159
+ * height (eth_getBlockByNumber), its header rebuilt from the node's JSON;
160
+ * either kept only when it hashes to the signed block hash.
161
+ * Null when the proof signs no floor, nothing answered with a header, or the
162
+ * header is not that block's.
142
163
  */
143
164
  export async function fetchFloorHeader(proof, fetcher = fetch, opts = {}) {
144
- const signed = proof.commit?.slotAnchor;
165
+ const r = await floorHeaderLookup(proof, fetcher, opts);
166
+ return "floor" in r ? r.floor : null;
167
+ }
168
+ /** One floor-header lookup on the floor's own chain: the floor, or why there is none. Never throws. */
169
+ async function floorHeaderLookup(proof, fetcher, opts) {
170
+ const signed = signedFloor(proof);
145
171
  if (!signed)
146
- return null;
147
- const r = await getJson(fetcher, `${siteOf(opts)}/api/proofs/witness?block=${signed.blockNumber}&hash=${encodeURIComponent(signed.blockHash)}`, opts.timeoutMs ?? 20_000);
148
- if ("error" in r || r.status !== 200)
149
- return null;
150
- return floorFromHeader(proof, witnessHeader(r.json) ?? "");
172
+ return { none: true };
173
+ const timeoutMs = opts.timeoutMs ?? 20_000;
174
+ if (signed.chain === "base") {
175
+ // The site's saved copy first, when the caller names its site (the parent
176
+ // saves each floor header before a proof stands on it), then a Base node
177
+ // by height. Either is kept only when it hashes to the signed block; a
178
+ // site that has no copy, or answers anything else, falls through.
179
+ if (opts.baseUrl !== undefined) {
180
+ const saved = await getJson(fetcher, `${siteOf(opts)}/api/proofs/floor-header?chain=base&block=${signed.blockNumber}&hash=${encodeURIComponent(signed.blockHash)}`, timeoutMs);
181
+ if (!("error" in saved) && saved.status === 200) {
182
+ const header = saved.json?.header;
183
+ const f = typeof header === "string" ? floorFromHeader(proof, header) : null;
184
+ if (f !== null)
185
+ return { floor: f };
186
+ }
187
+ }
188
+ const url = opts.baseRpcUrl ?? DEFAULT_BASE_RPC;
189
+ const r = await postJson(fetcher, url, { jsonrpc: "2.0", id: 1, method: "eth_getBlockByNumber", params: [`0x${signed.blockNumber.toString(16)}`, false] }, timeoutMs);
190
+ if ("error" in r)
191
+ return { note: `floor header: ${r.error}` };
192
+ if (r.status !== 200)
193
+ return { note: `floor header: the Base node answered ${r.status}` };
194
+ const block = r.json?.result ?? null;
195
+ if (block === null)
196
+ return { note: `floor header: the Base node has no block ${signed.blockNumber}` };
197
+ const rlp = headerRlpFromRpc(block, signed.blockHash);
198
+ const f = rlp === null ? null : floorFromHeader(proof, evmBytesToHex(rlp));
199
+ return f !== null ? { floor: f } : { note: `floor header: the Base node's block ${signed.blockNumber} is not the floor block the proof signs; not embedded` };
200
+ }
201
+ const r = await getJson(fetcher, `${siteOf(opts)}/api/proofs/witness?block=${signed.blockNumber}&hash=${encodeURIComponent(signed.blockHash)}`, timeoutMs);
202
+ if ("error" in r)
203
+ return { note: `floor header: ${r.error}` };
204
+ if (r.status !== 200)
205
+ return { note: `floor header: the witness route answered ${r.status}` };
206
+ const f = floorFromHeader(proof, witnessHeader(r.json) ?? "");
207
+ return f !== null ? { floor: f } : { note: "floor header: the witness route answered a header that is not the floor block the proof signs; not embedded" };
208
+ }
209
+ /** One JSON-RPC POST: status and parsed JSON, or the reason it failed. Never throws. */
210
+ async function postJson(fetcher, url, body, timeoutMs) {
211
+ try {
212
+ const res = await fetcher(url, { method: "POST", headers: { "content-type": "application/json", accept: "application/json" }, body: JSON.stringify(body), redirect: "error", signal: AbortSignal.timeout(timeoutMs) });
213
+ let json = null;
214
+ try {
215
+ json = await res.json();
216
+ }
217
+ catch {
218
+ json = null;
219
+ }
220
+ return { status: res.status, json };
221
+ }
222
+ catch (err) {
223
+ return { error: err instanceof Error ? err.message : String(err) };
224
+ }
151
225
  }
152
226
  /** The header in a witness answer: the bitgraph-anchor-witness/1 object, or the same inside a { witness } envelope. */
153
227
  function witnessHeader(json) {
@@ -164,7 +238,9 @@ function isSettlement(s) {
164
238
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
165
239
  /**
166
240
  * Fill what an export is waiting for, from read-only GETs on the site:
167
- * floor GET /api/proofs/witness?block=N&hash=0x... (or the ceiling sidecar's own floor header)
241
+ * floor GET /api/proofs/witness?block=N&hash=0x... for an Ethereum floor; a Base floor is
242
+ * GET /api/proofs/floor-header?chain=base&block=N&hash=0x..., else the Base node's
243
+ * block N (opts.baseRpcUrl); or the ceiling sidecar's own floor header
168
244
  * ceiling GET /api/ceilings/<proofHash, URL-safe> 404: still pending
169
245
  * settlement GET /api/ceilings/settlement/<Base block> 404: still pending
170
246
  * Each is verified here before it is embedded, and nothing already present is
@@ -179,7 +255,6 @@ export async function completeExport(input, fetcher = fetch, opts = {}) {
179
255
  const writerAddress = opts.writerAddress ?? BITGRAPH_CEILING_WRITER;
180
256
  const chainId = opts.baseChainId ?? BASE_MAINNET_CHAIN_ID;
181
257
  const proof = exp.proof;
182
- const signedFloor = proof.commit?.slotAnchor;
183
258
  const notes = new Set();
184
259
  let floor = exp.floor ?? null;
185
260
  let ceiling = exp.ceiling ?? null;
@@ -187,22 +262,15 @@ export async function completeExport(input, fetcher = fetch, opts = {}) {
187
262
  let changed = false;
188
263
  const deadline = Date.now() + (opts.waitMs ?? 0);
189
264
  for (;;) {
190
- // 1. The floor header: the witness route, checked against the signed floor.
191
- if (floor === null && signedFloor) {
192
- const r = await getJson(fetcher, `${site}/api/proofs/witness?block=${signedFloor.blockNumber}&hash=${encodeURIComponent(signedFloor.blockHash)}`, timeoutMs);
193
- if ("error" in r)
194
- notes.add(`floor header: ${r.error}`);
195
- else if (r.status !== 200)
196
- notes.add(`floor header: the witness route answered ${r.status}`);
197
- else {
198
- const f = floorFromHeader(proof, witnessHeader(r.json) ?? "");
199
- if (f !== null) {
200
- floor = f;
201
- changed = true;
202
- }
203
- else
204
- notes.add("floor header: the witness route answered a header that is not the floor block the proof signs; not embedded");
265
+ // 1. The floor header, on the floor's own chain, checked against the signed floor.
266
+ if (floor === null) {
267
+ const r = await floorHeaderLookup(proof, fetcher, opts);
268
+ if ("floor" in r) {
269
+ floor = r.floor;
270
+ changed = true;
205
271
  }
272
+ else if ("note" in r)
273
+ notes.add(r.note);
206
274
  }
207
275
  // 2. The ceiling on Base: the sidecar, verified for this proof and writer.
208
276
  if (!isCeiling(ceiling)) {
@@ -1 +1 @@
1
- {"version":3,"file":"export.js","sourceRoot":"","sources":["../src/export.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,uBAAuB,EACvB,UAAU,EACV,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,GAChB,MAAM,8BAA8B,CAAC;AAyBtC,iHAAiH;AACjH,SAAS,aAAa,CAAC,MAAwB;IAC7C,MAAM,GAAG,GAAG,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACvD,IAAI,GAAG,KAAK,IAAI;QAAE,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAC;IACrF,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;IACrE,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,uEAAuE,CAAC,CAAC;IACtK,IAAI,GAAG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AAS;QACnD,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC5D,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC;KAClB,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,CAA+B,EAAE,CAA2C;IAC/F,OAAO,CAAC,KAAK,IAAI,IAAK,CAA0B,CAAC,MAAM,KAAK,SAAS,IAAK,CAA6B,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,CAAC;AACpI,CAAC;AAED,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACxE,CAAC"}
package/dist/fuse.d.ts CHANGED
@@ -14,15 +14,26 @@ export interface AnchorMark {
14
14
  blockNumber: number;
15
15
  blockHash: string;
16
16
  }
17
+ /** The Base floor an enclave v10 allocation hands back: the one it signs at commit as commit.slotFloor. */
18
+ export interface BaseFloorMark {
19
+ chain: "base";
20
+ evmChainId: 8453;
21
+ blockNumber: number;
22
+ blockHash: string;
23
+ blockTimestamp: number;
24
+ }
25
+ /** Either floor an allocation can return. A Base floor makes a fuse/3 commitment, an Ethereum anchor a fuse/2 one. */
26
+ export type FloorMark = AnchorMark | BaseFloorMark;
27
+ export declare function isBaseFloorMark(x: unknown): x is BaseFloorMark;
17
28
  /** What the builder receives. The raw nonce is deliberately absent. */
18
29
  export interface BuilderInput {
19
- /** 32-byte commitment to the signed slot record (bitgraph-fuse/2 also binds the floor block). Write this into the artifact. */
30
+ /** 32-byte commitment to the signed slot record (fuse/2 and fuse/3 also bind the floor block). Write this into the artifact. */
20
31
  commitment: Uint8Array;
21
32
  commitmentHex: string;
22
- /** Which commitment this is: 2 when the boundary returned its floor anchor (enclave v9 and later), else 1. */
23
- fuseVersion: 1 | 2;
24
- /** The floor bound into a fuse/2 commitment, when there is one. */
25
- floor?: AnchorMark;
33
+ /** Which commitment this is: 3 for a Base floor (enclave v10), 2 for an Ethereum floor anchor (v9), else 1. */
34
+ fuseVersion: 1 | 2 | 3;
35
+ /** The floor bound into the commitment, when there is one. */
36
+ floor?: FloorMark;
26
37
  /** The origin digest, when the fused artifact names a source. */
27
38
  originDigest?: Uint8Array;
28
39
  /** The signed slot record, for producers that want to embed its fields. Contains the nonce: do not copy it into the artifact. */
@@ -128,10 +139,10 @@ export declare const MAX_SET_MEMBERS = 2000;
128
139
  export type SetMemberPlacement = "trailer/1" | "container/1" | "container/2";
129
140
  /** What a hashed member's fused digest is computed for: the held slot and its commitment. */
130
141
  export interface FusedDigestInput {
131
- /** Which commitment this is: 2 when the boundary returned its floor anchor, else 1. */
132
- fuseVersion: 1 | 2;
133
- /** The floor bound into a fuse/2 commitment, when there is one. */
134
- floor?: AnchorMark;
142
+ /** Which commitment this is: 3 for a Base floor, 2 for an Ethereum floor anchor, else 1. */
143
+ fuseVersion: 1 | 2 | 3;
144
+ /** The floor bound into the commitment, when there is one. */
145
+ floor?: FloorMark;
135
146
  commitment: Uint8Array;
136
147
  commitmentHex: string;
137
148
  slot: SlotAllocation;
@@ -381,10 +392,10 @@ export interface FuseTreeResult {
381
392
  count: number;
382
393
  /** The tree's root, lowercase hex. */
383
394
  rootHex: string;
384
- /** commitment/2, which every placed member's committed bytes carry. committedBytesFor(member.code, original, commitment) rebuilds them. */
395
+ /** commitment/2 or /3, which every placed member's committed bytes carry. committedBytesFor(member.code, original, commitment) rebuilds them. */
385
396
  commitment: Uint8Array;
386
- /** The floor block the commitment binds, as the proof signs it (commit.slotAnchor). */
387
- floor: AnchorMark;
397
+ /** The floor block the commitment binds, as the proof signs it (commit.slotAnchor or commit.slotFloor). */
398
+ floor: FloorMark;
388
399
  /** The spec hash the signed attribution pins, standard base64. */
389
400
  specHashB64: string;
390
401
  /** Every leaf, in tree order (strictly ascending artifact digest). */