@t3foundry/tasra-sdk 0.3.1-next.1 → 0.4.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/CHANGELOG.md +1067 -28
- package/README.md +15 -0
- package/dist/app/approvals.d.ts +66 -4
- package/dist/app/approvals.js +153 -16
- package/dist/app/authorization.d.ts +1 -1
- package/dist/app/authorization.js +1 -1
- package/dist/app/browser.d.ts +63 -0
- package/dist/app/browser.js +242 -0
- package/dist/app/client.d.ts +114 -13
- package/dist/app/client.js +302 -76
- package/dist/app/identity.js +21 -9
- package/dist/app/index.d.ts +28 -3
- package/dist/app/index.js +16 -1
- package/dist/app/memory-store.d.ts +7 -0
- package/dist/app/memory-store.js +55 -0
- package/dist/app/node.d.ts +34 -6
- package/dist/app/node.js +387 -64
- package/dist/app/paid-allowance.d.ts +325 -0
- package/dist/app/paid-allowance.js +1290 -0
- package/dist/app/paid-approval.d.ts +122 -0
- package/dist/app/paid-approval.js +379 -0
- package/dist/app/paid-journal.d.ts +51 -0
- package/dist/app/paid-journal.js +117 -0
- package/dist/app/paid-keys.d.ts +12 -0
- package/dist/app/paid-keys.js +20 -0
- package/dist/app/paid-operation.d.ts +821 -0
- package/dist/app/paid-operation.js +1720 -0
- package/dist/app/paid-reservation.d.ts +157 -0
- package/dist/app/paid-reservation.js +323 -0
- package/dist/app/paid-session.d.ts +147 -0
- package/dist/app/paid-session.js +578 -0
- package/dist/app/payer-queue.d.ts +11 -0
- package/dist/app/payer-queue.js +27 -0
- package/dist/app/policy-bootstrap.d.ts +342 -0
- package/dist/app/policy-bootstrap.js +365 -0
- package/dist/app/policy-operation.d.ts +47 -0
- package/dist/app/policy-operation.js +101 -0
- package/dist/app/ready-slot.d.ts +12 -0
- package/dist/app/ready-slot.js +5 -2
- package/dist/app/rotation-lock.d.ts +38 -0
- package/dist/app/rotation-lock.js +42 -0
- package/dist/app/session-decrypt.d.ts +135 -0
- package/dist/app/session-decrypt.js +335 -0
- package/dist/app/session-grants.d.ts +349 -0
- package/dist/app/session-grants.js +811 -0
- package/dist/app/signing-intents.d.ts +78 -0
- package/dist/app/signing-intents.js +95 -0
- package/dist/app/store-commit.d.ts +63 -0
- package/dist/app/store-commit.js +126 -0
- package/dist/app/store-errors.d.ts +8 -0
- package/dist/app/store-errors.js +11 -0
- package/dist/app/tasra-client.d.ts +2 -0
- package/dist/app/tasra-client.js +1 -1
- package/dist/app/wallet.js +4 -1
- package/dist/auth/holderProof.d.ts +3 -0
- package/dist/auth/holderProof.js +8 -7
- package/dist/auth/verifier.d.ts +4 -2
- package/dist/auth/verifier.js +5 -2
- package/dist/chain/abis/index.d.ts +6178 -4101
- package/dist/chain/abis/index.js +3 -0
- package/dist/chain/abis/keyRegistry.d.ts +256 -0
- package/dist/chain/abis/keyRegistry.js +333 -0
- package/dist/chain/abis/prepaidFaultOracle.d.ts +321 -0
- package/dist/chain/abis/prepaidFaultOracle.js +413 -0
- package/dist/chain/abis/settlement.d.ts +2203 -703
- package/dist/chain/abis/settlement.js +2685 -764
- package/dist/chain/allowance.d.ts +358 -0
- package/dist/chain/allowance.js +800 -0
- package/dist/chain/billing.d.ts +85 -0
- package/dist/chain/billing.js +197 -0
- package/dist/chain/chainId.d.ts +13 -0
- package/dist/chain/chainId.js +26 -0
- package/dist/chain/client.d.ts +15 -1
- package/dist/chain/client.js +57 -1
- package/dist/chain/commitmentRecovery.d.ts +51 -0
- package/dist/chain/commitmentRecovery.js +38 -0
- package/dist/chain/committeeClient.d.ts +17 -10
- package/dist/chain/committeeClient.js +64 -16
- package/dist/chain/committeeDraw.d.ts +12 -0
- package/dist/chain/committeeDraw.js +56 -0
- package/dist/chain/custodyHealth.d.ts +212 -0
- package/dist/chain/custodyHealth.js +365 -0
- package/dist/chain/deployments.js +2 -0
- package/dist/chain/events.js +2 -0
- package/dist/chain/headFollower.d.ts +77 -0
- package/dist/chain/headFollower.js +219 -0
- package/dist/chain/headPrefetch.d.ts +23 -0
- package/dist/chain/headPrefetch.js +67 -0
- package/dist/chain/index.d.ts +50 -8
- package/dist/chain/index.js +28 -3
- package/dist/chain/keeperExecution.d.ts +44 -0
- package/dist/chain/keeperExecution.js +127 -0
- package/dist/chain/keeperRecovery.d.ts +78 -0
- package/dist/chain/keeperRecovery.js +91 -0
- package/dist/chain/node.d.ts +24 -1
- package/dist/chain/node.js +88 -43
- package/dist/chain/offchain.d.ts +2 -0
- package/dist/chain/paidAgentTransport.d.ts +38 -0
- package/dist/chain/paidAgentTransport.js +1 -0
- package/dist/chain/paidEpoch.d.ts +66 -0
- package/dist/chain/paidEpoch.js +139 -0
- package/dist/chain/paidPacing.d.ts +81 -0
- package/dist/chain/paidPacing.js +136 -0
- package/dist/chain/pinnedReads.d.ts +49 -0
- package/dist/chain/pinnedReads.js +218 -0
- package/dist/chain/prepaid.d.ts +383 -0
- package/dist/chain/prepaid.js +1046 -0
- package/dist/chain/prepaidEscape.d.ts +274 -0
- package/dist/chain/prepaidEscape.js +432 -0
- package/dist/chain/prepaidFault.d.ts +94 -0
- package/dist/chain/prepaidFault.js +148 -0
- package/dist/chain/receipt.d.ts +24 -0
- package/dist/chain/receipt.js +82 -0
- package/dist/chain/registeredAgent.d.ts +68 -3
- package/dist/chain/registeredAgent.js +143 -42
- package/dist/chain/registeredOperation.d.ts +10 -1
- package/dist/chain/registeredOperation.js +18 -3
- package/dist/chain/registeredPaidAgent.d.ts +254 -0
- package/dist/chain/registeredPaidAgent.js +889 -0
- package/dist/chain/registeredRelay.d.ts +31 -1
- package/dist/chain/registeredRelay.js +164 -43
- package/dist/chain/relayVoucher.d.ts +64 -0
- package/dist/chain/relayVoucher.js +69 -0
- package/dist/chain/reservation.d.ts +239 -0
- package/dist/chain/reservation.js +746 -0
- package/dist/chain/reshareRoster.d.ts +64 -0
- package/dist/chain/reshareRoster.js +85 -0
- package/dist/chain/revertReason.d.ts +8 -0
- package/dist/chain/revertReason.js +2 -1
- package/dist/chain/rotationLock.d.ts +130 -0
- package/dist/chain/rotationLock.js +168 -0
- package/dist/chain/serviceRequestPolicy.d.ts +47 -0
- package/dist/chain/serviceRequestPolicy.js +86 -0
- package/dist/chain/services.d.ts +7 -0
- package/dist/chain/services.js +44 -4
- package/dist/chain/slotClient.js +11 -2
- package/dist/chain/slotHandoff.d.ts +81 -0
- package/dist/chain/slotHandoff.js +166 -0
- package/dist/chain/slotSeed.d.ts +47 -5
- package/dist/chain/slotSeed.js +173 -42
- package/dist/chain/verifierSnapshot.d.ts +36 -0
- package/dist/chain/verifierSnapshot.js +197 -0
- package/dist/chain/write.d.ts +111 -21
- package/dist/chain/write.js +378 -146
- package/dist/committee/blsSharing.d.ts +53 -0
- package/dist/committee/blsSharing.js +90 -0
- package/dist/committee/client.d.ts +62 -23
- package/dist/committee/client.js +288 -72
- package/dist/committee/dual-operation.d.ts +165 -0
- package/dist/committee/dual-operation.js +229 -0
- package/dist/committee/dual-sign.d.ts +26 -1
- package/dist/committee/dual-sign.js +85 -7
- package/dist/committee/ecdsa.d.ts +38 -0
- package/dist/committee/ecdsa.js +87 -15
- package/dist/committee/evidence.d.ts +30 -0
- package/dist/committee/evidence.js +65 -0
- package/dist/committee/execution.d.ts +414 -0
- package/dist/committee/execution.js +446 -0
- package/dist/committee/extraction.js +33 -26
- package/dist/committee/index.d.ts +30 -7
- package/dist/committee/index.js +18 -6
- package/dist/committee/keeperExecution.d.ts +37 -0
- package/dist/committee/keeperExecution.js +141 -0
- package/dist/committee/oauth.d.ts +14 -4
- package/dist/committee/oauth.js +17 -5
- package/dist/committee/payment.d.ts +369 -0
- package/dist/committee/payment.js +339 -0
- package/dist/committee/recovery.d.ts +136 -0
- package/dist/committee/recovery.js +204 -0
- package/dist/committee/recoveryJson.d.ts +2 -0
- package/dist/committee/recoveryJson.js +87 -0
- package/dist/committee/request.d.ts +63 -27
- package/dist/committee/request.js +77 -66
- package/dist/committee/session-grant.d.ts +320 -0
- package/dist/committee/session-grant.js +397 -0
- package/dist/committee/status-refresh.d.ts +257 -0
- package/dist/committee/status-refresh.js +619 -0
- package/dist/committee/token.d.ts +163 -15
- package/dist/committee/token.js +247 -10
- package/dist/crypto/bn254.d.ts +70 -0
- package/dist/crypto/bn254.js +222 -0
- package/dist/crypto/ibe.d.ts +32 -0
- package/dist/crypto/ibe.js +56 -8
- package/dist/crypto/index.d.ts +1 -1
- package/dist/crypto/index.js +1 -1
- package/dist/crypto/kem.d.ts +31 -0
- package/dist/crypto/kem.js +113 -7
- package/dist/crypto/recipient.d.ts +75 -0
- package/dist/crypto/recipient.js +107 -0
- package/dist/decryption/client.d.ts +10 -16
- package/dist/decryption/client.js +8 -76
- package/dist/decryption/index.d.ts +2 -0
- package/dist/decryption/index.js +2 -0
- package/dist/decryption/sealed.d.ts +72 -0
- package/dist/decryption/sealed.js +147 -0
- package/dist/decryption/session.d.ts +115 -0
- package/dist/decryption/session.js +358 -0
- package/dist/errors.d.ts +406 -1
- package/dist/errors.js +400 -5
- package/dist/index.d.ts +9 -2
- package/dist/index.js +6 -1
- package/dist/internal/bounded.d.ts +66 -0
- package/dist/internal/bounded.js +126 -0
- package/dist/internal/network.d.ts +4 -0
- package/dist/internal/network.js +40 -0
- package/dist/internal/retryAfter.d.ts +8 -0
- package/dist/internal/retryAfter.js +28 -0
- package/dist/internal/sleep.d.ts +6 -0
- package/dist/internal/sleep.js +15 -0
- package/dist/internal/typedData.d.ts +13 -0
- package/dist/internal/typedData.js +77 -0
- package/dist/internal/viemErrors.d.ts +26 -0
- package/dist/internal/viemErrors.js +49 -0
- package/dist/oid4vp/binding.d.ts +27 -1
- package/dist/oid4vp/binding.js +36 -1
- package/dist/oid4vp/jose.d.ts +4 -2
- package/dist/oid4vp/jose.js +39 -7
- package/dist/oid4vp/request-object.d.ts +61 -4
- package/dist/oid4vp/request-object.js +140 -5
- package/dist/oid4vp/verifier-agent.d.ts +18 -8
- package/dist/oid4vp/verifier-agent.js +48 -6
- package/dist/oid4vp/wallet.d.ts +2 -4
- package/dist/oid4vp/wallet.js +1 -0
- package/dist/retry.d.ts +78 -0
- package/dist/retry.js +137 -0
- package/dist/signing/frost.d.ts +1 -1
- package/dist/verifier-agent/index.d.ts +41 -5
- package/dist/verifier-agent/index.js +124 -9
- package/dist/verifier-agent/payment.d.ts +7 -0
- package/dist/verifier-agent/payment.js +17 -0
- package/docs/api.md +8 -2
- package/docs/application-api.md +25 -2
- package/docs/chain.md +155 -9
- package/docs/consumer-migrations.md +61 -0
- package/docs/encrypted-notes.md +3 -2
- package/docs/encryption.md +4 -2
- package/docs/errors.md +14 -1
- package/docs/flows.md +2 -2
- package/docs/funding.md +902 -0
- package/docs/native-approvals.md +63 -0
- package/docs/reference/README.md +9 -8
- package/docs/reference/app-browser.md +232 -0
- package/docs/reference/app-node.md +38 -8
- package/docs/reference/app.md +4621 -805
- package/docs/reference/chain-node.md +74 -16
- package/docs/reference/chain.md +6740 -1592
- package/docs/reference/committee.md +5630 -987
- package/docs/reference/main.md +1439 -140
- package/docs/reference/oid4vp.md +297 -144
- package/docs/reference/verifier-agent.md +77 -35
- package/docs/signing.md +6 -0
- package/examples/encrypted-notes.ts +21 -6
- package/examples/getting-started.ts +2 -7
- package/examples/live-config.ts +24 -17
- package/package.json +17 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tasra-sdk/verifier-agent
|
|
2
2
|
|
|
3
3
|
Generated from public TypeScript exports.
|
|
4
4
|
|
|
@@ -21,9 +21,9 @@ A Verifier Agent session did not produce a compound token. `kind` says why;
|
|
|
21
21
|
`retryable` is true only for `timeout` and `unavailable` - the session may
|
|
22
22
|
still complete, so poll again. Extends ` TasraError `.
|
|
23
23
|
|
|
24
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
24
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L152)
|
|
25
25
|
|
|
26
|
-
Import: `import {VerifierAgentSessionError} from '
|
|
26
|
+
Import: `import {VerifierAgentSessionError} from 'tasra-sdk/verifier-agent'`
|
|
27
27
|
|
|
28
28
|
```ts
|
|
29
29
|
declare class VerifierAgentSessionError {
|
|
@@ -71,9 +71,9 @@ Operations you can import and call.
|
|
|
71
71
|
The compound token the verifier-agent hands back must be the wire shape the keepers verify -
|
|
72
72
|
checked field by field before anything is built on it.
|
|
73
73
|
|
|
74
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
74
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L180)
|
|
75
75
|
|
|
76
|
-
Import: `import {assertCompoundTokenWire} from '
|
|
76
|
+
Import: `import {assertCompoundTokenWire} from 'tasra-sdk/verifier-agent'`
|
|
77
77
|
|
|
78
78
|
```ts
|
|
79
79
|
declare function assertCompoundTokenWire(raw: unknown, correlation: string): Record<string, unknown>;
|
|
@@ -92,9 +92,9 @@ Open an `oauth` session - same creator authorisation, same committee draw, same
|
|
|
92
92
|
derived nonce, same poll contract as [createOid4vpSession](#createoid4vpsession). No QR, no Request
|
|
93
93
|
Object, no JWE key: the client presents an access token its own IdP minted.
|
|
94
94
|
|
|
95
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
95
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L314)
|
|
96
96
|
|
|
97
|
-
Import: `import {createOauthSession} from '
|
|
97
|
+
Import: `import {createOauthSession} from 'tasra-sdk/verifier-agent'`
|
|
98
98
|
|
|
99
99
|
```ts
|
|
100
100
|
declare function createOauthSession(verifierAgentUrl: string, params: CreateSessionParams): Promise<CreateOauthSessionResult>;
|
|
@@ -115,9 +115,9 @@ The verifier-agent derives a nonce, generates an ECDH key for JWE, and returns a
|
|
|
115
115
|
payload the wallet scans. The session ID and poll secret are used to poll
|
|
116
116
|
for the result.
|
|
117
117
|
|
|
118
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
118
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L272)
|
|
119
119
|
|
|
120
|
-
Import: `import {createOid4vpSession} from '
|
|
120
|
+
Import: `import {createOid4vpSession} from 'tasra-sdk/verifier-agent'`
|
|
121
121
|
|
|
122
122
|
```ts
|
|
123
123
|
declare function createOid4vpSession(verifierAgentUrl: string, params: CreateSessionParams): Promise<CreateSessionResult>;
|
|
@@ -135,9 +135,9 @@ Returns: ` Promise<CreateSessionResult> `.
|
|
|
135
135
|
The next polling delay: geometric growth (times1.5) capped at `max`, plus or minus20 % full jitter.
|
|
136
136
|
Pure, so the schedule is testable without timers.
|
|
137
137
|
|
|
138
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
138
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L589)
|
|
139
139
|
|
|
140
|
-
Import: `import {nextPollDelay} from '
|
|
140
|
+
Import: `import {nextPollDelay} from 'tasra-sdk/verifier-agent'`
|
|
141
141
|
|
|
142
142
|
```ts
|
|
143
143
|
declare function nextPollDelay(previousMs: number, baseMs: number, maxMs: number, random?: () => number): number;
|
|
@@ -156,9 +156,9 @@ Returns: ` number `.
|
|
|
156
156
|
|
|
157
157
|
Shared validation for the explicit-URL and registered-agent transports.
|
|
158
158
|
|
|
159
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
159
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L538)
|
|
160
160
|
|
|
161
|
-
Import: `import {parseVerifierAgentSessionStatus} from '
|
|
161
|
+
Import: `import {parseVerifierAgentSessionStatus} from 'tasra-sdk/verifier-agent'`
|
|
162
162
|
|
|
163
163
|
```ts
|
|
164
164
|
declare function parseVerifierAgentSessionStatus(data: Record<string, unknown>, sessionId: string): SessionStatusResult;
|
|
@@ -178,9 +178,9 @@ Compute the `payload_digest` for a given action and message.
|
|
|
178
178
|
For `sign` and `ibe-extract`, this is `sha256(message_bytes)` as 0x-hex.
|
|
179
179
|
Other actions should supply the digest directly.
|
|
180
180
|
|
|
181
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
181
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L249)
|
|
182
182
|
|
|
183
|
-
Import: `import {payloadDigest} from '
|
|
183
|
+
Import: `import {payloadDigest} from 'tasra-sdk/verifier-agent'`
|
|
184
184
|
|
|
185
185
|
```ts
|
|
186
186
|
declare function payloadDigest(action: string, messageHex: string): string;
|
|
@@ -195,14 +195,14 @@ Returns: ` string `.
|
|
|
195
195
|
|
|
196
196
|
### pollOid4vpSession
|
|
197
197
|
|
|
198
|
-
Fetch and validate one authorization session status. Transport failures and HTTP 502, 503 or 504 produce an unavailable error; malformed or other failed replies produce a protocol error. The polling secret is sent in the Authorization header.
|
|
198
|
+
Fetch and validate one authorization session status. Transport failures, a request that exceeds its timeout and HTTP 502, 503 or 504 produce an unavailable error; malformed or other failed replies produce a protocol error; an aborted signal produces a cancelled error. The polling secret is sent in the Authorization header.
|
|
199
199
|
|
|
200
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
200
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L483)
|
|
201
201
|
|
|
202
|
-
Import: `import {pollOid4vpSession} from '
|
|
202
|
+
Import: `import {pollOid4vpSession} from 'tasra-sdk/verifier-agent'`
|
|
203
203
|
|
|
204
204
|
```ts
|
|
205
|
-
declare function pollOid4vpSession(verifierAgentUrl: string, sessionId: string, pollSecret: string): Promise<SessionStatusResult>;
|
|
205
|
+
declare function pollOid4vpSession(verifierAgentUrl: string, sessionId: string, pollSecret: string, opts?: PollSessionOpts): Promise<SessionStatusResult>;
|
|
206
206
|
```
|
|
207
207
|
|
|
208
208
|
| Parameter | Type | Description |
|
|
@@ -210,6 +210,7 @@ declare function pollOid4vpSession(verifierAgentUrl: string, sessionId: string,
|
|
|
210
210
|
| ` verifierAgentUrl ` | ` string ` | - Verifier-agent HTTP base URL. |
|
|
211
211
|
| ` sessionId ` | ` string ` | - Opened session identifier. |
|
|
212
212
|
| ` pollSecret ` | ` string ` | - Secret returned at session creation; do not expose it in logs. |
|
|
213
|
+
| ` opts? ` | ` PollSessionOpts ` | - Long-poll request, cancellation and per-request timeout. |
|
|
213
214
|
|
|
214
215
|
Returns: ` Promise<SessionStatusResult> `.
|
|
215
216
|
|
|
@@ -235,9 +236,9 @@ Throws `VerifierAgentSessionError`: `refused` when the agent reports the session
|
|
|
235
236
|
(the committee refused, or could not be reached — `message` says which; not retryable on
|
|
236
237
|
this session), `unavailable` for other 502/503/504, `protocol` for any other non-2xx.
|
|
237
238
|
|
|
238
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
239
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L387)
|
|
239
240
|
|
|
240
|
-
Import: `import {submitOauthResponse} from '
|
|
241
|
+
Import: `import {submitOauthResponse} from 'tasra-sdk/verifier-agent'`
|
|
241
242
|
|
|
242
243
|
```ts
|
|
243
244
|
declare function submitOauthResponse(verifierAgentUrl: string, args: {
|
|
@@ -261,14 +262,20 @@ Returns: ` Promise<void> `.
|
|
|
261
262
|
|
|
262
263
|
Poll until the session reaches a terminal state (done or failed) - bounded by
|
|
263
264
|
`timeoutMs`, with a growing jittered interval so many clients never poll in lock-step.
|
|
265
|
+
Every request asks the verifier-agent to hold its reply until the session moves
|
|
266
|
+
(`?wait=1`). A reply whose phase moved forward is followed by the next request at once;
|
|
267
|
+
an unchanged reply is followed by the backoff sleep, unless it took 15 s or more (the
|
|
268
|
+
server's hold ended), when the next request also goes at once. A server without long-poll
|
|
269
|
+
support answers at once and is polled on the backoff schedule. Any phase change resets the
|
|
270
|
+
backoff to `intervalMs`.
|
|
264
271
|
A transient `unavailable` answer (a 503, a dropped connection) is retried within the
|
|
265
272
|
deadline; a `protocol` answer stops at once; the deadline is a `timeout` error; the
|
|
266
273
|
caller's `signal` is a `cancelled` error. A terminal `failed` is RETURNED (the caller
|
|
267
274
|
decides how to explain it) - see `awaitVerifierAgentResult` for the version that throws `refused`.
|
|
268
275
|
|
|
269
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
276
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L620)
|
|
270
277
|
|
|
271
|
-
Import: `import {waitForSession} from '
|
|
278
|
+
Import: `import {waitForSession} from 'tasra-sdk/verifier-agent'`
|
|
272
279
|
|
|
273
280
|
```ts
|
|
274
281
|
declare function waitForSession(verifierAgentUrl: string, sessionId: string, pollSecret: string, intervalMs?: number, timeoutMs?: number, opts?: WaitOpts): Promise<SessionStatusResult>;
|
|
@@ -290,11 +297,12 @@ Returns: ` Promise<SessionStatusResult> `.
|
|
|
290
297
|
Options, data structures and return types.
|
|
291
298
|
|
|
292
299
|
<details>
|
|
293
|
-
<summary>Browse
|
|
300
|
+
<summary>Browse 10 types</summary>
|
|
294
301
|
|
|
295
302
|
- [CreateOauthSessionResult](#createoauthsessionresult)
|
|
296
303
|
- [CreateSessionParams](#createsessionparams)
|
|
297
304
|
- [CreateSessionResult](#createsessionresult)
|
|
305
|
+
- [PollSessionOpts](#pollsessionopts)
|
|
298
306
|
- [PresentationDelegation](#presentationdelegation)
|
|
299
307
|
- [PresentationOperation](#presentationoperation)
|
|
300
308
|
- [SessionPhase](#sessionphase)
|
|
@@ -308,7 +316,7 @@ Options, data structures and return types.
|
|
|
308
316
|
|
|
309
317
|
an `oauth` session - the client brings a DPoP-bound access token.
|
|
310
318
|
|
|
311
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
319
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L93)
|
|
312
320
|
|
|
313
321
|
```ts
|
|
314
322
|
export interface CreateOauthSessionResult {
|
|
@@ -332,10 +340,13 @@ Fields:
|
|
|
332
340
|
|
|
333
341
|
Signed operation, optional delegation and payload submitted to the verifier agent.
|
|
334
342
|
|
|
335
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
343
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L63)
|
|
336
344
|
|
|
337
345
|
```ts
|
|
338
346
|
export interface CreateSessionParams {
|
|
347
|
+
decryption?: DecryptionBindingWire;
|
|
348
|
+
payment?: PaymentIntentWire;
|
|
349
|
+
random?: string;
|
|
339
350
|
operation: PresentationOperation;
|
|
340
351
|
operationSig: string;
|
|
341
352
|
delegation?: PresentationDelegation;
|
|
@@ -345,6 +356,9 @@ export interface CreateSessionParams {
|
|
|
345
356
|
|
|
346
357
|
Fields:
|
|
347
358
|
|
|
359
|
+
- **` decryption `**: Public decryption binding committed by the signed operation; never include private recipient material.
|
|
360
|
+
- **` payment `**: Creator-signed intent for an already reserved TASRA payment. Requires random.
|
|
361
|
+
- **` random `**: Fixed 32-byte hex presentation random committed before reservation.
|
|
348
362
|
- **` operation `**: Signed operation details presented for authorization.
|
|
349
363
|
- **` operationSig `**: 0x-hex 65-byte EIP-712 signature over the operation
|
|
350
364
|
- **` delegation `**: Optional EIP-712 delegation from the slot creator
|
|
@@ -354,7 +368,7 @@ Fields:
|
|
|
354
368
|
|
|
355
369
|
Wallet presentation link and polling credentials for an opened authorization session.
|
|
356
370
|
|
|
357
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
371
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L81)
|
|
358
372
|
|
|
359
373
|
```ts
|
|
360
374
|
export interface CreateSessionResult {
|
|
@@ -372,11 +386,31 @@ Fields:
|
|
|
372
386
|
- **` qrPayload `**: OpenID4VP deep link for a wallet or QR code.
|
|
373
387
|
- **` requestUri `**: URL from which the wallet retrieves the signed request.
|
|
374
388
|
|
|
389
|
+
### PollSessionOpts
|
|
390
|
+
|
|
391
|
+
Options for one session status request.
|
|
392
|
+
|
|
393
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L466)
|
|
394
|
+
|
|
395
|
+
```ts
|
|
396
|
+
export interface PollSessionOpts {
|
|
397
|
+
wait?: boolean;
|
|
398
|
+
signal?: AbortSignal;
|
|
399
|
+
timeoutMs?: number;
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
Fields:
|
|
404
|
+
|
|
405
|
+
- **` wait `**: Ask the verifier-agent to hold the reply until the session status or phase changes (`?wait=1`, up to 20 s). A server without that support answers at once.
|
|
406
|
+
- **` signal `**: Cancel the request: rejects with `cancelled`.
|
|
407
|
+
- **` timeoutMs `**: Per-request ceiling in milliseconds (default 30000, which covers the 20 s hold); a reply that does not arrive in time is `unavailable`.
|
|
408
|
+
|
|
375
409
|
### PresentationDelegation
|
|
376
410
|
|
|
377
411
|
EIP-712 delegation from the slot creator to a delegate address.
|
|
378
412
|
|
|
379
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
413
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L45)
|
|
380
414
|
|
|
381
415
|
```ts
|
|
382
416
|
export interface PresentationDelegation {
|
|
@@ -404,7 +438,7 @@ Fields:
|
|
|
404
438
|
|
|
405
439
|
Operation details signed by a slot creator or delegate for credential authorization.
|
|
406
440
|
|
|
407
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
441
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L29)
|
|
408
442
|
|
|
409
443
|
```ts
|
|
410
444
|
export interface PresentationOperation {
|
|
@@ -430,7 +464,7 @@ Fields:
|
|
|
430
464
|
|
|
431
465
|
Displayable authorization progress. A done phase means the committee answered; it does not mean the requested signing or decryption operation executed.
|
|
432
466
|
|
|
433
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
467
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L107)
|
|
434
468
|
|
|
435
469
|
```ts
|
|
436
470
|
export type SessionPhase = 'awaiting_wallet' | 'verifying' | 'done' | 'failed';
|
|
@@ -440,36 +474,44 @@ export type SessionPhase = 'awaiting_wallet' | 'verifying' | 'done' | 'failed';
|
|
|
440
474
|
|
|
441
475
|
Authorization session progress and optional committee result or failure detail.
|
|
442
476
|
|
|
443
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
477
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L110)
|
|
444
478
|
|
|
445
479
|
```ts
|
|
446
480
|
export interface SessionStatusResult {
|
|
481
|
+
evidenceCt?: string;
|
|
447
482
|
status: 'pending' | 'done' | 'failed';
|
|
448
483
|
phase: SessionPhase;
|
|
449
484
|
compoundToken?: Record<string, unknown>;
|
|
450
485
|
verifierProofs?: unknown;
|
|
451
486
|
bindingPreimage?: Record<string, unknown>;
|
|
452
487
|
error?: string;
|
|
453
|
-
|
|
488
|
+
sessionGrant?: {
|
|
489
|
+
grant?: {
|
|
490
|
+
session_grant: SessionGrantWire;
|
|
491
|
+
refresh_seq: 0;
|
|
492
|
+
};
|
|
493
|
+
error?: string;
|
|
494
|
+
};
|
|
454
495
|
}
|
|
455
496
|
```
|
|
456
497
|
|
|
457
498
|
Fields:
|
|
458
499
|
|
|
500
|
+
- **` evidenceCt `**: Sealed presentation (base64url `bincode(Ciphertext)`) the token's `evidence_hash` names, retained unchanged and posted to the keeper beside the token as `evidence_ct`.
|
|
459
501
|
- **` status `**: Pending, completed or failed authorization state.
|
|
460
502
|
- **` phase `**: Displayable progress within the authorization lifecycle.
|
|
461
503
|
- **` compoundToken `**: Committee token returned after successful authorization.
|
|
462
504
|
- **` verifierProofs `**: Verifier membership proofs for the selected snapshot.
|
|
463
505
|
- **` bindingPreimage `**: Operation context used to derive the request-binding hash.
|
|
464
506
|
- **` error `**: Optional failure detail reported by the verifier agent.
|
|
465
|
-
- **`
|
|
507
|
+
- **` sessionGrant `**: Session mode, once `done`: the grant the paid session client verified against the anchored draw (`refresh_seq` 0), or why none came with the token. Absent otherwise.
|
|
466
508
|
|
|
467
509
|
### VerifierAgentSessionErrorKind
|
|
468
510
|
|
|
469
511
|
Why a session did not yield a token - the class the UI explains, with a NON-SECRET
|
|
470
512
|
correlation reference (the session id; the poll secret is never part of an error).
|
|
471
513
|
|
|
472
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
514
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L135)
|
|
473
515
|
|
|
474
516
|
```ts
|
|
475
517
|
export type VerifierAgentSessionErrorKind = 'timeout' | 'refused' | 'unavailable' | 'protocol' | 'cancelled';
|
|
@@ -479,7 +521,7 @@ export type VerifierAgentSessionErrorKind = 'timeout' | 'refused' | 'unavailable
|
|
|
479
521
|
|
|
480
522
|
Polling backoff, cancellation, progress callback and randomness options.
|
|
481
523
|
|
|
482
|
-
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#
|
|
524
|
+
[Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L569)
|
|
483
525
|
|
|
484
526
|
```ts
|
|
485
527
|
export interface WaitOpts {
|
package/docs/signing.md
CHANGED
|
@@ -53,6 +53,12 @@ Install with `npm install @t3foundry/tasra-sdk@latest`. The application uses
|
|
|
53
53
|
|
|
54
54
|
## Advanced committee signing adapter
|
|
55
55
|
|
|
56
|
+
Keeper discovery and each committee signing request have separate 15-second
|
|
57
|
+
deadlines. A signing timeout is an uncertain outcome: the keeper may have started
|
|
58
|
+
work. Reconcile the original paid operation before submitting anything again.
|
|
59
|
+
Leave the optional FROST signer set unset to let the keeper select responsive
|
|
60
|
+
eligible participants. A paid request stays pinned to its assigned coordinator.
|
|
61
|
+
|
|
56
62
|
The lower-level operation below is for integrations that need explicit control
|
|
57
63
|
over the digest and verifier session.
|
|
58
64
|
|
|
@@ -4,6 +4,8 @@ import {sha256} from '@noble/hashes/sha256'
|
|
|
4
4
|
import {utf8ToBytes} from '@noble/hashes/utils'
|
|
5
5
|
import {decryptPayloadDigest} from '@t3foundry/tasra-sdk/oid4vp'
|
|
6
6
|
import type {ReadySlotJournal} from '@t3foundry/tasra-sdk/app'
|
|
7
|
+
import {createDecryptionRecipient, hexToBytes} from '@t3foundry/tasra-sdk'
|
|
8
|
+
import {discoverBlsSharing} from '@t3foundry/tasra-sdk/committee'
|
|
7
9
|
import {createTutorial} from './tutorial-support.js'
|
|
8
10
|
|
|
9
11
|
async function main() {
|
|
@@ -35,8 +37,22 @@ async function main() {
|
|
|
35
37
|
dataKey.fill(0)
|
|
36
38
|
await store.save('encrypted-document', {recordId, aad, kemCt, aesCt, iv})
|
|
37
39
|
|
|
38
|
-
// Alice presents her credential to authorize decryption.
|
|
39
|
-
|
|
40
|
+
// Alice presents her credential to authorize decryption. The client creates a fresh recipient and
|
|
41
|
+
// reads the slot's authenticated verifying shares; keepers seal their shares to that recipient and
|
|
42
|
+
// the client verifies and combines them, so the data key is never assembled on a keeper.
|
|
43
|
+
const sealed = async () => {
|
|
44
|
+
const chain = tasra.chain, slot = notes.slotId
|
|
45
|
+
const [canonical, chainId, operators] = await Promise.all([chain.readers.keyRegistry.getKeySlot(slot),
|
|
46
|
+
chain.client.getChainId(), chain.readers.keyRegistry.assignedNodes(slot)])
|
|
47
|
+
const keepers = await Promise.all(operators.map(async operator => {
|
|
48
|
+
const node = await chain.readers.nodeRegistry.nodeOf(operator)
|
|
49
|
+
return {operator, nodeUrl: node.url, publicKey: hexToBytes(node.pubkey)}
|
|
50
|
+
}))
|
|
51
|
+
const sharing = await discoverBlsSharing({chainId, slotId: slot, epoch: Number(canonical.epoch),
|
|
52
|
+
committeeVersion: Number(canonical.committeeVersion), threshold: canonical.threshold.k, keepers})
|
|
53
|
+
return {recipient: await createDecryptionRecipient(), verifyingShares: sharing.verifyingShares}
|
|
54
|
+
}
|
|
55
|
+
const opened = await notes.decrypt(aad, kemCt, {...await sealed(), authorize: authorize('alice'),
|
|
40
56
|
signal: AbortSignal.timeout(120_000), requireReceipts: true})
|
|
41
57
|
let openedNote: Uint8Array | undefined
|
|
42
58
|
try {
|
|
@@ -56,7 +72,7 @@ async function main() {
|
|
|
56
72
|
const tamperedAead = kemCt.aeadCt.slice() as Uint8Array
|
|
57
73
|
tamperedAead[0]! ^= 1
|
|
58
74
|
const tampered = {u: kemCt.u.slice(), nonce: kemCt.nonce.slice(), aeadCt: tamperedAead}
|
|
59
|
-
const bad = await notes.decrypt(aad, tampered, {authorize: authorize('alice'),
|
|
75
|
+
const bad = await notes.decrypt(aad, tampered, {...await sealed(), authorize: authorize('alice'),
|
|
60
76
|
signal: AbortSignal.timeout(120_000), requireReceipts: true})
|
|
61
77
|
bad.plaintext.fill(0) // unreachable; throw before zeroizing
|
|
62
78
|
} catch (error) {
|
|
@@ -73,8 +89,7 @@ async function main() {
|
|
|
73
89
|
save('evidence.json', {chainId: tasra.deployment.chainId, addresses: tasra.deployment.addresses,
|
|
74
90
|
slotId: notes.slotId, creation: {slotId: notes.slotId, commitTx, revealTx, targetEpoch, seeded},
|
|
75
91
|
createdAt: new Date().toISOString(), alice: 'decrypted', bob: refusal, tamperRejected,
|
|
76
|
-
shareTrust: opened.shareTrust
|
|
77
|
-
status: e.receiptStatus}))})
|
|
92
|
+
shareTrust: opened.shareTrust})
|
|
78
93
|
console.log(`PASS: Alice decrypted, Bob refused by verifier, tamper rejected. Evidence: ${directory}/evidence.json`)
|
|
79
94
|
}
|
|
80
95
|
|
|
@@ -83,4 +98,4 @@ main().catch((error: unknown) => {
|
|
|
83
98
|
const message = (error instanceof Error ? error.message : String(error)).replace(/eyJ[\w-]+\.[\w-]+\.[\w-]+(?:~[\w.-]*)*/g, '[credential omitted]')
|
|
84
99
|
console.error(`Stopped: ${message}`)
|
|
85
100
|
process.exitCode = 1
|
|
86
|
-
})
|
|
101
|
+
})
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
// A provisioned, non-exportable BLS slot and an issuer credential are prerequisites.
|
|
2
2
|
// No operator/admin credentials are used in this application example.
|
|
3
3
|
import {fromBytes} from '@t3foundry/tasra-sdk'
|
|
4
|
-
import {committeeClient,
|
|
4
|
+
import {committeeClient, sealedDecryptOptions, loadHolder, loadNetwork, slotId} from './live-config.ts'
|
|
5
5
|
|
|
6
6
|
const network = await loadNetwork()
|
|
7
7
|
const slot = slotId()
|
|
8
8
|
const identity = loadHolder()
|
|
9
9
|
try {
|
|
10
10
|
const client = committeeClient(network.chain, slot, identity, 'decrypt')
|
|
11
|
-
const peers = await decryptPeers(network.chain, slot)
|
|
12
11
|
// UTF-8 AAD is required by the threshold HTTP protocol.
|
|
13
12
|
const envelope = fromBytes(await client.encrypt(slot, new TextEncoder().encode('Hello Tasra'), {
|
|
14
13
|
identity: new TextEncoder().encode(slot),
|
|
15
14
|
}))
|
|
16
|
-
const plaintext = await client.decrypt(slot,
|
|
17
|
-
ciphertext: envelope.ciphertext, identity: envelope.identity,
|
|
18
|
-
ciphertextEpoch: envelope.epoch === null ? undefined : Number(envelope.epoch),
|
|
19
|
-
decryptingSet: peers.map(p => p.id), blsPeers: peers,
|
|
20
|
-
})
|
|
15
|
+
const plaintext = await client.decrypt(slot, await sealedDecryptOptions(network.chain, slot, envelope))
|
|
21
16
|
if (new TextDecoder().decode(plaintext) !== 'Hello Tasra') throw new Error('Threshold round trip failed')
|
|
22
17
|
console.log('Threshold decrypt succeeded; the master key was not exported.')
|
|
23
18
|
} finally {
|
package/examples/live-config.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// Node example utilities, not part of the SDK's public API.
|
|
2
|
+
import {randomBytes} from 'node:crypto'
|
|
3
|
+
import type {Hex} from 'viem'
|
|
2
4
|
import {readFileSync} from 'node:fs'
|
|
3
|
-
import {ed25519DidKey, hexToBytes, type HolderSigner} from '@t3foundry/tasra-sdk'
|
|
5
|
+
import {ed25519DidKey, hexToBytes, createDecryptionRecipient, decryptionBinding, kemContentDigest, type HolderSigner, type Ciphertext} from '@t3foundry/tasra-sdk'
|
|
4
6
|
import {
|
|
5
7
|
addressBookFromManifest, createTasraChainClient, parsePinnedNetworkManifest,
|
|
6
|
-
observeNetworkManifest,
|
|
7
|
-
createCommitteeSlotClient, type TasraChainClient,
|
|
8
|
+
observeNetworkManifest,
|
|
9
|
+
createCommitteeSlotClient, type TasraChainClient, type SlotCommitteeDecryptOptions,
|
|
8
10
|
} from '@t3foundry/tasra-sdk/chain'
|
|
9
|
-
import {
|
|
11
|
+
import {discoverBlsSharing, holderProofPerVerifier} from '@t3foundry/tasra-sdk/committee'
|
|
12
|
+
import {ed25519} from '@noble/curves/ed25519'
|
|
10
13
|
|
|
11
14
|
export function required(name: string, env: NodeJS.ProcessEnv = process.env): string {
|
|
12
15
|
const value = env[name]?.trim()
|
|
@@ -39,7 +42,7 @@ export function loadHolder(prefix = 'KK') {
|
|
|
39
42
|
if (!Array.isArray(credentials) || !credentials.length || !credentials.every(v => typeof v === 'string' && v.length > 0)) {
|
|
40
43
|
throw new Error('Credentials file must be a nonempty JSON array of compact-JWS credentials')
|
|
41
44
|
}
|
|
42
|
-
const holder = ed25519DidKey(
|
|
45
|
+
const holder = ed25519DidKey(ed25519.getPublicKey(secretKey))
|
|
43
46
|
const signer: HolderSigner = {alg: 'EdDSA', did: holder, secretKey}
|
|
44
47
|
return {holder, signer, secretKey, credentials: credentials as string[]}
|
|
45
48
|
} catch (error) {
|
|
@@ -50,22 +53,26 @@ export function loadHolder(prefix = 'KK') {
|
|
|
50
53
|
|
|
51
54
|
export function committeeClient(chain: TasraChainClient, slot: string, identity: ReturnType<typeof loadHolder>, action: 'sign' | 'decrypt') {
|
|
52
55
|
return createCommitteeSlotClient({chain, holder: identity.holder, credentials: identity.credentials,
|
|
53
|
-
clientSigner: ed25519ClientSigner(identity.secretKey),
|
|
54
56
|
holderProof: holderProofPerVerifier({signer: identity.signer, credentials: identity.credentials,
|
|
55
57
|
audience: required('KK_VERIFIER_AUDIENCE'), slotId: slot, action}),
|
|
56
58
|
})
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
/** Prepare the original client recipient and authenticated sharing before holder authorization. */
|
|
62
|
+
export async function sealedDecryptOptions(chain: TasraChainClient, slot: Hex,
|
|
63
|
+
envelope: {ciphertext: Ciphertext; identity: Uint8Array; epoch: bigint | null}): Promise<SlotCommitteeDecryptOptions> {
|
|
64
|
+
const [canonical, chainId, operators] = await Promise.all([
|
|
65
|
+
chain.readers.keyRegistry.getKeySlot(slot), chain.client.getChainId(), chain.readers.keyRegistry.assignedNodes(slot),
|
|
66
|
+
])
|
|
67
|
+
if (!canonical.exists || canonical.mode !== 1 || envelope.epoch === null || envelope.epoch !== BigInt(canonical.epoch)) throw new Error('Envelope is not for the canonical BLS slot epoch')
|
|
68
|
+
const keepers = await Promise.all(operators.map(async operator => {
|
|
69
|
+
const node = await chain.readers.nodeRegistry.nodeOf(operator)
|
|
70
|
+
return {operator, nodeUrl: node.url, publicKey: hexToBytes(node.pubkey)}
|
|
68
71
|
}))
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
const epoch = Number(canonical.epoch), threshold = canonical.threshold.k
|
|
73
|
+
const sharing = await discoverBlsSharing({chainId,slotId:slot,epoch,committeeVersion:Number(canonical.committeeVersion),threshold,keepers})
|
|
74
|
+
const recipient = await createDecryptionRecipient()
|
|
75
|
+
const {payloadDigest} = decryptionBinding(kemContentDigest(envelope.ciphertext,envelope.identity),epoch,recipient)
|
|
76
|
+
return {ciphertext:envelope.ciphertext,identity:envelope.identity,ciphertextEpoch:epoch,recipient,threshold,verifyingShares:sharing.verifyingShares,
|
|
77
|
+
binding:{chainId,action:'decrypt',payloadDigest,random:randomBytes(32),clientId:required('KK_VERIFIER_AUDIENCE')}}
|
|
71
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t3foundry/tasra-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "TypeScript SDK for Tasra network slots, credential-based access, distributed encryption and signing, and on-chain operations.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"app/node": [
|
|
31
31
|
"./dist/app/node.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"app/browser": [
|
|
34
|
+
"./dist/app/browser.d.ts"
|
|
32
35
|
]
|
|
33
36
|
}
|
|
34
37
|
},
|
|
@@ -73,6 +76,11 @@
|
|
|
73
76
|
"types": "./dist/app/node.d.ts",
|
|
74
77
|
"import": "./dist/app/node.js",
|
|
75
78
|
"default": "./dist/app/node.js"
|
|
79
|
+
},
|
|
80
|
+
"./app/browser": {
|
|
81
|
+
"types": "./dist/app/browser.d.ts",
|
|
82
|
+
"import": "./dist/app/browser.js",
|
|
83
|
+
"default": "./dist/app/browser.js"
|
|
76
84
|
}
|
|
77
85
|
},
|
|
78
86
|
"sideEffects": false,
|
|
@@ -114,6 +122,7 @@
|
|
|
114
122
|
"docs/prerequisites.md",
|
|
115
123
|
"docs/read-slot.md",
|
|
116
124
|
"docs/reference/README.md",
|
|
125
|
+
"docs/reference/app-browser.md",
|
|
117
126
|
"docs/reference/app-node.md",
|
|
118
127
|
"docs/reference/app.md",
|
|
119
128
|
"docs/reference/chain-node.md",
|
|
@@ -222,9 +231,9 @@
|
|
|
222
231
|
"docs:build": "npm run build --prefix site",
|
|
223
232
|
"verify:document-app": "node test/document-app-check.mjs",
|
|
224
233
|
"verify": "node scripts/verify.mjs",
|
|
225
|
-
"verify:infrastructure": "node --test scripts/verify-infrastructure.test.mjs scripts/git-hooks.test.mjs scripts/api-surface.test.mjs scripts/api-changes.test.mjs scripts/quality.test.mjs scripts/performance.test.mjs scripts/publication.test.mjs scripts/release-tag.test.mjs scripts/rego-pins.test.mjs",
|
|
234
|
+
"verify:infrastructure": "node --test scripts/verify-infrastructure.test.mjs scripts/git-hooks.test.mjs scripts/api-surface.test.mjs scripts/api-changes.test.mjs scripts/quality.test.mjs scripts/performance.test.mjs scripts/publication.test.mjs scripts/release-tag.test.mjs scripts/certified-release.test.mjs scripts/audit.test.mjs scripts/rego-pins.test.mjs",
|
|
226
235
|
"verify:repository": "node scripts/verify-repository.mjs && node scripts/check-rego-pins.mjs && npm run api:changes",
|
|
227
|
-
"verify:security": "
|
|
236
|
+
"verify:security": "node scripts/audit.mjs && npm audit signatures",
|
|
228
237
|
"verify:site": "npm ci --prefix site && npm run docs:build",
|
|
229
238
|
"api:changes": "node scripts/api-changes.mjs",
|
|
230
239
|
"quality": "node scripts/quality.mjs",
|
|
@@ -246,9 +255,12 @@
|
|
|
246
255
|
},
|
|
247
256
|
"dependencies": {
|
|
248
257
|
"@noble/ciphers": "^1.0.0",
|
|
249
|
-
"@noble/curves": "^1.
|
|
258
|
+
"@noble/curves": "^1.9.7",
|
|
250
259
|
"@noble/hashes": "^1.5.0",
|
|
251
|
-
"viem": "^2.56.8"
|
|
260
|
+
"viem": "^2.56.8",
|
|
261
|
+
"@hpke/core": "1.9.0",
|
|
262
|
+
"@hpke/chacha20poly1305": "1.7.1",
|
|
263
|
+
"@hpke/dhkem-x25519": "1.6.4"
|
|
252
264
|
},
|
|
253
265
|
"devDependencies": {
|
|
254
266
|
"@arethetypeswrong/cli": "^0.18.2",
|