@mikeargento/bitgraph-verify 1.13.1 → 1.14.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 +1 -1
- package/dist/__tests__/ceiling.test.d.ts +8 -0
- package/dist/__tests__/ceiling.test.d.ts.map +1 -0
- package/dist/__tests__/ceiling.test.js +247 -0
- package/dist/__tests__/ceiling.test.js.map +1 -0
- package/dist/ceiling-evm.d.ts +49 -0
- package/dist/ceiling-evm.d.ts.map +1 -0
- package/dist/ceiling-evm.js +331 -0
- package/dist/ceiling-evm.js.map +1 -0
- package/dist/ceiling-trie.d.ts +9 -0
- package/dist/ceiling-trie.d.ts.map +1 -0
- package/dist/ceiling-trie.js +113 -0
- package/dist/ceiling-trie.js.map +1 -0
- package/dist/ceiling.d.ts +123 -0
- package/dist/ceiling.d.ts.map +1 -0
- package/dist/ceiling.js +247 -0
- package/dist/ceiling.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/__tests__/ceiling.test.ts +281 -0
- package/src/__tests__/fixtures/ceiling/floor-26037892.header.hex +1 -0
- package/src/ceiling-evm.ts +326 -0
- package/src/ceiling-trie.ts +112 -0
- package/src/ceiling.ts +333 -0
- package/src/index.ts +12 -0
package/src/ceiling.ts
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Argento Computing Inc. Licensed under the MIT License. See LICENSE.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A ceiling in TIME for a BitGraph, carried beside the proof, never inside it.
|
|
5
|
+
*
|
|
6
|
+
* Every BitGraph already has a floor in time (the Ethereum block fused in at
|
|
7
|
+
* slot allocation, `commit.slotAnchor`) and a ceiling in POSITION (the
|
|
8
|
+
* anchors that follow it in the chain). This adds the one thing a record
|
|
9
|
+
* cannot supply for itself: something outside the operator's control that
|
|
10
|
+
* depends on the record. After a commit, a writer puts a Merkle root over
|
|
11
|
+
* record hashes into a Base transaction. The block that includes it proves
|
|
12
|
+
* every record under that root existed by the block's timestamp.
|
|
13
|
+
*
|
|
14
|
+
* The sidecar (`bitgraph-ceiling/1`) is unsigned and trusted for nothing. Every
|
|
15
|
+
* value it states is recomputed here from bytes bound to a hash:
|
|
16
|
+
*
|
|
17
|
+
* proof ─computeProofHash→ leaf ─merklePath→ root
|
|
18
|
+
* root == payload.root, payload == tx.data, tx signed by the writer
|
|
19
|
+
* tx ─MPT proof→ header.transactionsRoot, keccak(header) == blockHash
|
|
20
|
+
* blockTimestamp read from the header, not from the sidecar's own field
|
|
21
|
+
*
|
|
22
|
+
* What stays OUTSIDE this function, and is reported, not assumed:
|
|
23
|
+
* - whether that header is really a Base block (check it against any Base
|
|
24
|
+
* RPC; see checkCeilingOnline), and
|
|
25
|
+
* - who the writer is (the caller names the address it trusts; BitGraph
|
|
26
|
+
* publishes its own on bitgraph.ing).
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { sha256 } from "@noble/hashes/sha256";
|
|
30
|
+
import { verifyProofIntegrity, createVerificationContext } from "./verifier.js";
|
|
31
|
+
import { computeProofHash } from "./proof-hash.js";
|
|
32
|
+
import { merkleLeafHash, merkleRootFromPath } from "./fuse-merkle.js";
|
|
33
|
+
import { base64ToBytes } from "./fuse.js";
|
|
34
|
+
import {
|
|
35
|
+
bytesEqual, bytesToHex, decodeEip1559, decodeHeader, hexToBytes, keccak256, mptVerify, txTrieKey,
|
|
36
|
+
} from "./ceiling-evm.js";
|
|
37
|
+
import type { BitGraphProof, VerificationPolicy } from "./types.js";
|
|
38
|
+
|
|
39
|
+
export const CEILING_VERSION = "bitgraph-ceiling/1";
|
|
40
|
+
export const CEILING_MAGIC = "BGC1";
|
|
41
|
+
export const CEILING_PAYLOAD_BYTES = 84;
|
|
42
|
+
|
|
43
|
+
export type CeilingStatus = "pending" | "included" | "safe" | "finalized";
|
|
44
|
+
|
|
45
|
+
export interface CeilingSidecar {
|
|
46
|
+
version: typeof CEILING_VERSION;
|
|
47
|
+
/** Standard base64, as the ledger stores it. */
|
|
48
|
+
proofHash: string;
|
|
49
|
+
leafIndex: number;
|
|
50
|
+
/** Tree size. RFC 9162 path checks need it; not in the build prompt's draft. */
|
|
51
|
+
leafCount: number;
|
|
52
|
+
/** Sibling hashes, leaf level up, 0x hex. */
|
|
53
|
+
merklePath: string[];
|
|
54
|
+
root: string;
|
|
55
|
+
anchor: {
|
|
56
|
+
chainId: number;
|
|
57
|
+
writer: string;
|
|
58
|
+
txHash: string;
|
|
59
|
+
rawTx: string;
|
|
60
|
+
payload: string;
|
|
61
|
+
blockNumber: number;
|
|
62
|
+
blockHash: string;
|
|
63
|
+
blockTimestamp: number;
|
|
64
|
+
blockHeader: string;
|
|
65
|
+
txIndex: number;
|
|
66
|
+
/** Trie nodes from transactionsRoot down to this transaction, 0x hex. */
|
|
67
|
+
txInclusionProof: string[];
|
|
68
|
+
} | null;
|
|
69
|
+
status: CeilingStatus;
|
|
70
|
+
statusObserved: { included: string | null; safe: string | null; finalized: string | null };
|
|
71
|
+
/**
|
|
72
|
+
* The floor block's header, so the window reads offline. Optional and
|
|
73
|
+
* unsigned: checked by keccak256 against the proof's SIGNED slotAnchor hash.
|
|
74
|
+
*/
|
|
75
|
+
floor?: { blockNumber: number; blockHash: string; blockTimestamp: number; blockHeader: string } | null;
|
|
76
|
+
/** Reserved for v2: the Ethereum batch that settles this Base block. */
|
|
77
|
+
settlement: null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ── Payload ────────────────────────────────────────────────────────────────
|
|
81
|
+
|
|
82
|
+
export interface CeilingPayload {
|
|
83
|
+
root: Uint8Array;
|
|
84
|
+
prev: Uint8Array;
|
|
85
|
+
firstPos: bigint;
|
|
86
|
+
lastPos: bigint;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function encodeCeilingPayload(p: CeilingPayload): Uint8Array {
|
|
90
|
+
if (p.root.length !== 32 || p.prev.length !== 32) throw new TypeError("root and prev are 32 bytes");
|
|
91
|
+
const out = new Uint8Array(CEILING_PAYLOAD_BYTES);
|
|
92
|
+
out.set(new TextEncoder().encode(CEILING_MAGIC), 0);
|
|
93
|
+
out.set(p.root, 4);
|
|
94
|
+
out.set(p.prev, 36);
|
|
95
|
+
const view = new DataView(out.buffer);
|
|
96
|
+
view.setBigUint64(68, p.firstPos);
|
|
97
|
+
view.setBigUint64(76, p.lastPos);
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function decodeCeilingPayload(bytes: Uint8Array): CeilingPayload {
|
|
102
|
+
if (bytes.length !== CEILING_PAYLOAD_BYTES) throw new TypeError(`payload is ${bytes.length} bytes, expected ${CEILING_PAYLOAD_BYTES}`);
|
|
103
|
+
const magic = new TextDecoder().decode(bytes.slice(0, 4));
|
|
104
|
+
if (magic !== CEILING_MAGIC) throw new TypeError(`payload magic is ${JSON.stringify(magic)}, expected ${CEILING_MAGIC}`);
|
|
105
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
106
|
+
return {
|
|
107
|
+
root: bytes.slice(4, 36),
|
|
108
|
+
prev: bytes.slice(36, 68),
|
|
109
|
+
firstPos: view.getBigUint64(68),
|
|
110
|
+
lastPos: view.getBigUint64(76),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** SHA-256 of a payload: the next payload's `prev`, so the anchors chain. */
|
|
115
|
+
export function ceilingPayloadHash(payload: Uint8Array): Uint8Array {
|
|
116
|
+
return sha256(payload);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** The leaf hash of one record: SHA256(0x00 || proofHash bytes). */
|
|
120
|
+
export function ceilingLeaf(proofHashB64: string): Uint8Array {
|
|
121
|
+
const raw = base64ToBytes(proofHashB64);
|
|
122
|
+
if (!raw || raw.length !== 32) throw new TypeError("proofHash must decode to 32 bytes");
|
|
123
|
+
return merkleLeafHash(raw);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ── Verification ───────────────────────────────────────────────────────────
|
|
127
|
+
|
|
128
|
+
export interface CeilingCheck {
|
|
129
|
+
name: string;
|
|
130
|
+
ok: boolean;
|
|
131
|
+
detail?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface CeilingVerifyResult {
|
|
135
|
+
/** True when every offline check passed. Says nothing about chain canonicality. */
|
|
136
|
+
ok: boolean;
|
|
137
|
+
reason?: string;
|
|
138
|
+
checks: CeilingCheck[];
|
|
139
|
+
status?: CeilingStatus;
|
|
140
|
+
window?: {
|
|
141
|
+
/** Floor: the proof's signed slotAnchor block. Time only if a checked header was carried. */
|
|
142
|
+
floor: { blockNumber: number; blockHash: string; blockTimestamp: number | null };
|
|
143
|
+
/** Ceiling: the Base block, time read from its header. */
|
|
144
|
+
ceiling: { chainId: number; blockNumber: number; blockHash: string; blockTimestamp: number };
|
|
145
|
+
widthSeconds: number | null;
|
|
146
|
+
};
|
|
147
|
+
/** One line for people. */
|
|
148
|
+
label?: string;
|
|
149
|
+
/** Offline, this is always false; checkCeilingOnline sets it. */
|
|
150
|
+
headerCheckedAgainstChain: boolean;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface CeilingVerifyOptions {
|
|
154
|
+
/** The declared writer address. A sidecar from any other sender is refused. */
|
|
155
|
+
writerAddress: string;
|
|
156
|
+
/** 8453 Base mainnet, 84532 Base Sepolia. */
|
|
157
|
+
chainId: number;
|
|
158
|
+
/** Skip the proof's own signature check (only when the caller already ran verify()). */
|
|
159
|
+
proofAlreadyVerified?: boolean;
|
|
160
|
+
/** Passed through to the proof's own check (measurement allowlist and so on). */
|
|
161
|
+
trustAnchors?: VerificationPolicy;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function hhmmss(unix: number): string {
|
|
165
|
+
return new Date(unix * 1000).toISOString().slice(11, 19);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function ceilingLabel(status: CeilingStatus, blockNumber: number, blockTimestamp: number): string {
|
|
169
|
+
const at = `Base block ${blockNumber.toLocaleString("en-US")} at ${hhmmss(blockTimestamp)} UTC`;
|
|
170
|
+
if (status === "safe" || status === "finalized") return `Ceiling: ${at}, settled on Ethereum.`;
|
|
171
|
+
return `Ceiling: ${at}. Relies on Base's sequencer until settled on Ethereum.`;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Check a ceiling sidecar against its proof, offline. Every check runs and
|
|
176
|
+
* is reported; the first failure is the `reason`.
|
|
177
|
+
*/
|
|
178
|
+
export async function verifyCeiling(
|
|
179
|
+
proof: BitGraphProof,
|
|
180
|
+
sidecar: CeilingSidecar,
|
|
181
|
+
opts: CeilingVerifyOptions,
|
|
182
|
+
): Promise<CeilingVerifyResult> {
|
|
183
|
+
const checks: CeilingCheck[] = [];
|
|
184
|
+
const fail = (name: string, detail: string): CeilingVerifyResult => {
|
|
185
|
+
checks.push({ name, ok: false, detail });
|
|
186
|
+
return { ok: false, reason: `${name}: ${detail}`, checks, headerCheckedAgainstChain: false };
|
|
187
|
+
};
|
|
188
|
+
const pass = (name: string, detail?: string) => checks.push(detail === undefined ? { name, ok: true } : { name, ok: true, detail });
|
|
189
|
+
|
|
190
|
+
if (sidecar?.version !== CEILING_VERSION) return fail("format", `not a ${CEILING_VERSION} sidecar`);
|
|
191
|
+
|
|
192
|
+
// 0. The proof itself. The leaf covers the signed-body SUBSET (proofHash);
|
|
193
|
+
// the signature covers the rest, so an altered actor/policy fails here.
|
|
194
|
+
if (!opts.proofAlreadyVerified) {
|
|
195
|
+
const v = await verifyProofIntegrity({
|
|
196
|
+
proof,
|
|
197
|
+
context: createVerificationContext(),
|
|
198
|
+
...(opts.trustAnchors ? { trustAnchors: opts.trustAnchors } : {}),
|
|
199
|
+
});
|
|
200
|
+
if (!v.valid) return fail("proof", `the proof does not verify (${v.reason ?? "invalid"})`);
|
|
201
|
+
pass("proof", "signature valid");
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// 1. The record is under the root.
|
|
205
|
+
let proofHash: string;
|
|
206
|
+
try {
|
|
207
|
+
proofHash = computeProofHash(proof);
|
|
208
|
+
} catch (e) {
|
|
209
|
+
return fail("record", `cannot hash the proof (${(e as Error).message})`);
|
|
210
|
+
}
|
|
211
|
+
if (proofHash !== sidecar.proofHash) return fail("record", "this sidecar belongs to a different proof");
|
|
212
|
+
let computedRoot: Uint8Array | null;
|
|
213
|
+
try {
|
|
214
|
+
computedRoot = merkleRootFromPath(
|
|
215
|
+
ceilingLeaf(proofHash),
|
|
216
|
+
sidecar.leafIndex,
|
|
217
|
+
sidecar.leafCount,
|
|
218
|
+
sidecar.merklePath.map(hexToBytes),
|
|
219
|
+
);
|
|
220
|
+
} catch {
|
|
221
|
+
computedRoot = null;
|
|
222
|
+
}
|
|
223
|
+
if (!computedRoot) return fail("merkle", "the path does not fit the leaf index and tree size");
|
|
224
|
+
if (bytesToHex(computedRoot) !== sidecar.root.toLowerCase()) return fail("merkle", "the leaf and path do not reach the root");
|
|
225
|
+
pass("merkle", `leaf ${sidecar.leafIndex} of ${sidecar.leafCount} reaches the root`);
|
|
226
|
+
|
|
227
|
+
if (sidecar.status === "pending" || !sidecar.anchor) {
|
|
228
|
+
return { ok: false, reason: "ceiling pending: no transaction included yet", checks, status: "pending", headerCheckedAgainstChain: false };
|
|
229
|
+
}
|
|
230
|
+
const a = sidecar.anchor;
|
|
231
|
+
|
|
232
|
+
// 2. The payload carries that root.
|
|
233
|
+
let payloadBytes: Uint8Array;
|
|
234
|
+
try {
|
|
235
|
+
payloadBytes = hexToBytes(a.payload);
|
|
236
|
+
const p = decodeCeilingPayload(payloadBytes);
|
|
237
|
+
if (bytesToHex(p.root) !== sidecar.root.toLowerCase()) return fail("payload", "the payload's root is not this sidecar's root");
|
|
238
|
+
pass("payload", `${CEILING_MAGIC}, positions ${p.firstPos}-${p.lastPos}`);
|
|
239
|
+
} catch (e) {
|
|
240
|
+
return fail("payload", (e as Error).message);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// 3. The transaction: signed by the writer, to itself, carrying the payload.
|
|
244
|
+
let rawTx: Uint8Array;
|
|
245
|
+
try {
|
|
246
|
+
rawTx = hexToBytes(a.rawTx);
|
|
247
|
+
const tx = decodeEip1559(rawTx);
|
|
248
|
+
const writer = opts.writerAddress.toLowerCase();
|
|
249
|
+
if (tx.from !== writer) return fail("sender", `the transaction was signed by ${tx.from}, not the declared writer ${writer}`);
|
|
250
|
+
if (tx.to !== writer) return fail("sender", `the transaction is addressed to ${tx.to ?? "a contract creation"}, not to the writer`);
|
|
251
|
+
if (tx.chainId !== BigInt(opts.chainId)) return fail("chain", `the transaction is for chain ${tx.chainId}, expected ${opts.chainId}`);
|
|
252
|
+
if (a.chainId !== opts.chainId) return fail("chain", `the sidecar names chain ${a.chainId}, expected ${opts.chainId}`);
|
|
253
|
+
if (!bytesEqual(tx.data, payloadBytes)) return fail("payload", "the transaction's data is not the payload");
|
|
254
|
+
if (tx.hash !== a.txHash.toLowerCase()) return fail("transaction", "the raw transaction does not hash to txHash");
|
|
255
|
+
pass("sender", `signed by ${tx.from}`);
|
|
256
|
+
} catch (e) {
|
|
257
|
+
return fail("transaction", (e as Error).message);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// 4. The transaction is in the block, and the block is this header.
|
|
261
|
+
let header;
|
|
262
|
+
try {
|
|
263
|
+
header = decodeHeader(hexToBytes(a.blockHeader));
|
|
264
|
+
} catch (e) {
|
|
265
|
+
return fail("header", (e as Error).message);
|
|
266
|
+
}
|
|
267
|
+
if (header.hash !== a.blockHash.toLowerCase()) return fail("header", "the header does not hash to blockHash");
|
|
268
|
+
if (header.number !== a.blockNumber) return fail("header", `the header is block ${header.number}, the sidecar says ${a.blockNumber}`);
|
|
269
|
+
if (header.timestamp !== a.blockTimestamp) return fail("header", `the header's timestamp is ${header.timestamp}, the sidecar says ${a.blockTimestamp}`);
|
|
270
|
+
const inBlock = mptVerify(hexToBytes(header.transactionsRoot), txTrieKey(a.txIndex), a.txInclusionProof.map(hexToBytes));
|
|
271
|
+
if (!inBlock || !bytesEqual(inBlock, rawTx)) return fail("inclusion", "the transaction is not in this block");
|
|
272
|
+
pass("inclusion", `transaction ${a.txIndex} of block ${header.number}`);
|
|
273
|
+
|
|
274
|
+
// 5. The window. The floor is the proof's own signed slotAnchor.
|
|
275
|
+
const slotAnchor = proof.commit.slotAnchor;
|
|
276
|
+
let floor: { blockNumber: number; blockHash: string; blockTimestamp: number | null } | null = null;
|
|
277
|
+
if (slotAnchor) {
|
|
278
|
+
floor = { blockNumber: slotAnchor.blockNumber, blockHash: slotAnchor.blockHash, blockTimestamp: null };
|
|
279
|
+
const w = sidecar.floor;
|
|
280
|
+
if (w && w.blockHeader) {
|
|
281
|
+
try {
|
|
282
|
+
const fh = decodeHeader(hexToBytes(w.blockHeader));
|
|
283
|
+
if (fh.hash === slotAnchor.blockHash.toLowerCase() && fh.number === slotAnchor.blockNumber) {
|
|
284
|
+
floor.blockTimestamp = fh.timestamp;
|
|
285
|
+
pass("floor", `Ethereum block ${fh.number}, header checked against the signed hash`);
|
|
286
|
+
} else {
|
|
287
|
+
checks.push({ name: "floor", ok: false, detail: "the carried floor header does not match the proof's signed slotAnchor; ignored" });
|
|
288
|
+
}
|
|
289
|
+
} catch {
|
|
290
|
+
checks.push({ name: "floor", ok: false, detail: "the carried floor header does not decode; ignored" });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const width = floor?.blockTimestamp != null ? header.timestamp - floor.blockTimestamp : null;
|
|
295
|
+
const status = sidecar.status;
|
|
296
|
+
return {
|
|
297
|
+
ok: true,
|
|
298
|
+
checks,
|
|
299
|
+
status,
|
|
300
|
+
window: {
|
|
301
|
+
floor: floor ?? { blockNumber: 0, blockHash: "", blockTimestamp: null },
|
|
302
|
+
ceiling: { chainId: a.chainId, blockNumber: header.number, blockHash: header.hash, blockTimestamp: header.timestamp },
|
|
303
|
+
widthSeconds: width,
|
|
304
|
+
},
|
|
305
|
+
label: ceilingLabel(status, header.number, header.timestamp),
|
|
306
|
+
headerCheckedAgainstChain: false,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Ask a Base node whether the sidecar's block is on the chain. Returns a
|
|
312
|
+
* finding, never throws. Online is the only way to learn canonicality.
|
|
313
|
+
*
|
|
314
|
+
* The package makes no network calls of its own (the audit's zero-network
|
|
315
|
+
* guarantee covers it), so the caller supplies the one lookup:
|
|
316
|
+
* `getBlockHash(n)` returns the chain's hash at height n, or null.
|
|
317
|
+
*/
|
|
318
|
+
export async function checkCeilingOnline(
|
|
319
|
+
sidecar: CeilingSidecar,
|
|
320
|
+
getBlockHash: (blockNumber: number) => Promise<string | null>,
|
|
321
|
+
): Promise<{ onChain: boolean | null; detail: string }> {
|
|
322
|
+
if (!sidecar.anchor) return { onChain: null, detail: "no anchor to check" };
|
|
323
|
+
try {
|
|
324
|
+
const hash = (await getBlockHash(sidecar.anchor.blockNumber))?.toLowerCase();
|
|
325
|
+
if (!hash) return { onChain: null, detail: "the RPC did not return that block" };
|
|
326
|
+
if (hash === sidecar.anchor.blockHash.toLowerCase()) return { onChain: true, detail: `block ${sidecar.anchor.blockNumber} matches the chain` };
|
|
327
|
+
return { onChain: false, detail: `the chain's block ${sidecar.anchor.blockNumber} is ${hash}, not this header` };
|
|
328
|
+
} catch (e) {
|
|
329
|
+
return { onChain: null, detail: `header not checked against chain (${(e as Error).message})` };
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export { keccak256 as ceilingKeccak256 };
|
package/src/index.ts
CHANGED
|
@@ -102,3 +102,15 @@ export type {
|
|
|
102
102
|
} from "./carrier.js";
|
|
103
103
|
export { verifyCarrier } from "./carrier-verify.js";
|
|
104
104
|
export type { CarrierVerifyResult } from "./carrier-verify.js";
|
|
105
|
+
|
|
106
|
+
// Ceiling in time on Base (bitgraph-ceiling/1): a sidecar beside the proof, never inside it.
|
|
107
|
+
export {
|
|
108
|
+
CEILING_VERSION, CEILING_MAGIC, CEILING_PAYLOAD_BYTES,
|
|
109
|
+
encodeCeilingPayload, decodeCeilingPayload, ceilingPayloadHash, ceilingLeaf, ceilingLabel,
|
|
110
|
+
verifyCeiling, checkCeilingOnline,
|
|
111
|
+
} from "./ceiling.js";
|
|
112
|
+
export type { CeilingSidecar, CeilingStatus, CeilingPayload, CeilingCheck, CeilingVerifyResult, CeilingVerifyOptions } from "./ceiling.js";
|
|
113
|
+
export { rlpEncode, rlpDecode, decodeHeader, decodeEip1559, mptVerify, txTrieKey, keccak256,
|
|
114
|
+
hexToBytes as evmHexToBytes, bytesToHex as evmBytesToHex } from "./ceiling-evm.js";
|
|
115
|
+
export { txTrieProof } from "./ceiling-trie.js";
|
|
116
|
+
export type { RlpItem, DecodedHeader, DecodedTx } from "./ceiling-evm.js";
|