@ekwo-ai/core 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 (48) hide show
  1. package/README.md +5 -0
  2. package/dist/books/document-pdf.d.ts +87 -0
  3. package/dist/books/document-pdf.d.ts.map +1 -0
  4. package/dist/books/document-pdf.js +222 -0
  5. package/dist/books/document-pdf.js.map +1 -0
  6. package/dist/books/index.d.ts +1 -0
  7. package/dist/books/index.d.ts.map +1 -1
  8. package/dist/books/index.js +1 -0
  9. package/dist/books/index.js.map +1 -1
  10. package/dist/einvoicing/directory.d.ts +38 -0
  11. package/dist/einvoicing/directory.d.ts.map +1 -0
  12. package/dist/einvoicing/directory.js +121 -0
  13. package/dist/einvoicing/directory.js.map +1 -0
  14. package/dist/einvoicing/formats.d.ts +65 -0
  15. package/dist/einvoicing/formats.d.ts.map +1 -0
  16. package/dist/einvoicing/formats.js +380 -0
  17. package/dist/einvoicing/formats.js.map +1 -0
  18. package/dist/einvoicing/index.d.ts +11 -0
  19. package/dist/einvoicing/index.d.ts.map +1 -0
  20. package/dist/einvoicing/index.js +11 -0
  21. package/dist/einvoicing/index.js.map +1 -0
  22. package/dist/einvoicing/issue.d.ts +98 -0
  23. package/dist/einvoicing/issue.d.ts.map +1 -0
  24. package/dist/einvoicing/issue.js +398 -0
  25. package/dist/einvoicing/issue.js.map +1 -0
  26. package/dist/einvoicing/transport.d.ts +130 -0
  27. package/dist/einvoicing/transport.d.ts.map +1 -0
  28. package/dist/einvoicing/transport.js +60 -0
  29. package/dist/einvoicing/transport.js.map +1 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +2 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/proofs/filing-proofs.d.ts +93 -0
  35. package/dist/proofs/filing-proofs.d.ts.map +1 -0
  36. package/dist/proofs/filing-proofs.js +161 -0
  37. package/dist/proofs/filing-proofs.js.map +1 -0
  38. package/dist/proofs/index.d.ts +7 -0
  39. package/dist/proofs/index.d.ts.map +1 -0
  40. package/dist/proofs/index.js +7 -0
  41. package/dist/proofs/index.js.map +1 -0
  42. package/dist/proofs/opentimestamps.d.ts +185 -0
  43. package/dist/proofs/opentimestamps.d.ts.map +1 -0
  44. package/dist/proofs/opentimestamps.js +508 -0
  45. package/dist/proofs/opentimestamps.js.map +1 -0
  46. package/dist/schema.d.ts +1 -1
  47. package/dist/schema.js +1 -1
  48. package/package.json +14 -11
@@ -0,0 +1,508 @@
1
+ /**
2
+ * OpenTimestamps: the detached proof file (`.ots`), the public calendars that
3
+ * aggregate hashes into Bitcoin transactions, and the block a proof ends in.
4
+ *
5
+ * Written against the format as the reference implementation serialises it
6
+ * (python-opentimestamps, `core/timestamp.py`, `core/op.py`,
7
+ * `core/notary.py`) rather than through a library: the published JavaScript
8
+ * client carries a Bitcoin library and a dozen transitive dependencies to do
9
+ * what a few hundred lines do here, and none of them is needed to stamp, to
10
+ * upgrade, or to read which block a proof is anchored in.
11
+ *
12
+ * Three acts, and the network is only ever reached through the `fetch` the
13
+ * caller hands in:
14
+ *
15
+ * stampDigest() a sha256 goes to the calendars; a pending proof comes back
16
+ * upgradeProof() the calendars are asked again; a Bitcoin anchor, eventually
17
+ * bitcoinBlockAt() a block explorer gives the time of the anchoring block,
18
+ * and its merkle root is checked against the proof
19
+ *
20
+ * Only the 32 bytes of the hash leave, and a random nonce is appended before
21
+ * they do, so a calendar does not even learn the hash of the file.
22
+ */
23
+ import { createHash, randomBytes } from 'node:crypto';
24
+ // ---------------------------------------------------------------------------
25
+ // The format
26
+ // ---------------------------------------------------------------------------
27
+ /** The 31 bytes every detached proof file starts with. */
28
+ export const OTS_MAGIC = Uint8Array.from([
29
+ 0x00, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x00, 0x00, 0x50,
30
+ 0x72, 0x6f, 0x6f, 0x66, 0x00, 0xbf, 0x89, 0xe2, 0xe8, 0x84, 0xe8, 0x92, 0x94,
31
+ ]);
32
+ const OTS_VERSION = 1;
33
+ const OP_SHA1 = 0x02;
34
+ const OP_RIPEMD160 = 0x03;
35
+ const OP_SHA256 = 0x08;
36
+ const OP_KECCAK256 = 0x67;
37
+ const OP_APPEND = 0xf0;
38
+ const OP_PREPEND = 0xf1;
39
+ const OP_REVERSE = 0xf2;
40
+ const OP_HEXLIFY = 0xf3;
41
+ const TAG_PENDING = Uint8Array.from([0x83, 0xdf, 0xe3, 0x0d, 0x2e, 0xf9, 0x0c, 0x8e]);
42
+ const TAG_BITCOIN = Uint8Array.from([0x05, 0x88, 0x96, 0x0d, 0x73, 0xd7, 0x19, 0x01]);
43
+ const MAX_MESSAGE = 4096;
44
+ const MAX_PAYLOAD = 8192;
45
+ const MAX_URI = 1000;
46
+ const MAX_DEPTH = 256;
47
+ /** Something the bytes or the network said that a proof cannot be built on. */
48
+ export class OtsError extends Error {
49
+ name = 'OtsError';
50
+ code;
51
+ constructor(code, message) {
52
+ super(`${code}: ${message}`);
53
+ this.code = code;
54
+ }
55
+ }
56
+ export const toHex = (bytes) => Buffer.from(bytes).toString('hex');
57
+ export function fromHex(hex) {
58
+ if (!/^(?:[0-9a-fA-F]{2})*$/.test(hex))
59
+ throw new OtsError('bad_hex', `"${hex.slice(0, 80)}" is not hexadecimal`);
60
+ return Uint8Array.from(Buffer.from(hex, 'hex'));
61
+ }
62
+ export function sha256(bytes) {
63
+ return Uint8Array.from(createHash('sha256').update(bytes).digest());
64
+ }
65
+ function concat(...parts) {
66
+ const out = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));
67
+ let at = 0;
68
+ for (const part of parts) {
69
+ out.set(part, at);
70
+ at += part.length;
71
+ }
72
+ return out;
73
+ }
74
+ function equal(a, b) {
75
+ return a.length === b.length && a.every((byte, i) => byte === b[i]);
76
+ }
77
+ function compare(a, b) {
78
+ for (let i = 0; i < Math.min(a.length, b.length); i++) {
79
+ if (a[i] !== b[i])
80
+ return a[i] - b[i];
81
+ }
82
+ return a.length - b.length;
83
+ }
84
+ /** What an operation makes of a message. */
85
+ export function applyOp(op, msg) {
86
+ let out;
87
+ switch (op.tag) {
88
+ case OP_SHA256:
89
+ out = sha256(msg);
90
+ break;
91
+ case OP_SHA1:
92
+ out = Uint8Array.from(createHash('sha1').update(msg).digest());
93
+ break;
94
+ case OP_RIPEMD160:
95
+ out = Uint8Array.from(createHash('ripemd160').update(msg).digest());
96
+ break;
97
+ case OP_APPEND:
98
+ out = concat(msg, op.arg);
99
+ break;
100
+ case OP_PREPEND:
101
+ out = concat(op.arg, msg);
102
+ break;
103
+ case OP_REVERSE:
104
+ out = Uint8Array.from(msg).reverse();
105
+ break;
106
+ case OP_HEXLIFY:
107
+ out = new TextEncoder().encode(toHex(msg));
108
+ break;
109
+ }
110
+ if (out.length > MAX_MESSAGE)
111
+ throw new OtsError('ots_message_too_long', `an operation produced ${out.length} bytes`);
112
+ return out;
113
+ }
114
+ class Reader {
115
+ bytes;
116
+ at = 0;
117
+ constructor(bytes) {
118
+ this.bytes = bytes;
119
+ }
120
+ byte() {
121
+ const value = this.bytes[this.at];
122
+ if (value === undefined)
123
+ throw new OtsError('ots_truncated', 'the proof ends in the middle of an item');
124
+ this.at++;
125
+ return value;
126
+ }
127
+ take(length) {
128
+ if (this.at + length > this.bytes.length)
129
+ throw new OtsError('ots_truncated', 'the proof ends in the middle of an item');
130
+ const out = this.bytes.slice(this.at, this.at + length);
131
+ this.at += length;
132
+ return out;
133
+ }
134
+ varuint() {
135
+ let value = 0;
136
+ let shift = 0;
137
+ for (;;) {
138
+ const byte = this.byte();
139
+ value += (byte & 0x7f) * 2 ** shift;
140
+ if ((byte & 0x80) === 0)
141
+ break;
142
+ shift += 7;
143
+ if (shift > 49)
144
+ throw new OtsError('ots_bad_integer', 'an integer of the proof does not fit');
145
+ }
146
+ return value;
147
+ }
148
+ varbytes(max) {
149
+ const length = this.varuint();
150
+ if (length > max)
151
+ throw new OtsError('ots_item_too_long', `an item of ${length} bytes, over ${max}`);
152
+ return this.take(length);
153
+ }
154
+ done() {
155
+ return this.at === this.bytes.length;
156
+ }
157
+ }
158
+ class Writer {
159
+ parts = [];
160
+ bytes(value) {
161
+ this.parts.push(value);
162
+ }
163
+ byte(value) {
164
+ this.parts.push(Uint8Array.of(value));
165
+ }
166
+ varuint(value) {
167
+ const out = [];
168
+ let rest = value;
169
+ do {
170
+ let byte = rest % 128;
171
+ rest = Math.floor(rest / 128);
172
+ if (rest > 0)
173
+ byte |= 0x80;
174
+ out.push(byte);
175
+ } while (rest > 0);
176
+ this.parts.push(Uint8Array.from(out));
177
+ }
178
+ varbytes(value) {
179
+ this.varuint(value.length);
180
+ this.bytes(value);
181
+ }
182
+ result() {
183
+ return concat(...this.parts);
184
+ }
185
+ }
186
+ function readOp(reader, tag) {
187
+ switch (tag) {
188
+ case OP_SHA1:
189
+ case OP_RIPEMD160:
190
+ case OP_SHA256:
191
+ case OP_REVERSE:
192
+ case OP_HEXLIFY:
193
+ return { tag };
194
+ case OP_APPEND:
195
+ case OP_PREPEND:
196
+ return { tag, arg: reader.varbytes(MAX_MESSAGE) };
197
+ case OP_KECCAK256:
198
+ throw new OtsError('ots_unsupported_operation', 'keccak256 is not read by this implementation');
199
+ default:
200
+ throw new OtsError('ots_unknown_operation', `operation 0x${tag.toString(16)} is not part of the format`);
201
+ }
202
+ }
203
+ function writeOp(writer, op) {
204
+ writer.byte(op.tag);
205
+ if (op.tag === OP_APPEND || op.tag === OP_PREPEND)
206
+ writer.varbytes(op.arg);
207
+ }
208
+ function opBytes(op) {
209
+ const writer = new Writer();
210
+ writeOp(writer, op);
211
+ return writer.result();
212
+ }
213
+ function readAttestation(reader) {
214
+ const tag = reader.take(8);
215
+ const payload = reader.varbytes(MAX_PAYLOAD);
216
+ const inner = new Reader(payload);
217
+ if (equal(tag, TAG_PENDING)) {
218
+ const uri = new TextDecoder('utf-8', { fatal: true }).decode(inner.varbytes(MAX_URI));
219
+ if (!/^[A-Za-z0-9.:/_-]+$/.test(uri))
220
+ throw new OtsError('ots_bad_calendar', `"${uri}" is not a calendar address`);
221
+ return { kind: 'pending', uri };
222
+ }
223
+ if (equal(tag, TAG_BITCOIN))
224
+ return { kind: 'bitcoin', height: inner.varuint() };
225
+ return { kind: 'unknown', tag, payload };
226
+ }
227
+ function attestationBytes(attestation) {
228
+ const writer = new Writer();
229
+ const payload = new Writer();
230
+ switch (attestation.kind) {
231
+ case 'pending':
232
+ writer.bytes(TAG_PENDING);
233
+ payload.varbytes(new TextEncoder().encode(attestation.uri));
234
+ break;
235
+ case 'bitcoin':
236
+ writer.bytes(TAG_BITCOIN);
237
+ payload.varuint(attestation.height);
238
+ break;
239
+ case 'unknown':
240
+ writer.bytes(attestation.tag);
241
+ payload.bytes(attestation.payload);
242
+ break;
243
+ }
244
+ writer.varbytes(payload.result());
245
+ return writer.result();
246
+ }
247
+ /** Reads a timestamp whose starting message is `msg`, as a calendar returns one. */
248
+ export function readTimestamp(bytes, msg) {
249
+ const input = new Reader(bytes);
250
+ const stamp = readTimestampFrom(input, msg, 0);
251
+ if (!input.done())
252
+ throw new OtsError('ots_trailing_bytes', 'bytes follow the end of the timestamp');
253
+ return stamp;
254
+ }
255
+ function readTimestampFrom(input, msg, depth) {
256
+ if (depth > MAX_DEPTH)
257
+ throw new OtsError('ots_too_deep', 'the proof nests deeper than any calendar writes');
258
+ const stamp = { msg, attestations: [], ops: [] };
259
+ const item = (tag) => {
260
+ if (tag === 0x00) {
261
+ stamp.attestations.push(readAttestation(input));
262
+ }
263
+ else {
264
+ const op = readOp(input, tag);
265
+ stamp.ops.push({ op, stamp: readTimestampFrom(input, applyOp(op, msg), depth + 1) });
266
+ }
267
+ };
268
+ let tag = input.byte();
269
+ while (tag === 0xff) {
270
+ item(input.byte());
271
+ tag = input.byte();
272
+ }
273
+ item(tag);
274
+ return stamp;
275
+ }
276
+ /** Writes a timestamp: every item but the last is preceded by 0xff. */
277
+ export function writeTimestamp(stamp) {
278
+ const writer = new Writer();
279
+ writeTimestampTo(stamp, writer);
280
+ return writer.result();
281
+ }
282
+ function writeTimestampTo(stamp, writer) {
283
+ const attestations = stamp.attestations.map(attestationBytes).sort(compare);
284
+ const ops = [...stamp.ops].sort((a, b) => compare(opBytes(a.op), opBytes(b.op)));
285
+ if (attestations.length === 0 && ops.length === 0) {
286
+ throw new OtsError('ots_empty_timestamp', 'a timestamp attests nothing and leads nowhere');
287
+ }
288
+ const items = attestations.length + ops.length;
289
+ let written = 0;
290
+ for (const attestation of attestations) {
291
+ if (++written < items)
292
+ writer.byte(0xff);
293
+ writer.byte(0x00);
294
+ writer.bytes(attestation);
295
+ }
296
+ for (const { op, stamp: next } of ops) {
297
+ if (++written < items)
298
+ writer.byte(0xff);
299
+ writeOp(writer, op);
300
+ writeTimestampTo(next, writer);
301
+ }
302
+ }
303
+ /** Reads a whole `.ots` file. */
304
+ export function readOts(bytes) {
305
+ const reader = new Reader(bytes);
306
+ if (!equal(reader.take(OTS_MAGIC.length), OTS_MAGIC)) {
307
+ throw new OtsError('ots_not_a_proof', 'the file does not start like an OpenTimestamps proof');
308
+ }
309
+ const version = reader.varuint();
310
+ if (version !== OTS_VERSION)
311
+ throw new OtsError('ots_unknown_version', `version ${version} of the format`);
312
+ const hashOp = reader.byte();
313
+ if (hashOp !== OP_SHA256) {
314
+ throw new OtsError('ots_unsupported_file_hash', `the file is hashed with operation 0x${hashOp.toString(16)}, and only sha256 is read`);
315
+ }
316
+ const digest = reader.take(32);
317
+ const timestamp = readTimestampFrom(reader, digest, 0);
318
+ if (!reader.done())
319
+ throw new OtsError('ots_trailing_bytes', 'bytes follow the end of the proof');
320
+ return { digest, timestamp };
321
+ }
322
+ /** Writes a whole `.ots` file. */
323
+ export function writeOts(proof) {
324
+ const writer = new Writer();
325
+ writer.bytes(OTS_MAGIC);
326
+ writer.varuint(OTS_VERSION);
327
+ writer.byte(OP_SHA256);
328
+ writer.bytes(proof.digest);
329
+ writeTimestampTo(proof.timestamp, writer);
330
+ return writer.result();
331
+ }
332
+ /** Every attestation of a timestamp, with the message it attests and the node it sits on. */
333
+ export function attestationsOf(stamp) {
334
+ const out = [];
335
+ const walk = (node) => {
336
+ for (const attestation of node.attestations)
337
+ out.push({ msg: node.msg, attestation, node });
338
+ for (const { stamp } of node.ops)
339
+ walk(stamp);
340
+ };
341
+ walk(stamp);
342
+ return out;
343
+ }
344
+ /** Adds what `other` knows about the same message to `target`. */
345
+ export function mergeTimestamp(target, other) {
346
+ if (!equal(target.msg, other.msg))
347
+ throw new OtsError('ots_merge_mismatch', 'two timestamps of different messages');
348
+ for (const attestation of other.attestations) {
349
+ const bytes = attestationBytes(attestation);
350
+ if (!target.attestations.some((a) => equal(attestationBytes(a), bytes)))
351
+ target.attestations.push(attestation);
352
+ }
353
+ for (const { op, stamp } of other.ops) {
354
+ const bytes = opBytes(op);
355
+ const same = target.ops.find((o) => equal(opBytes(o.op), bytes));
356
+ if (same === undefined)
357
+ target.ops.push({ op, stamp });
358
+ else
359
+ mergeTimestamp(same.stamp, stamp);
360
+ }
361
+ }
362
+ /** The Bitcoin anchors of a proof: the block height, and the merkle root the proof arrives at. */
363
+ export function bitcoinAnchors(stamp) {
364
+ return attestationsOf(stamp)
365
+ .filter((a) => a.attestation.kind === 'bitcoin')
366
+ .map((a) => ({ height: a.attestation.height, merkleRoot: a.msg }))
367
+ .sort((a, b) => a.height - b.height);
368
+ }
369
+ /** The calendars a proof still waits on. */
370
+ export function pendingCalendars(stamp) {
371
+ return [
372
+ ...new Set(attestationsOf(stamp)
373
+ .filter((a) => a.attestation.kind === 'pending')
374
+ .map((a) => a.attestation.uri)),
375
+ ];
376
+ }
377
+ /**
378
+ * The public calendars the reference client submits to by default. Four
379
+ * operators, so that a proof does not depend on one of them staying up: a
380
+ * hash is submitted to all of them and the proof keeps every answer.
381
+ */
382
+ export const DEFAULT_CALENDARS = [
383
+ 'https://a.pool.opentimestamps.org',
384
+ 'https://b.pool.opentimestamps.org',
385
+ 'https://a.pool.eternitywall.com',
386
+ 'https://ots.btc.catallaxy.com',
387
+ ];
388
+ /**
389
+ * The calendars the aggregators above hand a proof over to, which are the
390
+ * ones a pending proof names and an upgrade asks. A proof is bytes somebody
391
+ * handed over, so an upgrade dials only calendars it was told to trust; these
392
+ * four by default, as in the reference client.
393
+ */
394
+ export const DEFAULT_UPGRADE_CALENDARS = [
395
+ 'https://alice.btc.calendar.opentimestamps.org',
396
+ 'https://bob.btc.calendar.opentimestamps.org',
397
+ 'https://finney.calendar.eternitywall.com',
398
+ 'https://btc.calendar.catallaxy.com',
399
+ ];
400
+ /** An Esplora block explorer API, which several public explorers serve. */
401
+ export const DEFAULT_BITCOIN_EXPLORER = 'https://blockstream.info/api';
402
+ const HEADERS = { Accept: 'application/vnd.opentimestamps.v1', 'User-Agent': 'ekwo-opentimestamps' };
403
+ function calendarUrl(calendar) {
404
+ if (!/^https?:\/\/[^\s]+$/.test(calendar))
405
+ throw new OtsError('ots_bad_calendar', `"${calendar}" is not an http(s) address`);
406
+ return calendar.replace(/\/+$/, '');
407
+ }
408
+ /** Submits the sha256 of a file to the calendars, and returns the pending proof. */
409
+ export async function stampDigest(digest, options) {
410
+ if (digest.length !== 32)
411
+ throw new OtsError('bad_sha256', `a sha256 is 32 bytes, got ${digest.length}`);
412
+ const calendars = (options.calendars ?? DEFAULT_CALENDARS).map(calendarUrl);
413
+ if (calendars.length === 0)
414
+ throw new OtsError('ots_no_calendar', 'no calendar to submit to');
415
+ const minimum = options.minimum ?? Math.min(2, calendars.length);
416
+ const nonce = options.nonce ?? Uint8Array.from(randomBytes(16));
417
+ const append = { tag: OP_APPEND, arg: nonce };
418
+ const appended = applyOp(append, digest);
419
+ const commitment = applyOp({ tag: OP_SHA256 }, appended);
420
+ const root = { msg: commitment, attestations: [], ops: [] };
421
+ const answered = [];
422
+ const failures = [];
423
+ await Promise.all(calendars.map(async (calendar) => {
424
+ try {
425
+ const response = await options.fetch(`${calendar}/digest`, {
426
+ method: 'POST',
427
+ headers: { ...HEADERS, 'Content-Type': 'application/x-www-form-urlencoded' },
428
+ body: commitment,
429
+ });
430
+ if (!response.ok)
431
+ throw new Error(`answered ${response.status}`);
432
+ const stamp = readTimestamp(new Uint8Array(await response.arrayBuffer()), commitment);
433
+ mergeTimestamp(root, stamp);
434
+ answered.push(calendar);
435
+ }
436
+ catch (error) {
437
+ failures.push({ calendar, reason: error.message });
438
+ }
439
+ }));
440
+ if (answered.length < minimum) {
441
+ throw new OtsError('ots_calendars_unreachable', `${answered.length} of ${calendars.length} calendars answered, ${minimum} needed: ${failures.map((f) => `${f.calendar} ${f.reason}`).join('; ')}`);
442
+ }
443
+ const timestamp = {
444
+ msg: digest,
445
+ attestations: [],
446
+ ops: [{ op: append, stamp: { msg: appended, attestations: [], ops: [{ op: { tag: OP_SHA256 }, stamp: root }] } }],
447
+ };
448
+ return { ots: writeOts({ digest, timestamp }), calendars: answered.sort(), failures };
449
+ }
450
+ /** Asks each calendar a proof waits on whether its commitment is in a block yet. */
451
+ export async function upgradeProof(ots, options) {
452
+ const proof = readOts(ots);
453
+ const allowed = new Set((options.calendars ?? DEFAULT_UPGRADE_CALENDARS).map(calendarUrl));
454
+ let changed = false;
455
+ for (const { msg, attestation, node } of attestationsOf(proof.timestamp)) {
456
+ if (attestation.kind !== 'pending')
457
+ continue;
458
+ const calendar = calendarUrl(attestation.uri);
459
+ if (!allowed.has(calendar))
460
+ continue;
461
+ const response = await options.fetch(`${calendar}/timestamp/${toHex(msg)}`, { headers: HEADERS });
462
+ // Not yet: the calendar has not committed this round to a block.
463
+ if (response.status === 404)
464
+ continue;
465
+ if (!response.ok)
466
+ throw new OtsError('ots_calendar_error', `${calendar} answered ${response.status}`);
467
+ const before = toHex(writeTimestamp(node));
468
+ mergeTimestamp(node, readTimestamp(new Uint8Array(await response.arrayBuffer()), msg));
469
+ if (toHex(writeTimestamp(node)) !== before)
470
+ changed = true;
471
+ }
472
+ const anchors = bitcoinAnchors(proof.timestamp);
473
+ return {
474
+ ots: changed ? writeOts(proof) : ots,
475
+ changed,
476
+ bitcoin: anchors[0],
477
+ pending: pendingCalendars(proof.timestamp),
478
+ };
479
+ }
480
+ /**
481
+ * The block at a height, read from an Esplora explorer, with its merkle root
482
+ * checked against the one the proof arrives at. A proof whose path does not
483
+ * end in the merkle root of that block is not a proof of anything, and is
484
+ * refused rather than dated.
485
+ */
486
+ export async function bitcoinBlockAt(height, merkleRoot, options) {
487
+ const explorer = (options.explorer ?? DEFAULT_BITCOIN_EXPLORER).replace(/\/+$/, '');
488
+ const hashResponse = await options.fetch(`${explorer}/block-height/${height}`);
489
+ if (!hashResponse.ok)
490
+ throw new OtsError('ots_block_unknown', `${explorer} knows no block at height ${height}`);
491
+ const hash = (await hashResponse.text()).trim();
492
+ if (!/^[0-9a-f]{64}$/.test(hash))
493
+ throw new OtsError('ots_block_unknown', `${explorer} answered "${hash.slice(0, 80)}" for height ${height}`);
494
+ const blockResponse = await options.fetch(`${explorer}/block/${hash}`);
495
+ if (!blockResponse.ok)
496
+ throw new OtsError('ots_block_unknown', `${explorer} answered ${blockResponse.status} for block ${hash}`);
497
+ const block = JSON.parse(await blockResponse.text());
498
+ // Explorers print the merkle root in reverse byte order; the proof arrives
499
+ // at it in the order the header stores it.
500
+ const expected = toHex(Uint8Array.from(merkleRoot).reverse());
501
+ if (block.merkle_root !== expected) {
502
+ throw new OtsError('ots_anchor_mismatch', `the proof arrives at merkle root ${expected}, and block ${height} has ${String(block.merkle_root)}`);
503
+ }
504
+ if (typeof block.timestamp !== 'number')
505
+ throw new OtsError('ots_block_unknown', `block ${hash} has no time`);
506
+ return { height, hash, time: new Date(block.timestamp * 1000).toISOString() };
507
+ }
508
+ //# sourceMappingURL=opentimestamps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opentimestamps.js","sourceRoot":"","sources":["../../src/proofs/opentimestamps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAA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AI,CAAC,KAAK,CAAC,MAAM,aAAa,CAAC,IAAI,EAAE,CAAiD,CAAC;IACrG,2EAA2E;IAC3E,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,IAAI,QAAQ,CAChB,qBAAqB,EACrB,oCAAoC,QAAQ,eAAe,MAAM,QAAQ,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CACrG,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ;QAAE,MAAM,IAAI,QAAQ,CAAC,mBAAmB,EAAE,SAAS,IAAI,cAAc,CAAC,CAAC;IAC9G,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;AAChF,CAAC"}
package/dist/schema.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  * is not a script, it is a restore.
16
16
  */
17
17
  /** The oldest schema `@ekwo-ai/core` reads. */
18
- export declare const SCHEMA_MIN = "0.11.0";
18
+ export declare const SCHEMA_MIN = "0.12.0";
19
19
  /** `-1`, `0` or `1`, comparing two `major.minor.patch` versions numerically. */
20
20
  export declare function compareSchemaVersions(left: string, right: string): number;
21
21
  /** Whether a database at `installed` is new enough for a package needing `minimum`. */
package/dist/schema.js CHANGED
@@ -15,7 +15,7 @@
15
15
  * is not a script, it is a restore.
16
16
  */
17
17
  /** The oldest schema `@ekwo-ai/core` reads. */
18
- export const SCHEMA_MIN = '0.11.0';
18
+ export const SCHEMA_MIN = '0.12.0';
19
19
  /** `-1`, `0` or `1`, comparing two `major.minor.patch` versions numerically. */
20
20
  export function compareSchemaVersions(left, right) {
21
21
  const parse = (version) => version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekwo-ai/core",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "TypeScript row types and a typed Supabase client for the Ekwo OS accounting schema.",
5
5
  "keywords": [
6
6
  "accounting",
@@ -28,7 +28,7 @@
28
28
  "node": ">=20"
29
29
  },
30
30
  "ekwo": {
31
- "schemaMin": "0.11.0"
31
+ "schemaMin": "0.12.0"
32
32
  },
33
33
  "files": [
34
34
  "dist",
@@ -48,15 +48,18 @@
48
48
  "typecheck": "tsc -p tsconfig.json --noEmit"
49
49
  },
50
50
  "dependencies": {
51
- "@ekwo-ai/camt053": "^0.11.1",
52
- "@ekwo-ai/cfonb120": "^0.11.1",
53
- "@ekwo-ai/coda": "^0.11.1",
54
- "@ekwo-ai/fec": "^0.11.1",
55
- "@ekwo-ai/journal-items": "^0.11.1",
56
- "@ekwo-ai/journal-report": "^0.11.1",
57
- "@ekwo-ai/trial-balance": "^0.11.1",
58
- "@ekwo-ai/transaction-journal": "^0.11.1",
59
- "@ekwo-ai/xaf": "^0.11.1"
51
+ "@ekwo-ai/camt053": "^0.12.0",
52
+ "@ekwo-ai/cfonb120": "^0.12.0",
53
+ "@ekwo-ai/coda": "^0.12.0",
54
+ "@ekwo-ai/factur-x": "^0.12.0",
55
+ "@ekwo-ai/fec": "^0.12.0",
56
+ "@ekwo-ai/invoice-pdf": "^0.12.0",
57
+ "@ekwo-ai/journal-items": "^0.12.0",
58
+ "@ekwo-ai/journal-report": "^0.12.0",
59
+ "@ekwo-ai/peppol-ubl": "^0.12.0",
60
+ "@ekwo-ai/trial-balance": "^0.12.0",
61
+ "@ekwo-ai/transaction-journal": "^0.12.0",
62
+ "@ekwo-ai/xaf": "^0.12.0"
60
63
  },
61
64
  "peerDependencies": {
62
65
  "@supabase/supabase-js": "^2.0.0"