@mikeargento/bitgraph-audit 0.11.0 → 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 (91) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +7 -5
  3. package/dist/anchors.js +1 -1
  4. package/dist/anomalies.js +1 -1
  5. package/dist/attestation.js +1 -1
  6. package/dist/audit.d.ts +1 -1
  7. package/dist/audit.js +2 -2
  8. package/dist/authority.js +1 -1
  9. package/dist/aws-nitro-root-ca.js +1 -1
  10. package/dist/ceilings.js +1 -1
  11. package/dist/cli.js +1 -1
  12. package/dist/contents-hash.js +1 -1
  13. package/dist/export.js +1 -1
  14. package/dist/exports.js +1 -1
  15. package/dist/floors.js +1 -1
  16. package/dist/genesis.d.ts +141 -0
  17. package/dist/genesis.d.ts.map +1 -0
  18. package/dist/genesis.js +359 -0
  19. package/dist/genesis.js.map +1 -0
  20. package/dist/index.d.ts +6 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +6 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/ingest.js +1 -1
  25. package/dist/publication.d.ts +148 -0
  26. package/dist/publication.d.ts.map +1 -0
  27. package/dist/publication.js +392 -0
  28. package/dist/publication.js.map +1 -0
  29. package/dist/reconstruct.js +1 -1
  30. package/dist/report-json.js +1 -1
  31. package/dist/report-md.js +1 -1
  32. package/dist/rlp.js +1 -1
  33. package/dist/rollup-schedule.d.ts +58 -0
  34. package/dist/rollup-schedule.d.ts.map +1 -0
  35. package/dist/rollup-schedule.js +105 -0
  36. package/dist/rollup-schedule.js.map +1 -0
  37. package/dist/settlement-blobs.d.ts +16 -19
  38. package/dist/settlement-blobs.d.ts.map +1 -1
  39. package/dist/settlement-blobs.js +37 -17
  40. package/dist/settlement-blobs.js.map +1 -1
  41. package/dist/tar.js +1 -1
  42. package/dist/temporal.js +1 -1
  43. package/dist/tot.d.ts +99 -0
  44. package/dist/tot.d.ts.map +1 -0
  45. package/dist/tot.js +242 -0
  46. package/dist/tot.js.map +1 -0
  47. package/dist/types.js +1 -1
  48. package/dist/validity.js +1 -1
  49. package/dist/verify-tiers.js +1 -1
  50. package/dist/witness.js +1 -1
  51. package/package.json +5 -4
  52. package/src/__tests__/{anchors.test.ts → archive/anchors.test.ts} +3 -3
  53. package/src/__tests__/{base-floor.test.ts → archive/base-floor.test.ts} +3 -3
  54. package/src/__tests__/{carrier-tree.test.ts → archive/carrier-tree.test.ts} +3 -3
  55. package/src/__tests__/archive/genesis.test.ts +256 -0
  56. package/src/__tests__/archive/publication.test.ts +210 -0
  57. package/src/__tests__/{settlement.test.ts → archive/settlement.test.ts} +1 -1
  58. package/src/__tests__/tot-v2-vectors.test.ts +87 -0
  59. package/src/__tests__/tot-vectors.test.ts +120 -0
  60. package/src/anchors.ts +1 -1
  61. package/src/anomalies.ts +1 -1
  62. package/src/attestation.ts +1 -1
  63. package/src/audit.ts +2 -2
  64. package/src/authority.ts +1 -1
  65. package/src/aws-nitro-root-ca.ts +1 -1
  66. package/src/ceilings.ts +1 -1
  67. package/src/cli.ts +1 -1
  68. package/src/contents-hash.ts +1 -1
  69. package/src/export.ts +1 -1
  70. package/src/exports.ts +1 -1
  71. package/src/floors.ts +1 -1
  72. package/src/genesis.ts +382 -0
  73. package/src/index.ts +27 -1
  74. package/src/ingest.ts +1 -1
  75. package/src/publication.ts +461 -0
  76. package/src/reconstruct.ts +1 -1
  77. package/src/report-json.ts +1 -1
  78. package/src/report-md.ts +1 -1
  79. package/src/rlp.ts +1 -1
  80. package/src/rollup-schedule.ts +105 -0
  81. package/src/settlement-blobs.ts +41 -21
  82. package/src/tar.ts +1 -1
  83. package/src/temporal.ts +1 -1
  84. package/src/tot.ts +253 -0
  85. package/src/types.ts +1 -1
  86. package/src/validity.ts +1 -1
  87. package/src/verify-tiers.ts +1 -1
  88. package/src/witness.ts +1 -1
  89. /package/src/__tests__/{fixtures → archive/fixtures}/settlement/0x018efc046e94610e2530344caf1574e507a3182e1a975fb25b032ec1434a3f5c.bin +0 -0
  90. /package/src/__tests__/{fixtures → archive/fixtures}/settlement/ceiling-51979918.json +0 -0
  91. /package/src/__tests__/{fixtures → archive/fixtures}/settlement/pointer-51979918.json +0 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024-2026 Argento Computing Inc.
3
+ Copyright (c) 2025-2026 Argento Computing Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -2,15 +2,17 @@
2
2
 
3
3
  Offline audit of BitGraph evidence: `npx @mikeargento/bitgraph-audit <bundle>`.
4
4
 
5
- An Audit Bundle is a portable collection of BitGraph proofs, optionally accompanied by the original artifact bytes, anchor witness material (for proofs floored by Ethereum anchors, before the Base floor), and a manifest, packaged as a directory, a `.tar`, or a `.tar.gz`. A single BitGraphed file (a file with its proof inside) is also accepted: it is unpacked and audited as the bundle it carries, its own verdict printed first. The download package a bitgraph.ing proof page offers (`proof.json`, `committed/`, `original/`, `bitgraphed-file/`, `ethereum-anchors/`, `base-ceiling/`) is such a bundle. The premise: the operator's database is not the evidence. BitGraph proofs are self-contained objects, and this package lets an independent reader take a bundle, verify whatever evidence it contains fully offline, and reconstruct the causal record without asking the operator which history to trust. The on-disk format is specified in [docs/BUNDLE-FORMAT.md](https://github.com/mikeargento/bitgraph/blob/main/docs/BUNDLE-FORMAT.md); both this consumer and the bitgraph.ing exporter conform to it.
5
+ An Audit Bundle is a portable collection of BitGraph proofs, optionally with the original files and a manifest, packaged as a directory, a `.tar`, or a `.tar.gz`. A folder of files with their `.bitgraph.json` proofs beside them is such a bundle. The premise: the operator's database is not the evidence. BitGraph proofs are self-contained objects, and this package lets an independent reader take a bundle, verify whatever evidence it contains fully offline, and reconstruct the sequence without asking the operator which history to trust. The on-disk format is specified in [docs/BUNDLE-FORMAT.md](https://github.com/mikeargento/bitgraph/blob/main/docs/BUNDLE-FORMAT.md).
6
6
 
7
- The tool reports exactly what the evidence supports, nothing more. Incomplete input produces an incomplete reconstruction: missing proofs surface as unexplained counter positions and broken predecessor links, which means the supplied evidence cannot reconstruct those positions, not that the authority failed to create them. Divergence between valid objects is presented, never resolved; the reader adjudicates. Proofs without their artifact bytes pass through the bytes-free integrity checks and are reported as artifact-unavailable, never as fully verified. In the chain analysis, wall-clock bounds appear only when independently verifiable offline evidence (a locally reconstructed Ethereum block header, for proofs made before the Base floor) is present in the bundle; a tree/1 export's floor and ceilings are checked by `verifyExport`. There is no network access at runtime of any kind.
7
+ The tool reports exactly what the evidence supports, nothing more. Incomplete input produces an incomplete reconstruction: missing proofs surface as unexplained counter positions and broken predecessor links, which means the supplied evidence cannot reconstruct those positions, not that the enclave failed to create them. Divergence between valid objects is presented, never resolved; the reader adjudicates. Proofs without their file pass through the checks that need no bytes and are reported as artifact-unavailable, never as fully verified. A file is matched to a proof when its SHA-256 is the digest the proof binds. A file that is one of a tree is not: its proof binds the tree's root, so the audit reports that proof as artifact-unavailable. Check such a file against its own proof with `verifyAttested` from `@mikeargento/bitgraph-verify`, or `bitgraph verify` from the SDK, which walk the file's hash up to the root. There is no network access at runtime of any kind.
8
8
 
9
- Exactly one proof schema is supported: `bitgraph/1`. The legacy `occ/1` schema is pre-release beta data and is permanently out of scope; proof-shaped files with any other version are rejected at ingest with the stable code `unsupported-version`. All verification semantics come from `@mikeargento/bitgraph-verify` (MIT), the same verifier anyone can run against a single proof. The `bitgraph-audit` CLI runs the whole pipeline (ingest, verification tiers, causal reconstruction, anomaly classification, authority analysis, anchor identification, witness verification, temporal bounds, offline attestation validation) and writes `audit-report.json` and `audit-report.md`; `runAudit()` is the one-call library entry point, and every stage is also exported individually. See [docs/HOW-TO-AUDIT.md](https://github.com/mikeargento/bitgraph/blob/main/docs/HOW-TO-AUDIT.md) for the recipient walkthrough and [docs/BUNDLE-FORMAT.md](https://github.com/mikeargento/bitgraph/blob/main/docs/BUNDLE-FORMAT.md) for the on-disk format.
9
+ Exactly one proof schema is supported: `bitgraph/1`. Proof-shaped files with any other version are rejected at ingest with the stable code `unsupported-version`. All verification semantics come from `@mikeargento/bitgraph-verify` (MIT), the same verifier anyone can run against a single proof. The `bitgraph-audit` CLI runs the whole pipeline (ingest, verification, reconstruction of each epoch's sequence from counts and predecessor hashes, anomaly classification, offline attestation validation) and writes `audit-report.json` and `audit-report.md`; `runAudit()` is the one-call library entry point, and every stage is also exported individually. See [docs/HOW-TO-AUDIT.md](https://github.com/mikeargento/bitgraph/blob/main/docs/HOW-TO-AUDIT.md) for the recipient walkthrough.
10
10
 
11
- ## Exports (bitgraph-export/1)
11
+ Counts order proofs inside one epoch. Epochs are separate runs of the enclave, each with its own key and a count from zero, so counts never order proofs across epochs.
12
12
 
13
- A tree/1 BitGraph (one position for one or more files, one file a tree of one) travels as one JSON export beside its files, with `SPEC.md`, the text the proof pins. The export holds no file copies and no anchor proofs. The audit finds every export in a bundle by its `format` field, checks it with `verifyExport` once for each file in the bundle it covers (by SHA-256: a member's committed bytes or original, or any leaf of the owner's export), and reports every claim with what it rests on, the covered files, and the three time claims apart: the floor, the ceiling on Base (provisional until its block is checked against Base) and the ceiling on Ethereum, which is the settlement of that Base block through Base's output root. The proof inside joins the chain analysis like any proof. An export with a FALSE claim fails the audit (exit 1); a claim the export does not carry never does. Requires `@mikeargento/bitgraph-verify` 1.16.0.
13
+ ## Evidence in earlier formats
14
+
15
+ Bundles made from earlier proofs still audit. The tool finds each of these by what it is, not by its name: a `bitgraph-export/1` file (checked with `verifyExport` once for each file in the bundle it covers), a BitGraphed file (a file with its proof inside, unpacked and audited as the bundle it carries), block header witnesses for proofs that sign an Ethereum or Base block, and a download package from a bitgraph.ing proof page. An export with a FALSE claim fails the audit (exit 1); a claim an export does not carry never does.
14
16
 
15
17
  ## License
16
18
 
package/dist/anchors.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * bitgraph-audit anchor identification (G5)
4
4
  *
package/dist/anomalies.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  import { byCounterThenHash, isIntrinsicallyValid, parseCounter, pushMap } from "./validity.js";
3
3
  /**
4
4
  * Cap on the flat unexplained-position list. Ranges and the total count
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * bitgraph-audit offline attestation validation
4
4
  *
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.0";
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
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * Audit orchestrator: the full offline pipeline in canonical order.
4
4
  *
@@ -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.0";
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;
package/dist/authority.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  import { pushMap } from "./validity.js";
3
3
  /**
4
4
  * Analyze authority structure over every observed proof (including
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * AWS Nitro Enclaves Root CA G1
4
4
  *
package/dist/ceilings.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * Ceilings in time (bitgraph-ceiling/1): each ceiling file in the bundle is
4
4
  * matched to its proof by proofHash and checked with verifyCeiling, offline.
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
3
3
  /**
4
4
  * bitgraph-audit CLI: run the full offline audit pipeline over a bundle
5
5
  * and write audit-report.json and/or audit-report.md.
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * Deterministic bundle contents hash, per docs/BUNDLE-FORMAT.md section 8.
4
4
  *
package/dist/export.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * Bundle archive builder: the producer counterpart of ingest.
4
4
  *
package/dist/exports.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * Exports (bitgraph-export/1) through the audit.
4
4
  *
package/dist/floors.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
1
+ // Copyright (c) 2025-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
2
2
  /**
3
3
  * bitgraph-audit signed floors (enclave v10)
4
4
  *
@@ -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,WAAW,GAAG,IAAI,CAcjE;AAED,iGAAiG;AACjG,e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