@mikeargento/bitgraph-audit 0.11.1 → 0.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.
Files changed (35) hide show
  1. package/dist/audit.d.ts +1 -1
  2. package/dist/audit.js +1 -1
  3. package/dist/genesis.d.ts +141 -0
  4. package/dist/genesis.d.ts.map +1 -0
  5. package/dist/genesis.js +359 -0
  6. package/dist/genesis.js.map +1 -0
  7. package/dist/index.d.ts +6 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +5 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/publication.d.ts +148 -0
  12. package/dist/publication.d.ts.map +1 -0
  13. package/dist/publication.js +392 -0
  14. package/dist/publication.js.map +1 -0
  15. package/dist/tot.d.ts +99 -0
  16. package/dist/tot.d.ts.map +1 -0
  17. package/dist/tot.js +242 -0
  18. package/dist/tot.js.map +1 -0
  19. package/package.json +4 -3
  20. package/src/__tests__/{anchors.test.ts → archive/anchors.test.ts} +2 -2
  21. package/src/__tests__/{base-floor.test.ts → archive/base-floor.test.ts} +2 -2
  22. package/src/__tests__/{carrier-tree.test.ts → archive/carrier-tree.test.ts} +2 -2
  23. package/src/__tests__/archive/genesis.test.ts +256 -0
  24. package/src/__tests__/archive/publication.test.ts +210 -0
  25. package/src/__tests__/tot-v2-vectors.test.ts +87 -0
  26. package/src/__tests__/tot-vectors.test.ts +120 -0
  27. package/src/audit.ts +1 -1
  28. package/src/genesis.ts +382 -0
  29. package/src/index.ts +26 -0
  30. package/src/publication.ts +461 -0
  31. package/src/tot.ts +253 -0
  32. /package/src/__tests__/{fixtures → archive/fixtures}/settlement/0x018efc046e94610e2530344caf1574e507a3182e1a975fb25b032ec1434a3f5c.bin +0 -0
  33. /package/src/__tests__/{fixtures → archive/fixtures}/settlement/ceiling-51979918.json +0 -0
  34. /package/src/__tests__/{fixtures → archive/fixtures}/settlement/pointer-51979918.json +0 -0
  35. /package/src/__tests__/{settlement.test.ts → archive/settlement.test.ts} +0 -0
package/dist/audit.d.ts CHANGED
@@ -8,7 +8,7 @@ import type { AuditOptions, AuditResult, ExitFlags, IngestResult } from "./types
8
8
  * this equals package.json's version, so the constant cannot drift silently
9
9
  * across releases.
10
10
  */
11
- export declare const AUDIT_VERSION = "0.11.1";
11
+ export declare const AUDIT_VERSION = "0.12.0";
12
12
  /** The audit package's own version. */
13
13
  export declare function auditToolVersion(): string;
14
14
  /** Options for auditIngest(): the audit options plus the run stamp. */
package/dist/audit.js CHANGED
@@ -36,7 +36,7 @@ import { validateAttestations } from "./attestation.js";
36
36
  * this equals package.json's version, so the constant cannot drift silently
37
37
  * across releases.
38
38
  */
39
- export const AUDIT_VERSION = "0.11.1";
39
+ export const AUDIT_VERSION = "0.12.0";
40
40
  /** The audit package's own version. */
41
41
  export function auditToolVersion() {
42
42
  return AUDIT_VERSION;
@@ -0,0 +1,141 @@
1
+ import { verifyProofIntegrity } from "@mikeargento/bitgraph-verify";
2
+ import { type WriteEvidence } from "./publication.js";
3
+ export declare const GENESIS_FORMAT: "bitgraph-genesis/1";
4
+ export declare const EPOCH_PUBLICATION_KEY: "bitgraph-publication/2";
5
+ export interface GenesisNote {
6
+ chainId: number;
7
+ /** The link of the write before this one, 64 hex; zeros for the first ever. */
8
+ prevLinkHex: string;
9
+ /** The epoch this genesis closes; null when there is none before it. */
10
+ closes: {
11
+ epochId: string;
12
+ first: number;
13
+ last: number;
14
+ leaves: number;
15
+ rootHex: string;
16
+ } | null;
17
+ /** A Base block that existed before the genesis BitGraph was made. */
18
+ after: {
19
+ blockNumber: number;
20
+ blockHash: string;
21
+ blockTimestamp: number;
22
+ };
23
+ }
24
+ export declare function genesisNoteText(n: GenesisNote): string;
25
+ export declare function parseGenesisNote(text: string): GenesisNote | null;
26
+ /** The digest the genesis BitGraph binds: SHA-256 of the note's UTF-8 bytes, standard base64. */
27
+ export declare const genesisNoteDigestB64: (text: string) => string;
28
+ /** The transaction's data: the receipt as JSON text, with the note it binds in its unsigned metadata. */
29
+ export declare function encodeGenesisCalldata(receipt: Record<string, unknown>, note: string): Uint8Array;
30
+ export interface GenesisWrite {
31
+ /** The genesis BitGraph's receipt, as written (its metadata holds the note). */
32
+ receipt: Record<string, unknown>;
33
+ note: string;
34
+ }
35
+ export declare function decodeGenesisCalldata(b: Uint8Array): GenesisWrite | null;
36
+ /** The link the next write names: SHA-256 of this write's calldata, hex (the same rule as an hourly write's). */
37
+ export declare const genesisLink: (calldata: Uint8Array) => string;
38
+ export interface GenesisCheck {
39
+ ok: boolean;
40
+ problems: string[];
41
+ note: GenesisNote | null;
42
+ /** The epoch the genesis BitGraph is in: the epoch this write opens. */
43
+ epochId: string | null;
44
+ counter: string | null;
45
+ publicKeyB64: string | null;
46
+ link: string | null;
47
+ }
48
+ /** A genesis write's own consistency: it decodes, its receipt binds its note, and the note closes some other epoch. */
49
+ export declare function checkGenesis(calldata: Uint8Array, opts?: {
50
+ chainId?: number;
51
+ }): GenesisCheck;
52
+ /** A write's evidence; `rawTx` may be left out, since the transaction is also the leaf of the inclusion proof. */
53
+ export type GenesisEvidence = Omit<WriteEvidence, "rawTx"> & {
54
+ rawTx?: string;
55
+ };
56
+ export interface EpochPublicationBlock {
57
+ format: typeof EPOCH_PUBLICATION_KEY;
58
+ epochId: string;
59
+ counter: string;
60
+ chainHashB64: string;
61
+ leafIndex: number;
62
+ path: string;
63
+ /** The genesis write that closed this BitGraph's epoch: its block evidence. The calldata is the transaction's data. */
64
+ closedBy: GenesisEvidence;
65
+ /** The genesis write that opened this BitGraph's epoch, when there is one and its BitGraph comes first: its calldata, 0x hex. */
66
+ openedBy: {
67
+ calldata: string;
68
+ } | null;
69
+ }
70
+ export declare function epochPublicationOf(proof: unknown): EpochPublicationBlock | null;
71
+ export interface EpochPublicationCheck {
72
+ ok: boolean;
73
+ problems: string[];
74
+ /** The block of the genesis write that closed the epoch: the BitGraph existed by it. Confirm the hash is on Base. */
75
+ ceiling: {
76
+ chainId: number;
77
+ blockNumber: number;
78
+ blockHash: string;
79
+ blockTimestamp: number;
80
+ txHash: string;
81
+ } | null;
82
+ /** The block the BitGraph is after, when its epoch opened with a genesis before it. Confirm the hash is on Base. */
83
+ floor: {
84
+ chainId: number;
85
+ blockNumber: number;
86
+ blockHash: string;
87
+ blockTimestamp: number;
88
+ genesisCounter: string;
89
+ } | null;
90
+ /** The epoch that followed this one, named by the genesis that closed it. */
91
+ nextEpochId: string | null;
92
+ }
93
+ export interface EpochPublicationOptions {
94
+ /** The writer address to accept (lowercase 0x). When given, the transaction must be signed by it and sent to itself. */
95
+ writer?: string;
96
+ /** The chain id to accept; default 8453 (Base mainnet). */
97
+ chainId?: number;
98
+ }
99
+ export declare function checkEpochPublication(proofIn: unknown, opts?: EpochPublicationOptions): EpochPublicationCheck;
100
+ export interface EpochPublicationVerifyOptions extends EpochPublicationOptions {
101
+ /** Passed to the verifier for every receipt: the accepted measurements, as for any proof. */
102
+ trustAnchors?: Parameters<typeof verifyProofIntegrity>[0]["trustAnchors"];
103
+ }
104
+ /** checkGenesis(), plus the receipt's own signatures and attestation through the verifier's integrity check. */
105
+ export declare function verifyGenesis(calldata: Uint8Array, opts?: EpochPublicationVerifyOptions): Promise<GenesisCheck>;
106
+ /**
107
+ * checkEpochPublication(), plus the signatures and attestations of the proof and of both genesis BitGraphs. A block
108
+ * says nothing unless those are sound, so this is the check to use.
109
+ */
110
+ export declare function verifyEpochPublication(proofIn: unknown, opts?: EpochPublicationVerifyOptions): Promise<EpochPublicationCheck>;
111
+ /** One genesis write as the operator stores it (publication/genesis/... in the ledger). */
112
+ export interface GenesisRecord {
113
+ format: typeof GENESIS_FORMAT;
114
+ /** The epoch this genesis opens, and its BitGraph's count there. */
115
+ epochId: string;
116
+ counter: string;
117
+ calldata: string;
118
+ link: string;
119
+ note: string;
120
+ write: WriteEvidence;
121
+ /** The BitGraphs of the epoch it closes that its tree holds, in count order. */
122
+ members: Array<{
123
+ counter: string;
124
+ chainHashB64: string;
125
+ }>;
126
+ /** Counts in the closed range with no BitGraph found when the write was made. */
127
+ missing: string[];
128
+ writtenAt: string;
129
+ }
130
+ export interface GenesisChainCheck {
131
+ ok: boolean;
132
+ problems: string[];
133
+ writes: number;
134
+ }
135
+ /**
136
+ * Check a run of genesis records in order: each decodes and binds its note, its tree is its members, each links to the
137
+ * write before it, and each closes the epoch the one before it opened. `prevLink` is the link of the write before the
138
+ * first record (an hourly write's, where the run begins after hourly publication), when it is known.
139
+ */
140
+ export declare function checkGenesisChain(records: readonly GenesisRecord[], prevLink?: string | null): GenesisChainCheck;
141
+ //# sourceMappingURL=genesis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genesis.d.ts","sourceRoot":"","sources":["../src/genesis.ts"],"names":[],"mappings":"AAoCA,OAAO,EACL,oBAAoB,EASrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAoD,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAExG,eAAO,MAAM,cAAc,EAAG,oBAA6B,CAAC;AAC5D,eAAO,MAAM,qBAAqB,EAAG,wBAAiC,CAAC;AAMvE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjG,sEAAsE;IACtE,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3E;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,CAgBtD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG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C,CAAC,CAAC,cAAc,CAAC,CAAC;CAC3E;AAWD,gHAAgH;AAChH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,GAAE,6BAAkC,GAAG,OAAO,CAAC,YAAY,CAAC,CAMzH;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAE,6BAAkC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAavI;AAID,2FAA2F;AAC3F,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,cAAc,CAAC;IAC9B,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,CAAC;IACrB,gFAAgF;IAChF,OAAO,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,iFAAiF;IACjF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAAG,EAAE,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAEtF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,EAAE,QAAQ,GAAE,MAAM,GAAG,IAAW,GAAG,iBAAiB,CAoBtH"}
@@ -0,0 +1,359 @@
1
+ // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
+ /**
3
+ * Epoch genesis: one write to Base at the start of each epoch, and the offline check.
4
+ *
5
+ * When a new epoch opens, the operator writes a short note that closes the epoch before it (its id, its range of
6
+ * counts, how many BitGraphs it holds and the root of a tree over them), names the write before this one, and names a
7
+ * recent Base block. The new enclave makes an ordinary BitGraph of that note. The receipt, with the note beside it in
8
+ * its unsigned metadata, is then written to Base whole, as plain JSON text: the transaction's data begins
9
+ * `{"version":"bitgraph/1"` and is a BitGraph receipt that verifies offline like any other, with nothing else in hand.
10
+ *
11
+ * note (bitgraph-genesis/1), UTF-8, one field a line:
12
+ * BitGraph epoch genesis (bitgraph-genesis/1)
13
+ * chain: base <chain id>
14
+ * previous write: <link of the write before this one, 64 hex; zeros for the first ever>
15
+ * closes epoch: <epoch id, base64; "none" when there is no epoch before>
16
+ * first count: <n> last count: <n> bitgraphs: <n> root: <64 hex, zeros when there are none>
17
+ * after block: <n> after block hash: <0x + 64 hex> after block time: <unix seconds>
18
+ * calldata = UTF-8 of JSON: the receipt, plus metadata["bitgraph-genesis/1"] = { format, note }
19
+ * link = SHA-256(calldata)
20
+ * tree = the tree hourly publication uses: RFC 6962 over leaf = SHA-256(0x00 || published chain hash), in count order
21
+ *
22
+ * What one genesis write shows: the enclave that signed the receipt (its key, its epoch id and the build AWS attests)
23
+ * is the epoch that follows the write it names; the epoch it closes held exactly the BitGraphs under the root; and the
24
+ * new epoch's genesis BitGraph was made after the Base block the note names and existed by the block the write is in.
25
+ * The enclave binds the note's hash, as it does any file's: it does not vouch for what the note says. The root is
26
+ * checked against the closed epoch's receipts, and the writer's address is what marks the operator's genesis among
27
+ * BitGraphs anyone could make of a look-alike note.
28
+ *
29
+ * For one BitGraph, a `bitgraph-publication/2` block ties it to the genesis that closed its epoch (it existed by that
30
+ * write's block) and, when its epoch has one before it, to the genesis that opened its epoch (it was made after the
31
+ * block that note names). checkEpochPublication() needs nothing live. What it cannot check offline is that a block is
32
+ * on Base's canonical chain: compare the block hashes it returns with Base from any source you trust.
33
+ */
34
+ import { sha256 } from "@noble/hashes/sha256";
35
+ import { verifyProofIntegrity, createVerificationContext, decodeHeader, decodeEip1559, mptVerify, txTrieKey, evmHexToBytes, evmBytesToHex, bytesToB64, } from "@mikeargento/bitgraph-verify";
36
+ import { hourLink, hourTree, pathRoot, publishedChainHash } from "./publication.js";
37
+ export const GENESIS_FORMAT = "bitgraph-genesis/1";
38
+ export const EPOCH_PUBLICATION_KEY = "bitgraph-publication/2";
39
+ const ZERO = "0".repeat(64);
40
+ export function genesisNoteText(n) {
41
+ const c = n.closes;
42
+ return [
43
+ `BitGraph epoch genesis (${GENESIS_FORMAT})`,
44
+ `chain: base ${n.chainId}`,
45
+ `previous write: ${n.prevLinkHex.toLowerCase()}`,
46
+ `closes epoch: ${c ? c.epochId : "none"}`,
47
+ `first count: ${c ? c.first : 0}`,
48
+ `last count: ${c ? c.last : 0}`,
49
+ `bitgraphs: ${c ? c.leaves : 0}`,
50
+ `root: ${c ? c.rootHex.toLowerCase() : ZERO}`,
51
+ `after block: ${n.after.blockNumber}`,
52
+ `after block hash: ${n.after.blockHash.toLowerCase()}`,
53
+ `after block time: ${n.after.blockTimestamp}`,
54
+ "",
55
+ ].join("\n");
56
+ }
57
+ export function parseGenesisNote(text) {
58
+ const m = /^BitGraph epoch genesis \(bitgraph-genesis\/1\)\nchain: base (\d+)\nprevious write: ([0-9a-f]{64})\ncloses epoch: (none|[A-Za-z0-9+/]{43}=)\nfirst count: (\d+)\nlast count: (\d+)\nbitgraphs: (\d+)\nroot: ([0-9a-f]{64})\nafter block: (\d+)\nafter block hash: (0x[0-9a-f]{64})\nafter block time: (\d+)\n$/.exec(text);
59
+ if (!m)
60
+ return null;
61
+ const nums = [m[1], m[4], m[5], m[6], m[8], m[10]].map(Number);
62
+ if (!nums.every(Number.isSafeInteger))
63
+ return null;
64
+ const [chainId, first, last, leaves, blockNumber, blockTimestamp] = nums;
65
+ let closes = null;
66
+ if (m[3] === "none") {
67
+ if (first !== 0 || last !== 0 || leaves !== 0 || m[7] !== ZERO)
68
+ return null;
69
+ }
70
+ else {
71
+ if (leaves === 0 ? m[7] !== ZERO : last < first)
72
+ return null;
73
+ closes = { epochId: m[3], first, last, leaves, rootHex: m[7] };
74
+ }
75
+ return { chainId, prevLinkHex: m[2], closes, after: { blockNumber, blockHash: m[9], blockTimestamp } };
76
+ }
77
+ /** The digest the genesis BitGraph binds: SHA-256 of the note's UTF-8 bytes, standard base64. */
78
+ export const genesisNoteDigestB64 = (text) => bytesToB64(sha256(new TextEncoder().encode(text)));
79
+ // ── the write ───────────────────────────────────────────────────────────────
80
+ /** The transaction's data: the receipt as JSON text, with the note it binds in its unsigned metadata. */
81
+ export function encodeGenesisCalldata(receipt, note) {
82
+ const md = (receipt["metadata"] && typeof receipt["metadata"] === "object" ? receipt["metadata"] : {});
83
+ const out = {};
84
+ for (const [k, v] of Object.entries(receipt))
85
+ if (k !== "metadata")
86
+ out[k] = v;
87
+ out["metadata"] = { ...md, [GENESIS_FORMAT]: { format: GENESIS_FORMAT, note } };
88
+ return new TextEncoder().encode(JSON.stringify(out));
89
+ }
90
+ export function decodeGenesisCalldata(b) {
91
+ let text;
92
+ try {
93
+ text = new TextDecoder("utf-8", { fatal: true }).decode(b);
94
+ }
95
+ catch {
96
+ return null;
97
+ }
98
+ let j;
99
+ try {
100
+ j = JSON.parse(text);
101
+ }
102
+ catch {
103
+ return null;
104
+ }
105
+ if (!j || typeof j !== "object" || Array.isArray(j))
106
+ return null;
107
+ const receipt = j;
108
+ if (typeof receipt["version"] !== "string" || !receipt["version"].startsWith("bitgraph/"))
109
+ return null;
110
+ const g = receipt["metadata"]?.[GENESIS_FORMAT];
111
+ if (!g || g.format !== GENESIS_FORMAT || typeof g.note !== "string")
112
+ return null;
113
+ return { receipt, note: g.note };
114
+ }
115
+ /** The link the next write names: SHA-256 of this write's calldata, hex (the same rule as an hourly write's). */
116
+ export const genesisLink = hourLink;
117
+ /** A genesis write's own consistency: it decodes, its receipt binds its note, and the note closes some other epoch. */
118
+ export function checkGenesis(calldata, opts = {}) {
119
+ const problems = [];
120
+ const out = { ok: false, problems, note: null, epochId: null, counter: null, publicKeyB64: null, link: null };
121
+ const w = decodeGenesisCalldata(calldata);
122
+ if (!w) {
123
+ problems.push("the genesis write does not decode");
124
+ return out;
125
+ }
126
+ out.link = genesisLink(calldata);
127
+ const note = parseGenesisNote(w.note);
128
+ if (!note) {
129
+ problems.push("the genesis note does not parse");
130
+ return out;
131
+ }
132
+ out.note = note;
133
+ const wantChain = opts.chainId ?? 8453;
134
+ if (note.chainId !== wantChain)
135
+ problems.push(`the genesis note is not for chain ${wantChain}`);
136
+ const artifact = (w.receipt["artifact"] ?? {});
137
+ if (artifact.hashAlg !== "sha256" || artifact.digestB64 !== genesisNoteDigestB64(w.note))
138
+ problems.push("the genesis BitGraph does not bind its note");
139
+ const commit = (w.receipt["commit"] ?? {});
140
+ const key = w.receipt["signer"]?.publicKeyB64;
141
+ if (typeof commit.epochId !== "string" || typeof commit.counter !== "string" || typeof key !== "string")
142
+ problems.push("the genesis BitGraph has no epoch, count or key");
143
+ else {
144
+ out.epochId = commit.epochId;
145
+ out.counter = commit.counter;
146
+ out.publicKeyB64 = key;
147
+ if (note.closes && note.closes.epochId === commit.epochId)
148
+ problems.push("the genesis BitGraph is in the epoch it closes");
149
+ }
150
+ out.ok = problems.length === 0;
151
+ return out;
152
+ }
153
+ export function epochPublicationOf(proof) {
154
+ const md = proof?.metadata;
155
+ const b = md?.[EPOCH_PUBLICATION_KEY];
156
+ if (!b || typeof b !== "object" || b.format !== EPOCH_PUBLICATION_KEY)
157
+ return null;
158
+ return b;
159
+ }
160
+ /** The transaction a write's evidence carries: read from the inclusion proof, tied to the header and the block hash. */
161
+ function writeTransaction(e, wantChain, opts, problems) {
162
+ try {
163
+ const header = decodeHeader(evmHexToBytes(e.headerRlp));
164
+ if (header.hash !== e.blockHash.toLowerCase())
165
+ problems.push("the header does not hash to the block hash");
166
+ if (header.number !== e.blockNumber || header.timestamp !== e.blockTimestamp)
167
+ problems.push("the header's number or time differs from the evidence");
168
+ const leaf = mptVerify(evmHexToBytes(header.transactionsRoot), txTrieKey(e.txIndex), e.txInclusionProof.map(evmHexToBytes));
169
+ if (!leaf) {
170
+ problems.push("the transaction is not in the block's transaction trie at that index");
171
+ return null;
172
+ }
173
+ if (e.rawTx !== undefined && evmBytesToHex(evmHexToBytes(e.rawTx)) !== evmBytesToHex(leaf))
174
+ problems.push("the raw transaction is not the one in the block");
175
+ const tx = decodeEip1559(leaf);
176
+ if (tx.hash !== e.txHash.toLowerCase())
177
+ problems.push("the transaction in the block does not hash to the transaction hash");
178
+ if (Number(tx.chainId) !== wantChain || e.chainId !== wantChain)
179
+ problems.push(`the transaction is not on chain ${wantChain}`);
180
+ if (opts.writer !== undefined) {
181
+ if (tx.from !== opts.writer.toLowerCase())
182
+ problems.push("the transaction is not from the expected writer");
183
+ if ((tx.to ?? "") !== opts.writer.toLowerCase())
184
+ problems.push("the transaction is not sent to the writer itself");
185
+ }
186
+ return { data: tx.data, header, txHash: tx.hash };
187
+ }
188
+ catch (err) {
189
+ problems.push(`the write's evidence does not hold together: ${err.message}`);
190
+ return null;
191
+ }
192
+ }
193
+ export function checkEpochPublication(proofIn, opts = {}) {
194
+ const problems = [];
195
+ const out = { ok: false, problems, ceiling: null, floor: null, nextEpochId: null };
196
+ const proof = proofIn;
197
+ const b = epochPublicationOf(proof);
198
+ if (!b) {
199
+ problems.push("the proof carries no bitgraph-publication/2 block");
200
+ return out;
201
+ }
202
+ const commit = (proof["commit"] ?? {});
203
+ const wantChain = opts.chainId ?? 8453;
204
+ // The proof is the one the block is about.
205
+ if (publishedChainHash(proof) !== b.chainHashB64)
206
+ problems.push("the block's chain hash is not this proof's");
207
+ if (commit.epochId !== b.epochId || commit.counter !== b.counter)
208
+ problems.push("the block names a different epoch or count");
209
+ const count = Number(b.counter);
210
+ // The genesis that closed the epoch: its transaction, its block, and the note's tree.
211
+ const tx = b.closedBy && typeof b.closedBy === "object" ? writeTransaction(b.closedBy, wantChain, opts, problems) : null;
212
+ if (!tx) {
213
+ if (problems.length === 0)
214
+ problems.push("the closing genesis has no evidence");
215
+ return out;
216
+ }
217
+ const closing = checkGenesis(tx.data, { chainId: wantChain });
218
+ for (const p of closing.problems)
219
+ problems.push(`the closing genesis: ${p}`);
220
+ const closes = closing.note?.closes ?? null;
221
+ if (closing.note) {
222
+ if (!closes || closes.epochId !== b.epochId)
223
+ problems.push("the closing genesis closes a different epoch");
224
+ else {
225
+ if (!(closes.leaves > 0 && count >= closes.first && count <= closes.last))
226
+ problems.push("the proof's count is outside the closed range");
227
+ if (!(Number.isInteger(b.leafIndex) && b.leafIndex >= 0 && b.leafIndex < closes.leaves))
228
+ problems.push("the leaf index is outside the tree");
229
+ else if (pathRoot(b.chainHashB64, b.leafIndex, closes.leaves, b.path) !== closes.rootHex)
230
+ problems.push("the path does not reach the closing genesis's root");
231
+ }
232
+ out.nextEpochId = closing.epochId;
233
+ out.ceiling = { chainId: b.closedBy.chainId, blockNumber: tx.header.number, blockHash: tx.header.hash, blockTimestamp: tx.header.timestamp, txHash: tx.txHash };
234
+ }
235
+ // The genesis that opened the epoch, when the block carries one: the floor.
236
+ if (b.openedBy !== null && b.openedBy !== undefined) {
237
+ let cd = null;
238
+ try {
239
+ cd = evmHexToBytes(b.openedBy.calldata);
240
+ }
241
+ catch {
242
+ cd = null;
243
+ }
244
+ const opening = cd && decodeGenesisCalldata(cd) ? checkGenesis(cd, { chainId: wantChain }) : null;
245
+ if (!cd || !opening)
246
+ problems.push("the opening genesis does not decode");
247
+ else {
248
+ for (const p of opening.problems)
249
+ problems.push(`the opening genesis: ${p}`);
250
+ const pKey = proof["signer"]?.publicKeyB64;
251
+ if (opening.epochId !== b.epochId)
252
+ problems.push("the opening genesis is in a different epoch");
253
+ if (opening.publicKeyB64 === null || opening.publicKeyB64 !== pKey)
254
+ problems.push("the opening genesis is not signed by the proof's epoch key");
255
+ if (!(Number(opening.counter) < count))
256
+ problems.push("the opening genesis does not come before the proof");
257
+ // It is the write on Base right before the closing one: the closing note names its link.
258
+ if (closing.note && opening.link !== closing.note.prevLinkHex)
259
+ problems.push("the opening genesis is not the write the closing genesis links back to");
260
+ if (opening.note && opening.counter !== null) {
261
+ out.floor = { chainId: opening.note.chainId, blockNumber: opening.note.after.blockNumber, blockHash: opening.note.after.blockHash, blockTimestamp: opening.note.after.blockTimestamp, genesisCounter: opening.counter };
262
+ }
263
+ }
264
+ }
265
+ out.ok = problems.length === 0;
266
+ return out;
267
+ }
268
+ async function integrity(p, what, opts, problems) {
269
+ try {
270
+ const r = await verifyProofIntegrity({ proof: p, ...(opts.trustAnchors ? { trustAnchors: opts.trustAnchors } : {}), context: createVerificationContext() });
271
+ if (!r.valid)
272
+ problems.push(`${what} does not verify: ${r.reason ?? "invalid"}`);
273
+ }
274
+ catch (e) {
275
+ problems.push(`${what} does not verify: ${e.message}`);
276
+ }
277
+ }
278
+ /** checkGenesis(), plus the receipt's own signatures and attestation through the verifier's integrity check. */
279
+ export async function verifyGenesis(calldata, opts = {}) {
280
+ const out = checkGenesis(calldata, opts);
281
+ const w = decodeGenesisCalldata(calldata);
282
+ if (w)
283
+ await integrity(w.receipt, "the genesis BitGraph", opts, out.problems);
284
+ out.ok = out.problems.length === 0;
285
+ return out;
286
+ }
287
+ /**
288
+ * checkEpochPublication(), plus the signatures and attestations of the proof and of both genesis BitGraphs. A block
289
+ * says nothing unless those are sound, so this is the check to use.
290
+ */
291
+ export async function verifyEpochPublication(proofIn, opts = {}) {
292
+ const out = checkEpochPublication(proofIn, opts);
293
+ const proof = proofIn;
294
+ await integrity(proof, "the proof", opts, out.problems);
295
+ const b = epochPublicationOf(proof);
296
+ if (b) {
297
+ const closing = (() => { try {
298
+ return decodeGenesisCalldata(decodeEip1559(mptVerify(evmHexToBytes(decodeHeader(evmHexToBytes(b.closedBy.headerRlp)).transactionsRoot), txTrieKey(b.closedBy.txIndex), b.closedBy.txInclusionProof.map(evmHexToBytes))).data);
299
+ }
300
+ catch {
301
+ return null;
302
+ } })();
303
+ if (closing)
304
+ await integrity(closing.receipt, "the closing genesis BitGraph", opts, out.problems);
305
+ const opening = (() => { try {
306
+ return b.openedBy ? decodeGenesisCalldata(evmHexToBytes(b.openedBy.calldata)) : null;
307
+ }
308
+ catch {
309
+ return null;
310
+ } })();
311
+ if (opening)
312
+ await integrity(opening.receipt, "the opening genesis BitGraph", opts, out.problems);
313
+ }
314
+ out.ok = out.problems.length === 0;
315
+ return out;
316
+ }
317
+ /**
318
+ * Check a run of genesis records in order: each decodes and binds its note, its tree is its members, each links to the
319
+ * write before it, and each closes the epoch the one before it opened. `prevLink` is the link of the write before the
320
+ * first record (an hourly write's, where the run begins after hourly publication), when it is known.
321
+ */
322
+ export function checkGenesisChain(records, prevLink = null) {
323
+ const problems = [];
324
+ let link = prevLink;
325
+ let opened = null;
326
+ records.forEach((r, i) => {
327
+ let cd = null;
328
+ try {
329
+ cd = evmHexToBytes(r.calldata);
330
+ }
331
+ catch {
332
+ cd = null;
333
+ }
334
+ const g = cd ? checkGenesis(cd, { chainId: r.write.chainId }) : null;
335
+ if (!cd || !g || !g.note) {
336
+ problems.push(`genesis ${i}: does not decode`);
337
+ link = null;
338
+ opened = null;
339
+ return;
340
+ }
341
+ for (const p of g.problems)
342
+ problems.push(`genesis ${i}: ${p}`);
343
+ if (g.link !== r.link)
344
+ problems.push(`genesis ${i}: link is not the calldata's hash`);
345
+ if (link !== null && g.note.prevLinkHex !== link)
346
+ problems.push(`genesis ${i}: does not link to the write before it`);
347
+ const c = g.note.closes;
348
+ if (opened !== null && c?.epochId !== opened)
349
+ problems.push(`genesis ${i}: does not close the epoch the one before it opened`);
350
+ if ((c?.leaves ?? 0) !== r.members.length)
351
+ problems.push(`genesis ${i}: leaf count differs from its members`);
352
+ else if (c && c.leaves > 0 && hourTree(r.members.map((m) => m.chainHashB64)).rootHex !== c.rootHex)
353
+ problems.push(`genesis ${i}: members do not make its root`);
354
+ link = r.link;
355
+ opened = g.epochId;
356
+ });
357
+ return { ok: problems.length === 0, problems, writes: records.length };
358
+ }
359
+ //# sourceMappingURL=genesis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gen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AAI;YAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,mCAAmC,CAAC,CAAC;QACtF,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI;YAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAC;QACtH,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QACxB,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,EAAE,OAAO,KAAK,MAAM;YAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,qDAAqD,CAAC,CAAC;QAC/H,IAAI,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM;YAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,uCAAuC,CAAC,CAAC;aACzG,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;YAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,gCAAgC,CAAC,CAAC;QAChK,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;QACd,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AACzE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -39,4 +39,10 @@ export { computeContentsHashB64, computeEntryDigest } from "./contents-hash.js";
39
39
  export type { ContentsHashEntry } from "./contents-hash.js";
40
40
  export { buildBundleArchive } from "./export.js";
41
41
  export type { BundleArchiveInput, BundleArchiveProofEntry, BundleArchiveWitnessEntry, BundleArchiveArtifactFile, } from "./export.js";
42
+ export { PUBLICATION_METADATA_KEY, HOUR_RECORD_FORMAT, FLOOR_NOTE_FORMAT, HOUR_MAGIC, encodeHourCalldata, decodeHourCalldata, hourLink, hourLeaf, hourTree, floorNoteText, parseFloorNote, floorNoteDigestB64, publicationOf, publishedChainHash, checkPublication, verifyPublication, checkHourChain, toHex as publicationHex, } from "./publication.js";
43
+ export type { HourWrite, HourTree, FloorNote, WriteEvidence, PublicationFloor, PublicationBlock, PublicationCheck, PublicationCheckOptions, PublicationVerifyOptions, HourRecord, HourChainCheck, } from "./publication.js";
44
+ export { GENESIS_FORMAT, EPOCH_PUBLICATION_KEY, genesisNoteText, parseGenesisNote, genesisNoteDigestB64, encodeGenesisCalldata, decodeGenesisCalldata, genesisLink, checkGenesis, verifyGenesis, epochPublicationOf, checkEpochPublication, verifyEpochPublication, checkGenesisChain, } from "./genesis.js";
45
+ export type { GenesisNote, GenesisWrite, GenesisCheck, GenesisEvidence, EpochPublicationBlock, EpochPublicationCheck, EpochPublicationOptions, EpochPublicationVerifyOptions, GenesisRecord, GenesisChainCheck, } from "./genesis.js";
46
+ export { TOT_FORMAT, TOT_FORMAT_V2, TOT_V1_MEASUREMENTS, TOT_V2_MEASUREMENTS, TOT_MEASUREMENTS, totFormProblem, verifyTotReceipt, checkTotFloor, checkSpentOnce } from "./tot.js";
47
+ export type { TotVerdict, SpentTwice, SpentTwiceCode } from "./tot.js";
42
48
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd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AgB,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChF,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,2BAA2B,EAC3B,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,2BAA2B,EAC3B,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,YAAY,EACZ,g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V,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EACjF,gBAAgB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,UAAU,EAAE,cAAc,GAChG,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,cAAc,EAAE,qBAAqB,EACrC,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EACvD,qBAAqB,EAAE,qBAAqB,EAAE,WAAW,EACzD,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,iBAAiB,GAClH,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,qBAAqB,EACtG,uBAAuB,EAAE,6BAA6B,EAAE,aAAa,EAAE,iBAAiB,GACzF,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAClL,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -22,4 +22,9 @@ export { buildMarkdownReport } from "./report-md.js";
22
22
  export { AWS_NITRO_ROOT_CA_PEM } from "./aws-nitro-root-ca.js";
23
23
  export { computeContentsHashB64, computeEntryDigest } from "./contents-hash.js";
24
24
  export { buildBundleArchive } from "./export.js";
25
+ /* Hourly publication on Base (bitgraph-hour/1, bitgraph-publication/1): the formats and the offline check. */
26
+ export { PUBLICATION_METADATA_KEY, HOUR_RECORD_FORMAT, FLOOR_NOTE_FORMAT, HOUR_MAGIC, encodeHourCalldata, decodeHourCalldata, hourLink, hourLeaf, hourTree, floorNoteText, parseFloorNote, floorNoteDigestB64, publicationOf, publishedChainHash, checkPublication, verifyPublication, checkHourChain, toHex as publicationHex, } from "./publication.js";
27
+ /* Epoch genesis on Base (bitgraph-genesis/1, bitgraph-publication/2): one write at the start of each epoch, and the offline check. */
28
+ export { GENESIS_FORMAT, EPOCH_PUBLICATION_KEY, genesisNoteText, parseGenesisNote, genesisNoteDigestB64, encodeGenesisCalldata, decodeGenesisCalldata, genesisLink, checkGenesis, verifyGenesis, epochPublicationOf, checkEpochPublication, verifyEpochPublication, checkGenesisChain, } from "./genesis.js";
29
+ export { TOT_FORMAT, TOT_FORMAT_V2, TOT_V1_MEASUREMENTS, TOT_V2_MEASUREMENTS, TOT_MEASUREMENTS, totFormProblem, verifyTotReceipt, checkTotFloor, checkSpentOnce } from "./tot.js";
25
30
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAmG9F,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGhI,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,qFAAqF;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,qBAAqB,EA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