@pinionengineering/prover-client 0.10.0 → 0.11.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 +131 -54
- package/dist/client.d.ts +115 -57
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +167 -71
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +21 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @pinionengineering/prover-client
|
|
2
2
|
|
|
3
3
|
JavaScript / TypeScript client for **pinion-prover** storage-proof service.
|
|
4
4
|
|
|
@@ -9,22 +9,46 @@ Implements the SW-Pub challenger role:
|
|
|
9
9
|
- Sends challenges to the prover and receives proofs
|
|
10
10
|
- **Cryptographically verifies proofs** using BN254 Ate pairings
|
|
11
11
|
|
|
12
|
-
Most IPFS pinning clients trust HTTP 200 as proof of storage
|
|
12
|
+
Most IPFS pinning clients trust HTTP 200 as proof of storage, but a server
|
|
13
13
|
can return 200 without actually holding your data. This library closes that gap:
|
|
14
14
|
the server must solve a cryptographic challenge that is **only solvable by a party
|
|
15
15
|
who has the block data**, and you verify the answer with a BN254 pairing equation
|
|
16
16
|
in your browser or Node.js process.
|
|
17
17
|
|
|
18
|
+
Don't want to write JS? [The Go client in this same repo](../go#readme) documents a
|
|
19
|
+
no-code path: export a key + roots file from the
|
|
20
|
+
[dashboard](https://pinion.build), then run the same audit loop with the
|
|
21
|
+
`testclient` CLI. `testclient import` followed by `testclient audit --all --loop`
|
|
22
|
+
is the whole workflow, no account needed for the audit itself.
|
|
23
|
+
|
|
18
24
|
---
|
|
19
25
|
|
|
20
26
|
## Installation
|
|
21
27
|
|
|
22
28
|
```bash
|
|
23
|
-
npm install @
|
|
29
|
+
npm install @pinionengineering/prover-client
|
|
24
30
|
```
|
|
25
31
|
|
|
26
32
|
Requires Node.js ≥ 18. Works in modern browsers with native `crypto.getRandomValues` and `atob`.
|
|
27
33
|
|
|
34
|
+
### Upgrading from 0.10.x
|
|
35
|
+
|
|
36
|
+
`tag()` and `prove()` are now **submit-only**: they return a job handle
|
|
37
|
+
immediately (`{ jobId, ... }`) instead of blocking until the job finishes.
|
|
38
|
+
Await the new `waitForTag(jobId, options?)` / `waitForProve(jobId, options?)`
|
|
39
|
+
to wait for a terminal state, or poll `tagStatus(jobId)`/`proveStatus(jobId)`
|
|
40
|
+
yourself. There is **no default deadline anymore** — the old hardcoded 60s
|
|
41
|
+
(`prove`)/10min (`tag`) timeouts are gone, since a proof or tag job can
|
|
42
|
+
legitimately take longer and the server was never designed to respect an
|
|
43
|
+
arbitrary client-side ceiling. If you want the old ceiling back, it's a
|
|
44
|
+
strict superset away: pass `signal: AbortSignal.timeout(ms)` to
|
|
45
|
+
`waitForProve()`/`waitForTag()`/`audit()`.
|
|
46
|
+
|
|
47
|
+
`audit(keyId, setup)` is unchanged in shape — still one call that submits,
|
|
48
|
+
waits, and verifies — but now also accepts `pollIntervalMs`/`signal`/
|
|
49
|
+
`onStatus` so you can build progress UI or cancel a long-running round; see
|
|
50
|
+
its section below.
|
|
51
|
+
|
|
28
52
|
---
|
|
29
53
|
|
|
30
54
|
## How It Works
|
|
@@ -35,14 +59,17 @@ The protocol has two distinct phases:
|
|
|
35
59
|
|
|
36
60
|
1. Call `createKey()`. The server generates a BN254 key pair and stores the private
|
|
37
61
|
scalar α. You receive:
|
|
38
|
-
- `keyId
|
|
39
|
-
- `publicKey
|
|
62
|
+
- `keyId`: identifier for this key on the server
|
|
63
|
+
- `publicKey`: the public half: `V = α·G₂` (G2 point) and `U[0..s-1]` (G1 points).
|
|
40
64
|
These are the values needed to verify proofs; store them if you want to verify
|
|
41
65
|
independently of the server later.
|
|
42
66
|
|
|
43
|
-
2. Call `tag(cid, keyId)` for each pinned CID
|
|
44
|
-
|
|
45
|
-
|
|
67
|
+
2. Call `tag(cid, keyId)` for each pinned CID, then `waitForTag(jobId)`.
|
|
68
|
+
Tagging is asynchronous — `tag()` submits the job and returns a job
|
|
69
|
+
handle immediately; the server walks the IPFS DAG, computes per-block
|
|
70
|
+
authentication tags, and stores them in the background. `waitForTag()`
|
|
71
|
+
polls until it's done and returns the **block IDs** for that root: the
|
|
72
|
+
`CID.Bytes()` of every block in the DAG, in TagList order.
|
|
46
73
|
|
|
47
74
|
3. Call `getSetup(keyId)` to fetch the full setup document. The response contains:
|
|
48
75
|
- The public key (same as returned by `createKey()`)
|
|
@@ -57,7 +84,7 @@ Each audit round is independent and stateless with respect to prior rounds:
|
|
|
57
84
|
|
|
58
85
|
1. Generate a random 32-byte seed and select `n` blocks to challenge. Both client
|
|
59
86
|
and server independently apply HMAC-SHA256 to the seed to rank all block IDs and
|
|
60
|
-
select the same `n` blocks in the same order
|
|
87
|
+
select the same `n` blocks in the same order: no extra communication needed.
|
|
61
88
|
Use `buildChallenge(n, total)` for an exact block count, or `audit()` for a
|
|
62
89
|
percentage-based shorthand.
|
|
63
90
|
|
|
@@ -76,7 +103,7 @@ proof-of-storage evidence collected over time.
|
|
|
76
103
|
## Quick Start
|
|
77
104
|
|
|
78
105
|
```typescript
|
|
79
|
-
import { PinionProverClient } from '@
|
|
106
|
+
import { PinionProverClient } from '@pinionengineering/prover-client';
|
|
80
107
|
|
|
81
108
|
const client = new PinionProverClient('https://example.com/prover', {
|
|
82
109
|
getToken: async () => myAuthService.getToken(),
|
|
@@ -84,11 +111,13 @@ const client = new PinionProverClient('https://example.com/prover', {
|
|
|
84
111
|
|
|
85
112
|
// ── Setup phase ────────────────────────────────────────────────────────────
|
|
86
113
|
|
|
87
|
-
// Create a key
|
|
114
|
+
// Create a key: returns the key ID and the public half of the key pair.
|
|
88
115
|
const { keyId, publicKey } = await client.createKey();
|
|
89
116
|
|
|
90
|
-
// Tag a pinned CID
|
|
91
|
-
|
|
117
|
+
// Tag a pinned CID: submits the job, then waits (no default deadline) for
|
|
118
|
+
// the server to walk the DAG and store per-block auth tags.
|
|
119
|
+
const tagJob = await client.tag('bafybeigdyrzt...', keyId);
|
|
120
|
+
await client.waitForTag(tagJob.jobId);
|
|
92
121
|
|
|
93
122
|
// Fetch the setup document: public key + block ID lists for all tagged roots.
|
|
94
123
|
const setup = await client.getSetup(keyId);
|
|
@@ -105,7 +134,7 @@ console.log(result.pass); // true = server cryptographically proved it holds you
|
|
|
105
134
|
## Examples
|
|
106
135
|
|
|
107
136
|
`examples/verify.mjs` is a ready-to-run Node.js script covering the full
|
|
108
|
-
flow
|
|
137
|
+
flow: find-or-create a key, tag new CIDs, run one audit round:
|
|
109
138
|
|
|
110
139
|
```sh
|
|
111
140
|
PROVER_URL=https://hydrogen.pinion.build/prover \
|
|
@@ -159,13 +188,13 @@ The private scalar α never leaves the server. `publicKey` is the WireClientSet
|
|
|
159
188
|
blob decoded from base64; you can store it and pass it directly to `verifyProof()`
|
|
160
189
|
without ever calling `getSetup()` again.
|
|
161
190
|
|
|
162
|
-
A single key covers many CIDs
|
|
191
|
+
A single key covers many CIDs: you do not need a new key per file.
|
|
163
192
|
|
|
164
193
|
#### `client.listKeys()` → `ChallengeKeyInfo[]`
|
|
165
194
|
|
|
166
195
|
Returns all keys for the authenticated user. Each entry includes:
|
|
167
|
-
- `blocks_audited
|
|
168
|
-
- `audit_count
|
|
196
|
+
- `blocks_audited`: cumulative blocks challenged across all audit rounds for this key
|
|
197
|
+
- `audit_count`: number of audit rounds completed
|
|
169
198
|
|
|
170
199
|
These are the long-running metrics that show how much proof-of-storage evidence
|
|
171
200
|
has been accumulated over time.
|
|
@@ -178,47 +207,67 @@ Deletes a key and all associated tags.
|
|
|
178
207
|
|
|
179
208
|
### Setup Phase
|
|
180
209
|
|
|
181
|
-
#### `client.tag(root, keyId)` → `
|
|
210
|
+
#### `client.tag(root, keyId)` → `TagSubmission`
|
|
182
211
|
|
|
183
212
|
```typescript
|
|
184
|
-
const {
|
|
213
|
+
const { jobId } = await client.tag(cid, keyId);
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Instructs the server to walk the IPFS DAG for `root`, compute per-block
|
|
217
|
+
authentication tags, and store them under `keyId`. The CID must be in the
|
|
218
|
+
`"pinned"` lifecycle state for the authenticated account. Submits the job
|
|
219
|
+
and returns immediately — this does not wait for tagging to finish.
|
|
220
|
+
|
|
221
|
+
#### `client.waitForTag(jobId, options?)` → `TagResponse`
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
const { block_ids, block_count } = await client.waitForTag(jobId, {
|
|
225
|
+
onProgress: (progress, status) => console.log(status, progress),
|
|
226
|
+
});
|
|
185
227
|
// Exactly one is populated, depending on the key's protocol:
|
|
186
|
-
// block_ids: string[]
|
|
228
|
+
// block_ids: string[]: base64(CID.Bytes()) for every block, non-chunked
|
|
187
229
|
// protocols only (Ateniese, Erway, BJO), in TagList order
|
|
188
|
-
// block_count: number
|
|
189
|
-
// (SW-Priv, SW-Pub)
|
|
230
|
+
// block_count: number : super-block count, chunked protocols only
|
|
231
|
+
// (SW-Priv, SW-Pub): no per-block manifest is sent at all
|
|
190
232
|
```
|
|
191
233
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
234
|
+
Polls `tagStatus(jobId)` until the job reaches a terminal state. **No
|
|
235
|
+
default deadline** — waits as long as tagging takes unless `options.signal`
|
|
236
|
+
is given and fires first, in which case it throws `TagTimeoutError`. Throws
|
|
237
|
+
`TagFailedError` if the job reaches `"tag-failed"`.
|
|
195
238
|
|
|
196
239
|
For non-chunked protocols, `block_ids` is the full list of blocks for this
|
|
197
240
|
root in the order both client and server will use when ranking against a
|
|
198
|
-
challenge seed. For chunked protocols, `block_count` is all the client needs
|
|
199
|
-
|
|
241
|
+
challenge seed. For chunked protocols, `block_count` is all the client needs:
|
|
242
|
+
challenge ids are synthesized locally via `superBlockId(rootBytes, i)` for
|
|
200
243
|
`i` in `[0, block_count)`. Call `getSetup()` after tagging to get the
|
|
201
244
|
combined list/count across all roots.
|
|
202
245
|
|
|
246
|
+
| `WaitForTagOptions` field | Type | Default | Description |
|
|
247
|
+
|-------|------|---------|-------------|
|
|
248
|
+
| `pollIntervalMs` | `number` | `1000` | Milliseconds between status polls. |
|
|
249
|
+
| `signal` | `AbortSignal` | none | Optional cancellation — no default deadline. |
|
|
250
|
+
| `onProgress` | `(progress, status) => void` | none | Called after every poll with `{total_blocks, completed_blocks}` and the raw status string. |
|
|
251
|
+
|
|
203
252
|
#### `client.getSetup(keyId)` → `ParsedSetup`
|
|
204
253
|
|
|
205
254
|
Fetches the complete setup document for a key.
|
|
206
255
|
|
|
207
256
|
```typescript
|
|
208
257
|
const setup = await client.getSetup(keyId);
|
|
209
|
-
// setup.clientSetup WireClientSetup
|
|
258
|
+
// setup.clientSetup WireClientSetup: public key material
|
|
210
259
|
// setup.roots [{ root: string, blockIds: Uint8Array[], chunked: boolean }, ...]
|
|
211
260
|
// setup.totalBlocks total block count across all roots
|
|
212
261
|
```
|
|
213
262
|
|
|
214
263
|
`blockIds` is always ready to pass to `buildChallenge()`/`verifyProof()`
|
|
215
264
|
regardless of protocol. `chunked` tells you whether those ids are real
|
|
216
|
-
per-block CIDs (`false`) or synthesized super-block ids (`true`)
|
|
265
|
+
per-block CIDs (`false`) or synthesized super-block ids (`true`): only
|
|
217
266
|
relevant if you need to re-derive or re-export ids yourself; synthesized ids
|
|
218
267
|
are not valid CIDs and must never be round-tripped through `CID.decode()`.
|
|
219
268
|
|
|
220
269
|
Call this once after tagging. Re-call whenever you add or remove roots.
|
|
221
|
-
Pass the returned `ParsedSetup` directly to `audit()
|
|
270
|
+
Pass the returned `ParsedSetup` directly to `audit()`: it does not fetch
|
|
222
271
|
the setup for you.
|
|
223
272
|
|
|
224
273
|
#### `client.deregister(keyId, root)`
|
|
@@ -268,13 +317,17 @@ const result = await client.audit(keyId, setup, {
|
|
|
268
317
|
|-------|------|---------|-------------|
|
|
269
318
|
| `roots` | `string[]` | all roots | Subset of registered CIDs to challenge. |
|
|
270
319
|
| `challengePct` | `number` | `1` | Percentage of blocks to sample (0–100). |
|
|
320
|
+
| `pollIntervalMs` | `number` | `500` | Milliseconds between status polls during the wait phase. |
|
|
321
|
+
| `signal` | `AbortSignal` | none | Optional cancellation — no default deadline, waits as long as the proof takes unless this fires. Pass `AbortSignal.timeout(ms)` for a fixed ceiling. |
|
|
322
|
+
| `onStatus` | `(status: string) => void` | none | Called after every poll with the raw status string — proving has no per-block progress signal, unlike tagging. |
|
|
271
323
|
|
|
272
324
|
Throws `PinNotActiveError` if any root is no longer in the `"pinned"` state.
|
|
273
|
-
Throws `ProverError` on HTTP errors from the server.
|
|
325
|
+
Throws `ProverError` on HTTP errors from the server. Throws
|
|
326
|
+
`ProveTimeoutError` if `options.signal` fires before the proof completes.
|
|
274
327
|
|
|
275
328
|
---
|
|
276
329
|
|
|
277
|
-
#### Low-level: `buildChallenge` + `prove` + `verifyProof`
|
|
330
|
+
#### Low-level: `buildChallenge` + `prove` + `waitForProve` + `verifyProof`
|
|
278
331
|
|
|
279
332
|
Use these when you need an exact block count or want full control over the
|
|
280
333
|
challenge parameters.
|
|
@@ -282,7 +335,7 @@ challenge parameters.
|
|
|
282
335
|
##### `buildChallenge(n, totalBlocks)` → `string`
|
|
283
336
|
|
|
284
337
|
```typescript
|
|
285
|
-
import { buildChallenge } from '@
|
|
338
|
+
import { buildChallenge } from '@pinionengineering/prover-client';
|
|
286
339
|
|
|
287
340
|
const challenge = buildChallenge(10, setup.totalBlocks);
|
|
288
341
|
// Returns base64(JSON({ suite_id: 1, seed: <32 random bytes>, c: 10, n: totalBlocks }))
|
|
@@ -292,18 +345,34 @@ Generates a random 32-byte seed and encodes a WireChallenge requesting `n` block
|
|
|
292
345
|
out of `totalBlocks`. Both client and server independently apply HMAC-SHA256 to
|
|
293
346
|
the seed to rank all block IDs and arrive at the same `n` blocks in the same order.
|
|
294
347
|
|
|
295
|
-
##### `client.prove(keyId, roots, challenge)` → `
|
|
348
|
+
##### `client.prove(keyId, roots, challenge)` → `ProveSubmission`
|
|
349
|
+
|
|
350
|
+
```typescript
|
|
351
|
+
const { jobId } = await client.prove(keyId, roots, challenge);
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Posts the challenge to `POST /prove` and returns immediately with a job
|
|
355
|
+
handle — this does not wait for the proof to be computed.
|
|
356
|
+
|
|
357
|
+
##### `client.waitForProve(jobId, options?)` → `Uint8Array`
|
|
296
358
|
|
|
297
359
|
```typescript
|
|
298
|
-
const proofBytes = await client.
|
|
360
|
+
const proofBytes = await client.waitForProve(jobId, {
|
|
361
|
+
challenge, roots, // optional, but lets a thrown error carry enough to retry
|
|
362
|
+
signal: AbortSignal.timeout(60_000), // optional — no default deadline otherwise
|
|
363
|
+
});
|
|
299
364
|
```
|
|
300
365
|
|
|
301
|
-
|
|
366
|
+
Polls `proveStatus(jobId)` until the job reaches a terminal state and
|
|
367
|
+
returns the raw proof bytes. **No default deadline** — waits as long as the
|
|
368
|
+
proof takes unless `options.signal` fires first, in which case it throws
|
|
369
|
+
`ProveTimeoutError`. Throws `ProveFailedError` if the job reaches
|
|
370
|
+
`"prove-failed"`.
|
|
302
371
|
|
|
303
372
|
##### `verifyProof(params)` → `boolean`
|
|
304
373
|
|
|
305
374
|
```typescript
|
|
306
|
-
import { verifyProof } from '@
|
|
375
|
+
import { verifyProof } from '@pinionengineering/prover-client';
|
|
307
376
|
|
|
308
377
|
const pass = verifyProof({
|
|
309
378
|
clientSetup: setup.clientSetup, // or publicKey from createKey()
|
|
@@ -314,26 +383,28 @@ const pass = verifyProof({
|
|
|
314
383
|
```
|
|
315
384
|
|
|
316
385
|
Runs the BN254 pairing check locally. Returns `true` only if
|
|
317
|
-
`e(σ,G₂) == e(A,V)`. Safe to call without a client instance
|
|
386
|
+
`e(σ,G₂) == e(A,V)`. Safe to call without a client instance: useful for
|
|
318
387
|
offline verification or integration with existing infrastructure.
|
|
319
388
|
|
|
320
389
|
##### Full low-level example
|
|
321
390
|
|
|
322
391
|
```typescript
|
|
323
|
-
import { PinionProverClient, buildChallenge, verifyProof } from '@
|
|
392
|
+
import { PinionProverClient, buildChallenge, verifyProof } from '@pinionengineering/prover-client';
|
|
324
393
|
|
|
325
394
|
const client = new PinionProverClient(proverUrl, { getToken });
|
|
326
395
|
|
|
327
396
|
// Setup phase
|
|
328
397
|
const { keyId } = await client.createKey();
|
|
329
|
-
await client.tag(cid, keyId);
|
|
398
|
+
const tagJob = await client.tag(cid, keyId);
|
|
399
|
+
await client.waitForTag(tagJob.jobId);
|
|
330
400
|
const setup = await client.getSetup(keyId);
|
|
331
401
|
|
|
332
|
-
// Audit phase
|
|
402
|
+
// Audit phase: exact block count
|
|
333
403
|
const root = setup.roots[0]!;
|
|
334
404
|
const blockIds = root.blockIds;
|
|
335
|
-
const challenge
|
|
336
|
-
const
|
|
405
|
+
const challenge = buildChallenge(10, blockIds.length);
|
|
406
|
+
const submission = await client.prove(keyId, [root.root], challenge);
|
|
407
|
+
const proofBytes = await client.waitForProve(submission.jobId, { challenge, roots: [root.root] });
|
|
337
408
|
|
|
338
409
|
const pass = verifyProof({
|
|
339
410
|
clientSetup: setup.clientSetup,
|
|
@@ -351,7 +422,7 @@ You can verify a proof with no HTTP client at all, as long as you have the
|
|
|
351
422
|
public key and block IDs from a prior setup call:
|
|
352
423
|
|
|
353
424
|
```typescript
|
|
354
|
-
import { buildChallenge, verifyProof, parseClientSetup } from '@
|
|
425
|
+
import { buildChallenge, verifyProof, parseClientSetup } from '@pinionengineering/prover-client';
|
|
355
426
|
|
|
356
427
|
const clientSetup = parseClientSetup(storedClientSetupBase64);
|
|
357
428
|
|
|
@@ -429,7 +500,7 @@ base64( JSON({ protocol, suite_id, s, l, name, v, u }) )
|
|
|
429
500
|
| `suite_id` | `uint8` | `1` |
|
|
430
501
|
| `s` | `int` | Number of sectors per block |
|
|
431
502
|
| `l` | `int` | Challenge size parameter (from the SW-Pub scheme) |
|
|
432
|
-
| `name` | `base64(16 bytes)` | File name
|
|
503
|
+
| `name` | `base64(16 bytes)` | File name λ: random, unique per key, bound into every block tag |
|
|
433
504
|
| `v` | `base64(128 bytes)` | Public key V = α·G₂ (G2 point, EIP-197 format) |
|
|
434
505
|
| `u` | `base64(64 bytes)[]` | Public key U[0..s-1] (G1 points) |
|
|
435
506
|
|
|
@@ -460,13 +531,13 @@ e(σ, G₂) == e(Σₜ νₜ·H(λ‖idᵢₜ) + Σⱼ μⱼ·uⱼ, V)
|
|
|
460
531
|
|
|
461
532
|
where:
|
|
462
533
|
|
|
463
|
-
-
|
|
464
|
-
- `G
|
|
465
|
-
- `νₜ, i
|
|
466
|
-
- `H(λ‖id)
|
|
467
|
-
-
|
|
468
|
-
- `u
|
|
469
|
-
- `V
|
|
534
|
+
- `σ`: proof accumulator G1 point (from server)
|
|
535
|
+
- `G₂`: G2 generator
|
|
536
|
+
- `νₜ, iₜ`: blinding coefficients and block indices (re-derived from seed)
|
|
537
|
+
- `H(λ‖id)`: RFC 9380 SVDW hash-to-G1 with DST `"sw-pub-v1-BN254G1_XMD:SHA-256_SVDW_RO_"`
|
|
538
|
+
- `μⱼ`: per-sector Zr scalars (from server)
|
|
539
|
+
- `uⱼ`: public key G1 elements (from client_setup)
|
|
540
|
+
- `V`: public key `V = α·G₂` (from client_setup)
|
|
470
541
|
|
|
471
542
|
### Hash-to-G1
|
|
472
543
|
|
|
@@ -481,7 +552,7 @@ points that are indistinguishable from uniform random G1 elements.
|
|
|
481
552
|
|
|
482
553
|
The DST `"sw-pub-v1-BN254G1_XMD:SHA-256_SVDW_RO_"` is fixed for all keys and matches
|
|
483
554
|
the value in `storage-proofs/por/sw/pub.go`. **Changing this DST invalidates all
|
|
484
|
-
existing tags
|
|
555
|
+
existing tags**: both sides derive H independently so they must agree.
|
|
485
556
|
|
|
486
557
|
### Challenge Derivation (`DeriveChallenge`)
|
|
487
558
|
|
|
@@ -514,12 +585,18 @@ npm run test:gen
|
|
|
514
585
|
npm test
|
|
515
586
|
```
|
|
516
587
|
|
|
517
|
-
|
|
588
|
+
`test/verify.test.mjs` verifies the cross-language crypto correctness:
|
|
518
589
|
1. Valid proof accepted
|
|
519
590
|
2. Tampered sigma rejected
|
|
520
591
|
3. Wrong block IDs rejected
|
|
521
592
|
4. Wrong public key rejected
|
|
522
593
|
|
|
594
|
+
`test/client.test.mjs` covers `PinionProverClient`'s submit/wait polling
|
|
595
|
+
model against a hand-rolled `fetch` stub: `prove()`/`tag()` submit without
|
|
596
|
+
polling, `waitForProve()`/`waitForTag()` poll to completion with no
|
|
597
|
+
implicit deadline, an `AbortSignal` cancels promptly, and `audit()`'s
|
|
598
|
+
`onStatus`/`pollIntervalMs` options reach the underlying poll.
|
|
599
|
+
|
|
523
600
|
---
|
|
524
601
|
|
|
525
602
|
## Implementation Notes
|
package/dist/client.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Pass the full base URL including the path prefix, e.g.:
|
|
9
9
|
* new PinionProverClient("https://hydrogen.pinion.build/prover", { getToken })
|
|
10
10
|
*/
|
|
11
|
-
import type { AuditResult, ChallengeKeyInfo, CreateKeyResult, ParsedSetup, ProveJobStatusResponse, RawSetupResponse, TagJobListEntry, TagJobProgress, TagJobStatusResponse, TagResponse } from './types.js';
|
|
11
|
+
import type { AuditResult, ChallengeKeyInfo, CreateKeyResult, ParsedSetup, ProveJobStatusResponse, ProveSubmission, RawSetupResponse, TagJobListEntry, TagJobProgress, TagJobStatusResponse, TagResponse, TagSubmission } from './types.js';
|
|
12
12
|
export interface PinionProverClientOptions {
|
|
13
13
|
/**
|
|
14
14
|
* Returns a JWT Bearer token for authenticated endpoints, or null/undefined
|
|
@@ -20,7 +20,7 @@ export interface PinionProverClientOptions {
|
|
|
20
20
|
* Options for the audit() convenience wrapper.
|
|
21
21
|
*
|
|
22
22
|
* For exact control over block count, use buildChallenge(n, total) +
|
|
23
|
-
* prove() + verifyProof() directly.
|
|
23
|
+
* prove() + waitForProve() + verifyProof() directly.
|
|
24
24
|
*/
|
|
25
25
|
export interface AuditOptions {
|
|
26
26
|
/**
|
|
@@ -36,13 +36,31 @@ export interface AuditOptions {
|
|
|
36
36
|
* For an exact block count use buildChallenge(n, total) + prove() + verifyProof().
|
|
37
37
|
*/
|
|
38
38
|
challengePct?: number;
|
|
39
|
+
/** Milliseconds between GET /prove/:job_id polls during audit()'s wait
|
|
40
|
+
* phase. Default 500. */
|
|
41
|
+
pollIntervalMs?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Optional cancellation of audit()'s wait phase. There is no default
|
|
44
|
+
* deadline — omit to wait as long as the proof takes. Pass
|
|
45
|
+
* `AbortSignal.timeout(ms)` to restore a fixed ceiling.
|
|
46
|
+
*/
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
/** Called after every status poll with the raw status string
|
|
49
|
+
* ("prove-queued" | "prove-running") — for progress UI. There is no
|
|
50
|
+
* per-block progress signal for proving, unlike tag()'s onProgress. */
|
|
51
|
+
onStatus?: (status: string) => void;
|
|
39
52
|
}
|
|
40
|
-
/** Options for
|
|
41
|
-
export interface
|
|
53
|
+
/** Options for waitForTag()'s job-status polling. */
|
|
54
|
+
export interface WaitForTagOptions {
|
|
42
55
|
/** Milliseconds between GET /tag/:job_id polls. Default 1000. */
|
|
43
56
|
pollIntervalMs?: number;
|
|
44
|
-
/**
|
|
45
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Optional cancellation. There is no default deadline — omit to wait
|
|
59
|
+
* indefinitely. Pass `AbortSignal.timeout(ms)` to restore the old fixed
|
|
60
|
+
* ceiling (waitForTag() throws TagTimeoutError when the signal fires
|
|
61
|
+
* before the job reaches a terminal state).
|
|
62
|
+
*/
|
|
63
|
+
signal?: AbortSignal;
|
|
46
64
|
/**
|
|
47
65
|
* Called after every status poll with the latest progress and the raw
|
|
48
66
|
* status string ("tag-queued" | "tag-planning" | "tag-running" |
|
|
@@ -54,17 +72,28 @@ export interface TagOptions {
|
|
|
54
72
|
*/
|
|
55
73
|
onProgress?: (progress: TagJobProgress, status: string) => void;
|
|
56
74
|
}
|
|
57
|
-
/** Options for
|
|
58
|
-
export interface
|
|
75
|
+
/** Options for waitForProve()'s job-status polling. */
|
|
76
|
+
export interface WaitForProveOptions {
|
|
59
77
|
/** Milliseconds between GET /prove/:job_id polls. Default 500. */
|
|
60
78
|
pollIntervalMs?: number;
|
|
61
79
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
80
|
+
* Optional cancellation. There is no default deadline — omit to wait
|
|
81
|
+
* indefinitely. Pass `AbortSignal.timeout(ms)` to restore the old fixed
|
|
82
|
+
* ceiling (waitForProve() throws ProveTimeoutError when the signal fires
|
|
83
|
+
* before the job reaches a terminal state).
|
|
66
84
|
*/
|
|
67
|
-
|
|
85
|
+
signal?: AbortSignal;
|
|
86
|
+
/**
|
|
87
|
+
* The challenge/roots this job was submitted with. Optional, but passing
|
|
88
|
+
* them lets a thrown ProveFailedError/ProveTimeoutError carry enough to
|
|
89
|
+
* reconstruct a retry — pass what prove() gave you back.
|
|
90
|
+
*/
|
|
91
|
+
challenge?: string;
|
|
92
|
+
roots?: string[];
|
|
93
|
+
/** Called after every status poll with the raw status string
|
|
94
|
+
* ("prove-queued" | "prove-running"). There is no per-block progress
|
|
95
|
+
* signal for proving, unlike waitForTag()'s onProgress. */
|
|
96
|
+
onStatus?: (status: string) => void;
|
|
68
97
|
}
|
|
69
98
|
export declare class PinionProverClient {
|
|
70
99
|
private readonly baseUrl;
|
|
@@ -98,20 +127,27 @@ export declare class PinionProverClient {
|
|
|
98
127
|
* authentication tags, and store them under keyId.
|
|
99
128
|
*
|
|
100
129
|
* The root must already be in the "pinned" lifecycle state for the
|
|
101
|
-
* authenticated account.
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* next audit
|
|
107
|
-
*
|
|
108
|
-
* Throws TagFailedError if the job reaches "tag-failed", or
|
|
109
|
-
* TagTimeoutError if it doesn't reach a terminal state within
|
|
110
|
-
* options.timeoutMs.
|
|
130
|
+
* authenticated account. Tagging runs asynchronously on the server — this
|
|
131
|
+
* submits the job and returns immediately with a job handle. Poll
|
|
132
|
+
* tagStatus(jobId) yourself, or await waitForTag(jobId, options) to wait
|
|
133
|
+
* for a terminal state (with no default deadline — pass `signal:
|
|
134
|
+
* AbortSignal.timeout(ms)` if you want one). Call getSetup() after
|
|
135
|
+
* tagging completes to get the updated block ID lists for the next audit
|
|
136
|
+
* cycle.
|
|
111
137
|
*/
|
|
112
|
-
tag(root: string, keyId: string
|
|
113
|
-
/** Poll the status of a tag job started by tag(). Exposed for callers that want progress UI without waiting on
|
|
138
|
+
tag(root: string, keyId: string): Promise<TagSubmission>;
|
|
139
|
+
/** Poll the status of a tag job started by tag(). Exposed for callers that want progress UI without waiting on waitForTag()'s full promise. */
|
|
114
140
|
tagStatus(jobId: string): Promise<TagJobStatusResponse>;
|
|
141
|
+
/**
|
|
142
|
+
* Wait for a tag job started by tag() to reach a terminal state, polling
|
|
143
|
+
* tagStatus(jobId) on an interval.
|
|
144
|
+
*
|
|
145
|
+
* There is no default deadline — this waits as long as the job takes
|
|
146
|
+
* unless options.signal is given and fires first, in which case it
|
|
147
|
+
* throws TagTimeoutError with the last-seen status. Throws TagFailedError
|
|
148
|
+
* if the job reaches "tag-failed".
|
|
149
|
+
*/
|
|
150
|
+
waitForTag(jobId: string, options?: WaitForTagOptions): Promise<TagResponse>;
|
|
115
151
|
/**
|
|
116
152
|
* List the caller's tag jobs, most recently created first.
|
|
117
153
|
*
|
|
@@ -129,34 +165,42 @@ export declare class PinionProverClient {
|
|
|
129
165
|
/**
|
|
130
166
|
* POST /prove — unauthenticated, the server resolves the account from key_id.
|
|
131
167
|
*
|
|
132
|
-
* Proving is asynchronous: this
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* should use audit() instead, which
|
|
137
|
-
* response.
|
|
168
|
+
* Proving is asynchronous: this submits the challenge and returns
|
|
169
|
+
* immediately with a job handle. Poll proveStatus(jobId) yourself, or
|
|
170
|
+
* await waitForProve(jobId, options) to wait for a terminal state (with
|
|
171
|
+
* no default deadline — pass `signal: AbortSignal.timeout(ms)` if you
|
|
172
|
+
* want one). Most callers should use audit() instead, which submits,
|
|
173
|
+
* waits, and cryptographically verifies the response in one call.
|
|
138
174
|
*
|
|
139
175
|
* @param keyId Challenge key ID.
|
|
140
176
|
* @param roots CID strings to prove, in the same order as the challenge.
|
|
141
177
|
* @param challenge base64(JSON(WireChallenge)) from buildChallenge().
|
|
142
178
|
* @param challengeId Optional idempotency key. If a caller's own retry
|
|
143
179
|
* logic re-calls prove() for what is logically the
|
|
144
|
-
* same request (e.g. after
|
|
145
|
-
* outcome), passing the
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* against a previous one.
|
|
180
|
+
* same request (e.g. after giving up waiting on an
|
|
181
|
+
* earlier attempt with an unclear outcome), passing the
|
|
182
|
+
* same challengeId across those attempts makes the
|
|
183
|
+
* server return the original job instead of starting a
|
|
184
|
+
* redundant one. Leave unset for normal audit rounds —
|
|
185
|
+
* each is a fresh, independently random challenge,
|
|
186
|
+
* which should never be deduped against a previous one.
|
|
151
187
|
*
|
|
152
188
|
* Throws PinNotActiveError (409, checked synchronously before any job is
|
|
153
|
-
* created)
|
|
154
|
-
* ProveTimeoutError if it doesn't reach a terminal state within
|
|
155
|
-
* options.timeoutMs.
|
|
189
|
+
* created) or ProverError for any other non-2xx submit response.
|
|
156
190
|
*/
|
|
157
|
-
prove(keyId: string, roots: string[], challenge: string, challengeId?: string
|
|
158
|
-
/** Poll the status of a proof job started by prove(). Exposed for callers that want to observe progress without waiting on
|
|
191
|
+
prove(keyId: string, roots: string[], challenge: string, challengeId?: string): Promise<ProveSubmission>;
|
|
192
|
+
/** Poll the status of a proof job started by prove(). Exposed for callers that want to observe progress without waiting on waitForProve()'s full promise. */
|
|
159
193
|
proveStatus(jobId: string): Promise<ProveJobStatusResponse>;
|
|
194
|
+
/**
|
|
195
|
+
* Wait for a proof job started by prove() to reach a terminal state,
|
|
196
|
+
* polling proveStatus(jobId) on an interval. Returns the raw proof bytes.
|
|
197
|
+
*
|
|
198
|
+
* There is no default deadline — this waits as long as the proof takes
|
|
199
|
+
* unless options.signal is given and fires first, in which case it
|
|
200
|
+
* throws ProveTimeoutError with the last-seen status. Throws
|
|
201
|
+
* ProveFailedError if the job reaches "prove-failed".
|
|
202
|
+
*/
|
|
203
|
+
waitForProve(jobId: string, options?: WaitForProveOptions): Promise<Uint8Array>;
|
|
160
204
|
/**
|
|
161
205
|
* Run one audit round against a pre-fetched setup.
|
|
162
206
|
*
|
|
@@ -176,6 +220,10 @@ export declare class PinionProverClient {
|
|
|
176
220
|
* const result = await client.audit(keyId, setup, { challengePct: 100 });
|
|
177
221
|
* ```
|
|
178
222
|
*
|
|
223
|
+
* Waits for the proof with no default deadline — pass `options.signal` if
|
|
224
|
+
* you want to cancel or bound how long this waits (e.g.
|
|
225
|
+
* `AbortSignal.timeout(60_000)` for the old fixed ceiling).
|
|
226
|
+
*
|
|
179
227
|
* Throws `PinNotActiveError` if any challenged root is no longer pinned.
|
|
180
228
|
*/
|
|
181
229
|
audit(keyId: string, setup: ParsedSetup, options?: AuditOptions): Promise<AuditResult>;
|
|
@@ -214,39 +262,49 @@ export declare class PinNotActiveError extends Error {
|
|
|
214
262
|
readonly cid: string;
|
|
215
263
|
constructor(cid: string);
|
|
216
264
|
}
|
|
217
|
-
/** Thrown by
|
|
265
|
+
/** Thrown by waitForTag() when the async tag job reaches the "tag-failed" state. */
|
|
218
266
|
export declare class TagFailedError extends Error {
|
|
219
267
|
readonly jobId: string;
|
|
220
268
|
readonly reason: string;
|
|
221
269
|
constructor(jobId: string, reason: string);
|
|
222
270
|
}
|
|
223
|
-
/**
|
|
271
|
+
/**
|
|
272
|
+
* Thrown by waitForTag() when its `options.signal` fires before the job
|
|
273
|
+
* reaches a terminal state. There is no default deadline anymore — this
|
|
274
|
+
* only happens if the caller opted into one (e.g. `signal:
|
|
275
|
+
* AbortSignal.timeout(ms)`).
|
|
276
|
+
*/
|
|
224
277
|
export declare class TagTimeoutError extends Error {
|
|
225
278
|
readonly jobId: string;
|
|
226
279
|
readonly lastStatus: string;
|
|
227
280
|
constructor(jobId: string, lastStatus: string);
|
|
228
281
|
}
|
|
229
|
-
/** Thrown by
|
|
282
|
+
/** Thrown by waitForProve() when the async proof job reaches the "prove-failed" state. */
|
|
230
283
|
export declare class ProveFailedError extends Error {
|
|
231
284
|
readonly jobId: string;
|
|
232
285
|
readonly reason: string;
|
|
233
|
-
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). */
|
|
234
|
-
readonly challenge: string;
|
|
235
|
-
readonly roots: string[];
|
|
286
|
+
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). Undefined if the caller didn't pass one to waitForProve(). */
|
|
287
|
+
readonly challenge: string | undefined;
|
|
288
|
+
readonly roots: string[] | undefined;
|
|
236
289
|
constructor(jobId: string, reason: string,
|
|
237
|
-
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). */
|
|
238
|
-
challenge: string, roots: string[]);
|
|
290
|
+
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). Undefined if the caller didn't pass one to waitForProve(). */
|
|
291
|
+
challenge: string | undefined, roots: string[] | undefined);
|
|
239
292
|
}
|
|
240
|
-
/**
|
|
293
|
+
/**
|
|
294
|
+
* Thrown by waitForProve() when its `options.signal` fires before the job
|
|
295
|
+
* reaches a terminal state. There is no default deadline anymore — this
|
|
296
|
+
* only happens if the caller opted into one (e.g. `signal:
|
|
297
|
+
* AbortSignal.timeout(ms)`).
|
|
298
|
+
*/
|
|
241
299
|
export declare class ProveTimeoutError extends Error {
|
|
242
300
|
readonly jobId: string;
|
|
243
301
|
readonly lastStatus: string;
|
|
244
|
-
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). */
|
|
245
|
-
readonly challenge: string;
|
|
246
|
-
readonly roots: string[];
|
|
302
|
+
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). Undefined if the caller didn't pass one to waitForProve(). */
|
|
303
|
+
readonly challenge: string | undefined;
|
|
304
|
+
readonly roots: string[] | undefined;
|
|
247
305
|
constructor(jobId: string, lastStatus: string,
|
|
248
|
-
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). */
|
|
249
|
-
challenge: string, roots: string[]);
|
|
306
|
+
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). Undefined if the caller didn't pass one to waitForProve(). */
|
|
307
|
+
challenge: string | undefined, roots: string[] | undefined);
|
|
250
308
|
}
|
|
251
309
|
/**
|
|
252
310
|
* Decode a raw /setup response into a ParsedSetup.
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAEhB,eAAe,EACf,WAAW,EAGX,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAEf,cAAc,EAEd,oBAAoB,EACpB,WAAW,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAEhB,eAAe,EACf,WAAW,EAGX,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,eAAe,EAEf,cAAc,EAEd,oBAAoB,EACpB,WAAW,EACX,aAAa,EAEd,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACr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M,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS;CAK9C;AAED;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;aAExB,KAAK,EAAE,MAAM;aACb,UAAU,EAAE,MAAM;IAClC,8JAA8J;aAC9I,SAAS,EAAE,MAAM,GAAG,SAAS;aAC7B,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS;gBAJ3B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM;IAClC,8JAA8J;IAC9I,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS;CAK9C;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,WAAW,CAmBrE"}
|
package/dist/client.js
CHANGED
|
@@ -71,45 +71,57 @@ export class PinionProverClient {
|
|
|
71
71
|
* authentication tags, and store them under keyId.
|
|
72
72
|
*
|
|
73
73
|
* The root must already be in the "pinned" lifecycle state for the
|
|
74
|
-
* authenticated account.
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* next audit
|
|
80
|
-
*
|
|
81
|
-
* Throws TagFailedError if the job reaches "tag-failed", or
|
|
82
|
-
* TagTimeoutError if it doesn't reach a terminal state within
|
|
83
|
-
* options.timeoutMs.
|
|
74
|
+
* authenticated account. Tagging runs asynchronously on the server — this
|
|
75
|
+
* submits the job and returns immediately with a job handle. Poll
|
|
76
|
+
* tagStatus(jobId) yourself, or await waitForTag(jobId, options) to wait
|
|
77
|
+
* for a terminal state (with no default deadline — pass `signal:
|
|
78
|
+
* AbortSignal.timeout(ms)` if you want one). Call getSetup() after
|
|
79
|
+
* tagging completes to get the updated block ID lists for the next audit
|
|
80
|
+
* cycle.
|
|
84
81
|
*/
|
|
85
|
-
async tag(root, keyId
|
|
86
|
-
const pollIntervalMs = options.pollIntervalMs ?? 1000;
|
|
87
|
-
const timeoutMs = options.timeoutMs ?? 10 * 60 * 1000;
|
|
82
|
+
async tag(root, keyId) {
|
|
88
83
|
const { job_id: jobId } = await this.post('/api/v1/tag', {
|
|
89
84
|
root,
|
|
90
85
|
key_id: keyId,
|
|
91
86
|
});
|
|
92
|
-
|
|
93
|
-
for (;;) {
|
|
94
|
-
const status = await this.tagStatus(jobId);
|
|
95
|
-
if (status.progress)
|
|
96
|
-
options.onProgress?.(status.progress, status.status);
|
|
97
|
-
if (status.status === 'tag-done') {
|
|
98
|
-
return { block_ids: status.block_ids, block_count: status.block_count };
|
|
99
|
-
}
|
|
100
|
-
if (status.status === 'tag-failed') {
|
|
101
|
-
throw new TagFailedError(jobId, status.error ?? 'unknown error');
|
|
102
|
-
}
|
|
103
|
-
if (Date.now() >= deadline) {
|
|
104
|
-
throw new TagTimeoutError(jobId, status.status);
|
|
105
|
-
}
|
|
106
|
-
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
107
|
-
}
|
|
87
|
+
return { jobId, root, keyId };
|
|
108
88
|
}
|
|
109
|
-
/** Poll the status of a tag job started by tag(). Exposed for callers that want progress UI without waiting on
|
|
89
|
+
/** Poll the status of a tag job started by tag(). Exposed for callers that want progress UI without waiting on waitForTag()'s full promise. */
|
|
110
90
|
async tagStatus(jobId) {
|
|
111
91
|
return this.get(`/api/v1/tag/${encodeURIComponent(jobId)}`);
|
|
112
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Wait for a tag job started by tag() to reach a terminal state, polling
|
|
95
|
+
* tagStatus(jobId) on an interval.
|
|
96
|
+
*
|
|
97
|
+
* There is no default deadline — this waits as long as the job takes
|
|
98
|
+
* unless options.signal is given and fires first, in which case it
|
|
99
|
+
* throws TagTimeoutError with the last-seen status. Throws TagFailedError
|
|
100
|
+
* if the job reaches "tag-failed".
|
|
101
|
+
*/
|
|
102
|
+
async waitForTag(jobId, options = {}) {
|
|
103
|
+
const pollIntervalMs = options.pollIntervalMs ?? 1000;
|
|
104
|
+
const status = await pollUntilTerminal({
|
|
105
|
+
fetchStatus: () => this.tagStatus(jobId),
|
|
106
|
+
isTerminal: (s) => s.status === 'tag-done' || s.status === 'tag-failed',
|
|
107
|
+
pollIntervalMs,
|
|
108
|
+
signal: options.signal,
|
|
109
|
+
onTick: (s) => {
|
|
110
|
+
if (s.progress)
|
|
111
|
+
options.onProgress?.(s.progress, s.status);
|
|
112
|
+
},
|
|
113
|
+
}).catch((e) => {
|
|
114
|
+
if (e instanceof PollAbortedError) {
|
|
115
|
+
const last = e.lastStatus;
|
|
116
|
+
throw new TagTimeoutError(jobId, last?.status ?? 'unknown');
|
|
117
|
+
}
|
|
118
|
+
throw e;
|
|
119
|
+
});
|
|
120
|
+
if (status.status === 'tag-failed') {
|
|
121
|
+
throw new TagFailedError(jobId, status.error ?? 'unknown error');
|
|
122
|
+
}
|
|
123
|
+
return { block_ids: status.block_ids, block_count: status.block_count };
|
|
124
|
+
}
|
|
113
125
|
/**
|
|
114
126
|
* List the caller's tag jobs, most recently created first.
|
|
115
127
|
*
|
|
@@ -134,34 +146,30 @@ export class PinionProverClient {
|
|
|
134
146
|
/**
|
|
135
147
|
* POST /prove — unauthenticated, the server resolves the account from key_id.
|
|
136
148
|
*
|
|
137
|
-
* Proving is asynchronous: this
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* should use audit() instead, which
|
|
142
|
-
* response.
|
|
149
|
+
* Proving is asynchronous: this submits the challenge and returns
|
|
150
|
+
* immediately with a job handle. Poll proveStatus(jobId) yourself, or
|
|
151
|
+
* await waitForProve(jobId, options) to wait for a terminal state (with
|
|
152
|
+
* no default deadline — pass `signal: AbortSignal.timeout(ms)` if you
|
|
153
|
+
* want one). Most callers should use audit() instead, which submits,
|
|
154
|
+
* waits, and cryptographically verifies the response in one call.
|
|
143
155
|
*
|
|
144
156
|
* @param keyId Challenge key ID.
|
|
145
157
|
* @param roots CID strings to prove, in the same order as the challenge.
|
|
146
158
|
* @param challenge base64(JSON(WireChallenge)) from buildChallenge().
|
|
147
159
|
* @param challengeId Optional idempotency key. If a caller's own retry
|
|
148
160
|
* logic re-calls prove() for what is logically the
|
|
149
|
-
* same request (e.g. after
|
|
150
|
-
* outcome), passing the
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* against a previous one.
|
|
161
|
+
* same request (e.g. after giving up waiting on an
|
|
162
|
+
* earlier attempt with an unclear outcome), passing the
|
|
163
|
+
* same challengeId across those attempts makes the
|
|
164
|
+
* server return the original job instead of starting a
|
|
165
|
+
* redundant one. Leave unset for normal audit rounds —
|
|
166
|
+
* each is a fresh, independently random challenge,
|
|
167
|
+
* which should never be deduped against a previous one.
|
|
156
168
|
*
|
|
157
169
|
* Throws PinNotActiveError (409, checked synchronously before any job is
|
|
158
|
-
* created)
|
|
159
|
-
* ProveTimeoutError if it doesn't reach a terminal state within
|
|
160
|
-
* options.timeoutMs.
|
|
170
|
+
* created) or ProverError for any other non-2xx submit response.
|
|
161
171
|
*/
|
|
162
|
-
async prove(keyId, roots, challenge, challengeId
|
|
163
|
-
const pollIntervalMs = options.pollIntervalMs ?? 500;
|
|
164
|
-
const timeoutMs = options.timeoutMs ?? 60 * 1000;
|
|
172
|
+
async prove(keyId, roots, challenge, challengeId) {
|
|
165
173
|
const resp = await fetch(`${this.baseUrl}/prove`, {
|
|
166
174
|
method: 'POST',
|
|
167
175
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -175,25 +183,41 @@ export class PinionProverClient {
|
|
|
175
183
|
throw new ProverError(resp.status, await resp.text().catch(() => ''));
|
|
176
184
|
}
|
|
177
185
|
const { job_id: jobId } = await parseJsonBody(resp);
|
|
178
|
-
|
|
179
|
-
for (;;) {
|
|
180
|
-
const status = await this.proveStatus(jobId);
|
|
181
|
-
if (status.status === 'prove-done') {
|
|
182
|
-
return base64ToBytes(status.proof ?? '');
|
|
183
|
-
}
|
|
184
|
-
if (status.status === 'prove-failed') {
|
|
185
|
-
throw new ProveFailedError(jobId, status.error ?? 'unknown error', challenge, roots);
|
|
186
|
-
}
|
|
187
|
-
if (Date.now() >= deadline) {
|
|
188
|
-
throw new ProveTimeoutError(jobId, status.status, challenge, roots);
|
|
189
|
-
}
|
|
190
|
-
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
191
|
-
}
|
|
186
|
+
return { jobId, challenge, roots };
|
|
192
187
|
}
|
|
193
|
-
/** Poll the status of a proof job started by prove(). Exposed for callers that want to observe progress without waiting on
|
|
188
|
+
/** Poll the status of a proof job started by prove(). Exposed for callers that want to observe progress without waiting on waitForProve()'s full promise. */
|
|
194
189
|
async proveStatus(jobId) {
|
|
195
190
|
return this.get(`/prove/${encodeURIComponent(jobId)}`);
|
|
196
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Wait for a proof job started by prove() to reach a terminal state,
|
|
194
|
+
* polling proveStatus(jobId) on an interval. Returns the raw proof bytes.
|
|
195
|
+
*
|
|
196
|
+
* There is no default deadline — this waits as long as the proof takes
|
|
197
|
+
* unless options.signal is given and fires first, in which case it
|
|
198
|
+
* throws ProveTimeoutError with the last-seen status. Throws
|
|
199
|
+
* ProveFailedError if the job reaches "prove-failed".
|
|
200
|
+
*/
|
|
201
|
+
async waitForProve(jobId, options = {}) {
|
|
202
|
+
const pollIntervalMs = options.pollIntervalMs ?? 500;
|
|
203
|
+
const status = await pollUntilTerminal({
|
|
204
|
+
fetchStatus: () => this.proveStatus(jobId),
|
|
205
|
+
isTerminal: (s) => s.status === 'prove-done' || s.status === 'prove-failed',
|
|
206
|
+
pollIntervalMs,
|
|
207
|
+
signal: options.signal,
|
|
208
|
+
onTick: (s) => options.onStatus?.(s.status),
|
|
209
|
+
}).catch((e) => {
|
|
210
|
+
if (e instanceof PollAbortedError) {
|
|
211
|
+
const last = e.lastStatus;
|
|
212
|
+
throw new ProveTimeoutError(jobId, last?.status ?? 'unknown', options.challenge, options.roots);
|
|
213
|
+
}
|
|
214
|
+
throw e;
|
|
215
|
+
});
|
|
216
|
+
if (status.status === 'prove-failed') {
|
|
217
|
+
throw new ProveFailedError(jobId, status.error ?? 'unknown error', options.challenge, options.roots);
|
|
218
|
+
}
|
|
219
|
+
return base64ToBytes(status.proof ?? '');
|
|
220
|
+
}
|
|
197
221
|
/**
|
|
198
222
|
* Run one audit round against a pre-fetched setup.
|
|
199
223
|
*
|
|
@@ -213,6 +237,10 @@ export class PinionProverClient {
|
|
|
213
237
|
* const result = await client.audit(keyId, setup, { challengePct: 100 });
|
|
214
238
|
* ```
|
|
215
239
|
*
|
|
240
|
+
* Waits for the proof with no default deadline — pass `options.signal` if
|
|
241
|
+
* you want to cancel or bound how long this waits (e.g.
|
|
242
|
+
* `AbortSignal.timeout(60_000)` for the old fixed ceiling).
|
|
243
|
+
*
|
|
216
244
|
* Throws `PinNotActiveError` if any challenged root is no longer pinned.
|
|
217
245
|
*/
|
|
218
246
|
async audit(keyId, setup, options = {}) {
|
|
@@ -231,7 +259,14 @@ export class PinionProverClient {
|
|
|
231
259
|
throw new Error('no blocks to audit');
|
|
232
260
|
const challengeSize = Math.max(1, Math.round((challengePct / 100) * allBlockIds.length));
|
|
233
261
|
const challenge = buildChallenge(challengeSize, allBlockIds.length);
|
|
234
|
-
const
|
|
262
|
+
const submission = await this.prove(keyId, targetRoots, challenge);
|
|
263
|
+
const proofBytes = await this.waitForProve(submission.jobId, {
|
|
264
|
+
pollIntervalMs: options.pollIntervalMs,
|
|
265
|
+
signal: options.signal,
|
|
266
|
+
challenge,
|
|
267
|
+
roots: targetRoots,
|
|
268
|
+
onStatus: options.onStatus,
|
|
269
|
+
});
|
|
235
270
|
const verification = verifyProofResult({
|
|
236
271
|
clientSetup: setup.clientSetup,
|
|
237
272
|
blockIds: allBlockIds,
|
|
@@ -317,6 +352,57 @@ async function parseJsonBody(resp) {
|
|
|
317
352
|
}
|
|
318
353
|
}
|
|
319
354
|
// ---------------------------------------------------------------------------
|
|
355
|
+
// Shared polling loop for waitForProve()/waitForTag()
|
|
356
|
+
// ---------------------------------------------------------------------------
|
|
357
|
+
/**
|
|
358
|
+
* Internal signal that a poll loop was cancelled via its caller-supplied
|
|
359
|
+
* AbortSignal before the job reached a terminal state. waitForProve()/
|
|
360
|
+
* waitForTag() catch this and rethrow as ProveTimeoutError/TagTimeoutError
|
|
361
|
+
* carrying lastStatus — never thrown to the outside on its own.
|
|
362
|
+
*/
|
|
363
|
+
class PollAbortedError extends Error {
|
|
364
|
+
lastStatus;
|
|
365
|
+
constructor(lastStatus) {
|
|
366
|
+
super('poll aborted');
|
|
367
|
+
this.lastStatus = lastStatus;
|
|
368
|
+
this.name = 'PollAbortedError';
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Polls fetchStatus() every pollIntervalMs until isTerminal(status) is
|
|
373
|
+
* true, calling onTick(status) after every poll (terminal or not) so
|
|
374
|
+
* callers can drive progress callbacks. Has NO built-in deadline — the
|
|
375
|
+
* caller's polling budget is unlimited unless `signal` is given, in which
|
|
376
|
+
* case an abort rejects with PollAbortedError(lastStatus) instead of
|
|
377
|
+
* resolving.
|
|
378
|
+
*/
|
|
379
|
+
async function pollUntilTerminal(opts) {
|
|
380
|
+
let last;
|
|
381
|
+
for (;;) {
|
|
382
|
+
if (opts.signal?.aborted)
|
|
383
|
+
throw new PollAbortedError(last);
|
|
384
|
+
const status = await opts.fetchStatus();
|
|
385
|
+
last = status;
|
|
386
|
+
opts.onTick?.(status);
|
|
387
|
+
if (opts.isTerminal(status))
|
|
388
|
+
return status;
|
|
389
|
+
await sleepOrAbort(opts.pollIntervalMs, opts.signal, last);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function sleepOrAbort(ms, signal, lastStatus) {
|
|
393
|
+
return new Promise((resolve, reject) => {
|
|
394
|
+
if (signal?.aborted) {
|
|
395
|
+
reject(new PollAbortedError(lastStatus));
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
const timer = setTimeout(resolve, ms);
|
|
399
|
+
signal?.addEventListener('abort', () => {
|
|
400
|
+
clearTimeout(timer);
|
|
401
|
+
reject(new PollAbortedError(lastStatus));
|
|
402
|
+
}, { once: true });
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
// ---------------------------------------------------------------------------
|
|
320
406
|
// Errors
|
|
321
407
|
// ---------------------------------------------------------------------------
|
|
322
408
|
export class ProverError extends Error {
|
|
@@ -362,7 +448,7 @@ export class PinNotActiveError extends Error {
|
|
|
362
448
|
this.name = 'PinNotActiveError';
|
|
363
449
|
}
|
|
364
450
|
}
|
|
365
|
-
/** Thrown by
|
|
451
|
+
/** Thrown by waitForTag() when the async tag job reaches the "tag-failed" state. */
|
|
366
452
|
export class TagFailedError extends Error {
|
|
367
453
|
jobId;
|
|
368
454
|
reason;
|
|
@@ -373,7 +459,12 @@ export class TagFailedError extends Error {
|
|
|
373
459
|
this.name = 'TagFailedError';
|
|
374
460
|
}
|
|
375
461
|
}
|
|
376
|
-
/**
|
|
462
|
+
/**
|
|
463
|
+
* Thrown by waitForTag() when its `options.signal` fires before the job
|
|
464
|
+
* reaches a terminal state. There is no default deadline anymore — this
|
|
465
|
+
* only happens if the caller opted into one (e.g. `signal:
|
|
466
|
+
* AbortSignal.timeout(ms)`).
|
|
467
|
+
*/
|
|
377
468
|
export class TagTimeoutError extends Error {
|
|
378
469
|
jobId;
|
|
379
470
|
lastStatus;
|
|
@@ -384,14 +475,14 @@ export class TagTimeoutError extends Error {
|
|
|
384
475
|
this.name = 'TagTimeoutError';
|
|
385
476
|
}
|
|
386
477
|
}
|
|
387
|
-
/** Thrown by
|
|
478
|
+
/** Thrown by waitForProve() when the async proof job reaches the "prove-failed" state. */
|
|
388
479
|
export class ProveFailedError extends Error {
|
|
389
480
|
jobId;
|
|
390
481
|
reason;
|
|
391
482
|
challenge;
|
|
392
483
|
roots;
|
|
393
484
|
constructor(jobId, reason,
|
|
394
|
-
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). */
|
|
485
|
+
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). Undefined if the caller didn't pass one to waitForProve(). */
|
|
395
486
|
challenge, roots) {
|
|
396
487
|
super(`prove job ${jobId} failed: ${reason}`);
|
|
397
488
|
this.jobId = jobId;
|
|
@@ -401,14 +492,19 @@ export class ProveFailedError extends Error {
|
|
|
401
492
|
this.name = 'ProveFailedError';
|
|
402
493
|
}
|
|
403
494
|
}
|
|
404
|
-
/**
|
|
495
|
+
/**
|
|
496
|
+
* Thrown by waitForProve() when its `options.signal` fires before the job
|
|
497
|
+
* reaches a terminal state. There is no default deadline anymore — this
|
|
498
|
+
* only happens if the caller opted into one (e.g. `signal:
|
|
499
|
+
* AbortSignal.timeout(ms)`).
|
|
500
|
+
*/
|
|
405
501
|
export class ProveTimeoutError extends Error {
|
|
406
502
|
jobId;
|
|
407
503
|
lastStatus;
|
|
408
504
|
challenge;
|
|
409
505
|
roots;
|
|
410
506
|
constructor(jobId, lastStatus,
|
|
411
|
-
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). */
|
|
507
|
+
/** The challenge this job was for — base64(JSON(WireChallenge)), decode with decodeChallenge(). Undefined if the caller didn't pass one to waitForProve(). */
|
|
412
508
|
challenge, roots) {
|
|
413
509
|
super(`prove job ${jobId} timed out (last status: ${lastStatus})`);
|
|
414
510
|
this.jobId = jobId;
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoBH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AA+DvC,MAAM,OAAO,kBAAkB;IACZ,OAA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, ProveFailedError, ProveTimeoutError, parseSetupResponse, } from './client.js';
|
|
2
|
-
export type { PinionProverClientOptions, AuditOptions,
|
|
2
|
+
export type { PinionProverClientOptions, AuditOptions, WaitForTagOptions, WaitForProveOptions, } from './client.js';
|
|
3
3
|
export { verifyProof, verifyProofResult, parseClientSetup } from './verify.js';
|
|
4
4
|
export type { VerifyParams } from './verify.js';
|
|
5
5
|
export { buildChallenge, decodeChallenge, deriveIndicesAndCoeffs, blockHashG1, superBlockId, base64ToBytes, uint8ToBase64, BN254_ORDER, } from './challenge.js';
|
|
6
6
|
export { g1FromBytes, g2FromBytes, g1ScalarMult, g1Add, atePairing, fp12Equal, bytesToBigInt, G1_BASE, G2_BASE, } from './bn254.js';
|
|
7
7
|
export type { G1Point, G2Point, Fp12Elem } from './bn254.js';
|
|
8
|
-
export type { WireClientSetup, WireChallenge, WireProof, ProveResponse, ProveJobResponse, ProveJobStatusResponse, RawTaggedRoot, RawSetupResponse, ParsedRoot, ParsedSetup, ChallengeKeyInfo, CreateKeyResponse, CreateKeyResult, UpdateKeyLabelRequest, TagResponse, TagJobResponse, TagJobProgress, TagJobStatusResponse, TagJobListEntry, TagJobListResponse, ProofVerificationResult, AuditResult, } from './types.js';
|
|
8
|
+
export type { WireClientSetup, WireChallenge, WireProof, ProveResponse, ProveJobResponse, ProveJobStatusResponse, ProveSubmission, RawTaggedRoot, RawSetupResponse, ParsedRoot, ParsedSetup, ChallengeKeyInfo, CreateKeyResponse, CreateKeyResult, UpdateKeyLabelRequest, TagResponse, TagJobResponse, TagSubmission, TagJobProgress, TagJobStatusResponse, TagJobListEntry, TagJobListResponse, ProofVerificationResult, AuditResult, } from './types.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,yBAAyB,EACzB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/E,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EACL,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,GACR,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG7D,YAAY,EACV,eAAe,EACf,aAAa,EACb,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,cAAc,EACd,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,GACZ,MAAM,YAAY,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAQrB,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/E,yBAAyB;AACzB,OAAO,EACL,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAExB,wDAAwD;AACxD,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,GACR,MAAM,YAAY,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -51,6 +51,17 @@ export interface ProveResponse {
|
|
|
51
51
|
export interface ProveJobResponse {
|
|
52
52
|
job_id: string;
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Result of prove()'s submit call: the proof job has been created and
|
|
56
|
+
* queued. Echoes challenge/roots back so a caller building progress UI (or
|
|
57
|
+
* later calling waitForProve()) doesn't have to thread them through
|
|
58
|
+
* separately.
|
|
59
|
+
*/
|
|
60
|
+
export interface ProveSubmission {
|
|
61
|
+
jobId: string;
|
|
62
|
+
challenge: string;
|
|
63
|
+
roots: string[];
|
|
64
|
+
}
|
|
54
65
|
/**
|
|
55
66
|
* Raw status response from GET /prove/:job_id. This endpoint is
|
|
56
67
|
* unauthenticated, same as POST /prove — job_id is a fresh, unguessable
|
|
@@ -174,6 +185,16 @@ export interface TagResponse {
|
|
|
174
185
|
export interface TagJobResponse {
|
|
175
186
|
job_id: string;
|
|
176
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Result of tag()'s submit call: the tag job has been created and queued.
|
|
190
|
+
* Echoes root/keyId back so a caller doesn't have to thread them through
|
|
191
|
+
* separately to waitForTag() or a progress indicator.
|
|
192
|
+
*/
|
|
193
|
+
export interface TagSubmission {
|
|
194
|
+
jobId: string;
|
|
195
|
+
root: string;
|
|
196
|
+
keyId: string;
|
|
197
|
+
}
|
|
177
198
|
/** How much of an in-flight tag job has completed. */
|
|
178
199
|
export interface TagJobProgress {
|
|
179
200
|
total_blocks: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,EAAE,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,E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,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,uBAAuB,GAC/B;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAClB;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,GAC/C;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,iBAAiB,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAEnE,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC1B,+DAA+D;IAC/D,IAAI,EAAE,OAAO,CAAC;IACd;;;;;;OAMG;IACH,YAAY,EAAE,uBAAuB,CAAC;IACtC,wDAAwD;IACxD,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,oHAAoH;IACpH,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinionengineering/prover-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "JavaScript/TypeScript client for the pinion-prover storage-proof service. Builds SW-Pub challenges and cryptographically verifies proofs using BN254 pairings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"prepare": "npm run build",
|
|
21
21
|
"build:watch": "tsc --watch",
|
|
22
22
|
"typecheck": "tsc --noEmit",
|
|
23
|
-
"test": "npm run build && node test/verify.test.mjs",
|
|
24
|
-
"test:gen": "cd testdata/gen && go run . > ../vectors.json"
|
|
23
|
+
"test": "npm run build && node test/verify.test.mjs && node test/client.test.mjs",
|
|
24
|
+
"test:gen": "cd ../testdata/gen && go run . > ../vectors.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@noble/curves": "^1.4.0",
|