@t3foundry/tasra-sdk 0.0.0-stage → 0.3.1-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +94 -0
  4. package/README.md +137 -2
  5. package/SECURITY.md +115 -0
  6. package/dist/app/approvals.d.ts +50 -0
  7. package/dist/app/approvals.js +90 -0
  8. package/dist/app/authorization.d.ts +19 -0
  9. package/dist/app/authorization.js +20 -0
  10. package/dist/app/client.d.ts +231 -0
  11. package/dist/app/client.js +272 -0
  12. package/dist/app/creation.d.ts +73 -0
  13. package/dist/app/creation.js +77 -0
  14. package/dist/app/deployment.d.ts +36 -0
  15. package/dist/app/deployment.js +18 -0
  16. package/dist/app/identity.d.ts +211 -0
  17. package/dist/app/identity.js +287 -0
  18. package/dist/app/index.d.ts +22 -0
  19. package/dist/app/index.js +12 -0
  20. package/dist/app/manifest.d.ts +74 -0
  21. package/dist/app/manifest.js +120 -0
  22. package/dist/app/node.d.ts +30 -0
  23. package/dist/app/node.js +159 -0
  24. package/dist/app/ready-slot.d.ts +157 -0
  25. package/dist/app/ready-slot.js +199 -0
  26. package/dist/app/tasra-client.d.ts +125 -0
  27. package/dist/app/tasra-client.js +79 -0
  28. package/dist/app/viem.d.ts +10 -0
  29. package/dist/app/viem.js +32 -0
  30. package/dist/app/wallet.d.ts +126 -0
  31. package/dist/app/wallet.js +137 -0
  32. package/dist/auth/dpop.d.ts +86 -0
  33. package/dist/auth/dpop.js +142 -0
  34. package/dist/auth/holderProof.d.ts +102 -0
  35. package/dist/auth/holderProof.js +161 -0
  36. package/dist/auth/identityScope.d.ts +19 -0
  37. package/dist/auth/identityScope.js +82 -0
  38. package/dist/auth/index.d.ts +11 -0
  39. package/dist/auth/index.js +13 -0
  40. package/dist/auth/oid4vp.d.ts +230 -0
  41. package/dist/auth/oid4vp.js +780 -0
  42. package/dist/auth/rego/wasm/PINS.json +11 -0
  43. package/dist/auth/rego/wasm/keykeeper_rego_wasm.d.ts +76 -0
  44. package/dist/auth/rego/wasm/keykeeper_rego_wasm.js +379 -0
  45. package/dist/auth/rego/wasm/keykeeper_rego_wasm_bg.wasm +0 -0
  46. package/dist/auth/rego.d.ts +192 -0
  47. package/dist/auth/rego.js +492 -0
  48. package/dist/auth/verifier.d.ts +166 -0
  49. package/dist/auth/verifier.js +211 -0
  50. package/dist/chain/abis/accountantSetRegistry.d.ts +441 -0
  51. package/dist/chain/abis/accountantSetRegistry.js +574 -0
  52. package/dist/chain/abis/accountantSlashing.d.ts +2071 -0
  53. package/dist/chain/abis/accountantSlashing.js +2670 -0
  54. package/dist/chain/abis/bondingCurve.d.ts +398 -0
  55. package/dist/chain/abis/bondingCurve.js +521 -0
  56. package/dist/chain/abis/equivocationSlasher.d.ts +292 -0
  57. package/dist/chain/abis/equivocationSlasher.js +379 -0
  58. package/dist/chain/abis/fixedTasraPriceOracle.d.ts +52 -0
  59. package/dist/chain/abis/fixedTasraPriceOracle.js +72 -0
  60. package/dist/chain/abis/index.d.ts +12801 -0
  61. package/dist/chain/abis/index.js +64 -0
  62. package/dist/chain/abis/keeperShareRegistry.d.ts +519 -0
  63. package/dist/chain/abis/keeperShareRegistry.js +675 -0
  64. package/dist/chain/abis/keyRegistry.d.ts +2421 -0
  65. package/dist/chain/abis/keyRegistry.js +3114 -0
  66. package/dist/chain/abis/livenessRegistry.d.ts +402 -0
  67. package/dist/chain/abis/livenessRegistry.js +524 -0
  68. package/dist/chain/abis/mockEurc.d.ts +210 -0
  69. package/dist/chain/abis/mockEurc.js +276 -0
  70. package/dist/chain/abis/nodeRegistry.d.ts +1630 -0
  71. package/dist/chain/abis/nodeRegistry.js +2113 -0
  72. package/dist/chain/abis/platformExecutor.d.ts +328 -0
  73. package/dist/chain/abis/platformExecutor.js +429 -0
  74. package/dist/chain/abis/prevrandaoSaltBeacon.d.ts +16 -0
  75. package/dist/chain/abis/prevrandaoSaltBeacon.js +24 -0
  76. package/dist/chain/abis/serviceRegistry.d.ts +556 -0
  77. package/dist/chain/abis/serviceRegistry.js +719 -0
  78. package/dist/chain/abis/settlement.d.ts +1624 -0
  79. package/dist/chain/abis/settlement.js +2096 -0
  80. package/dist/chain/abis/tasraSwapRouter.d.ts +92 -0
  81. package/dist/chain/abis/tasraSwapRouter.js +122 -0
  82. package/dist/chain/abis/tasraToken.d.ts +455 -0
  83. package/dist/chain/abis/tasraToken.js +599 -0
  84. package/dist/chain/abis/tasraVestingVault.d.ts +165 -0
  85. package/dist/chain/abis/tasraVestingVault.js +215 -0
  86. package/dist/chain/abis/thresholdRandomBeacon.d.ts +378 -0
  87. package/dist/chain/abis/thresholdRandomBeacon.js +494 -0
  88. package/dist/chain/abis/treasury.d.ts +301 -0
  89. package/dist/chain/abis/treasury.js +390 -0
  90. package/dist/chain/abis/verifierSetRegistry.d.ts +445 -0
  91. package/dist/chain/abis/verifierSetRegistry.js +579 -0
  92. package/dist/chain/client.d.ts +212 -0
  93. package/dist/chain/client.js +576 -0
  94. package/dist/chain/commitmentRecovery.d.ts +21 -0
  95. package/dist/chain/commitmentRecovery.js +44 -0
  96. package/dist/chain/committeeClient.d.ts +102 -0
  97. package/dist/chain/committeeClient.js +137 -0
  98. package/dist/chain/deployments.d.ts +56 -0
  99. package/dist/chain/deployments.js +269 -0
  100. package/dist/chain/discovery.d.ts +49 -0
  101. package/dist/chain/discovery.js +107 -0
  102. package/dist/chain/events.d.ts +58 -0
  103. package/dist/chain/events.js +125 -0
  104. package/dist/chain/format.d.ts +25 -0
  105. package/dist/chain/format.js +51 -0
  106. package/dist/chain/index.d.ts +41 -0
  107. package/dist/chain/index.js +56 -0
  108. package/dist/chain/manifest.d.ts +165 -0
  109. package/dist/chain/manifest.js +132 -0
  110. package/dist/chain/network-profiles.json +75 -0
  111. package/dist/chain/networks.d.ts +73 -0
  112. package/dist/chain/networks.js +62 -0
  113. package/dist/chain/node.d.ts +44 -0
  114. package/dist/chain/node.js +176 -0
  115. package/dist/chain/offchain.d.ts +149 -0
  116. package/dist/chain/offchain.js +73 -0
  117. package/dist/chain/provisionRule.d.ts +164 -0
  118. package/dist/chain/provisionRule.js +212 -0
  119. package/dist/chain/registeredAgent.d.ts +64 -0
  120. package/dist/chain/registeredAgent.js +140 -0
  121. package/dist/chain/registeredOperation.d.ts +49 -0
  122. package/dist/chain/registeredOperation.js +136 -0
  123. package/dist/chain/registeredRelay.d.ts +206 -0
  124. package/dist/chain/registeredRelay.js +312 -0
  125. package/dist/chain/revertReason.d.ts +14 -0
  126. package/dist/chain/revertReason.js +62 -0
  127. package/dist/chain/ruleAmendment.d.ts +80 -0
  128. package/dist/chain/ruleAmendment.js +195 -0
  129. package/dist/chain/ruleAmendmentCore.d.ts +129 -0
  130. package/dist/chain/ruleAmendmentCore.js +152 -0
  131. package/dist/chain/ruleInput.d.ts +10 -0
  132. package/dist/chain/ruleInput.js +13 -0
  133. package/dist/chain/serviceIdentity.d.ts +176 -0
  134. package/dist/chain/serviceIdentity.js +237 -0
  135. package/dist/chain/serviceProfiles.d.ts +39 -0
  136. package/dist/chain/serviceProfiles.js +74 -0
  137. package/dist/chain/services.d.ts +141 -0
  138. package/dist/chain/services.js +79 -0
  139. package/dist/chain/slotClient.d.ts +55 -0
  140. package/dist/chain/slotClient.js +62 -0
  141. package/dist/chain/slotSeed.d.ts +31 -0
  142. package/dist/chain/slotSeed.js +98 -0
  143. package/dist/chain/write.d.ts +431 -0
  144. package/dist/chain/write.js +958 -0
  145. package/dist/client/client.d.ts +112 -0
  146. package/dist/client/client.js +111 -0
  147. package/dist/client/index.d.ts +3 -0
  148. package/dist/client/index.js +2 -0
  149. package/dist/client/session.d.ts +67 -0
  150. package/dist/client/session.js +238 -0
  151. package/dist/committee/client.d.ts +284 -0
  152. package/dist/committee/client.js +351 -0
  153. package/dist/committee/dual-sign.d.ts +110 -0
  154. package/dist/committee/dual-sign.js +202 -0
  155. package/dist/committee/ecdsa.d.ts +36 -0
  156. package/dist/committee/ecdsa.js +45 -0
  157. package/dist/committee/extraction.d.ts +82 -0
  158. package/dist/committee/extraction.js +96 -0
  159. package/dist/committee/index.d.ts +19 -0
  160. package/dist/committee/index.js +13 -0
  161. package/dist/committee/oauth.d.ts +51 -0
  162. package/dist/committee/oauth.js +90 -0
  163. package/dist/committee/receipts.d.ts +51 -0
  164. package/dist/committee/receipts.js +59 -0
  165. package/dist/committee/request.d.ts +264 -0
  166. package/dist/committee/request.js +305 -0
  167. package/dist/committee/token.d.ts +274 -0
  168. package/dist/committee/token.js +418 -0
  169. package/dist/crypto/constants.d.ts +10 -0
  170. package/dist/crypto/constants.js +32 -0
  171. package/dist/crypto/detect.d.ts +20 -0
  172. package/dist/crypto/detect.js +44 -0
  173. package/dist/crypto/envelope.d.ts +60 -0
  174. package/dist/crypto/envelope.js +243 -0
  175. package/dist/crypto/frost.d.ts +49 -0
  176. package/dist/crypto/frost.js +152 -0
  177. package/dist/crypto/hex.d.ts +7 -0
  178. package/dist/crypto/hex.js +24 -0
  179. package/dist/crypto/ibe-blob.d.ts +114 -0
  180. package/dist/crypto/ibe-blob.js +208 -0
  181. package/dist/crypto/ibe.d.ts +88 -0
  182. package/dist/crypto/ibe.js +262 -0
  183. package/dist/crypto/index.d.ts +12 -0
  184. package/dist/crypto/index.js +12 -0
  185. package/dist/crypto/kem.d.ts +55 -0
  186. package/dist/crypto/kem.js +241 -0
  187. package/dist/decryption/client.d.ts +64 -0
  188. package/dist/decryption/client.js +82 -0
  189. package/dist/decryption/index.d.ts +2 -0
  190. package/dist/decryption/index.js +2 -0
  191. package/dist/errors.d.ts +124 -0
  192. package/dist/errors.js +167 -0
  193. package/dist/index.d.ts +43 -0
  194. package/dist/index.js +98 -0
  195. package/dist/keys/index.d.ts +1 -0
  196. package/dist/keys/index.js +4 -0
  197. package/dist/keys/node-client.d.ts +27 -0
  198. package/dist/keys/node-client.js +97 -0
  199. package/dist/oid4vp/binding.d.ts +76 -0
  200. package/dist/oid4vp/binding.js +118 -0
  201. package/dist/oid4vp/did-web.d.ts +49 -0
  202. package/dist/oid4vp/did-web.js +57 -0
  203. package/dist/oid4vp/index.d.ts +9 -0
  204. package/dist/oid4vp/index.js +10 -0
  205. package/dist/oid4vp/jose.d.ts +166 -0
  206. package/dist/oid4vp/jose.js +242 -0
  207. package/dist/oid4vp/jwe.d.ts +30 -0
  208. package/dist/oid4vp/jwe.js +93 -0
  209. package/dist/oid4vp/oid4vci.d.ts +84 -0
  210. package/dist/oid4vp/oid4vci.js +85 -0
  211. package/dist/oid4vp/request-object.d.ts +109 -0
  212. package/dist/oid4vp/request-object.js +96 -0
  213. package/dist/oid4vp/sd-jwt.d.ts +177 -0
  214. package/dist/oid4vp/sd-jwt.js +208 -0
  215. package/dist/oid4vp/verifier-agent.d.ts +161 -0
  216. package/dist/oid4vp/verifier-agent.js +132 -0
  217. package/dist/oid4vp/wallet.d.ts +116 -0
  218. package/dist/oid4vp/wallet.js +108 -0
  219. package/dist/recipient/store.d.ts +67 -0
  220. package/dist/recipient/store.js +98 -0
  221. package/dist/signing/ecdsa.d.ts +49 -0
  222. package/dist/signing/ecdsa.js +79 -0
  223. package/dist/signing/frost.d.ts +88 -0
  224. package/dist/signing/frost.js +145 -0
  225. package/dist/signing/index.d.ts +4 -0
  226. package/dist/signing/index.js +3 -0
  227. package/dist/slots/faucet.d.ts +23 -0
  228. package/dist/slots/faucet.js +35 -0
  229. package/dist/slots/index.d.ts +2 -0
  230. package/dist/slots/index.js +4 -0
  231. package/dist/verifier-agent/index.d.ts +241 -0
  232. package/dist/verifier-agent/index.js +411 -0
  233. package/docs/DEVELOPER-EXPERIENCE.md +62 -0
  234. package/docs/README.md +33 -0
  235. package/docs/access-control.md +76 -0
  236. package/docs/ai-development.md +292 -0
  237. package/docs/api.md +338 -0
  238. package/docs/application-api.md +335 -0
  239. package/docs/architecture.md +65 -0
  240. package/docs/basics.md +48 -0
  241. package/docs/capabilities.md +86 -0
  242. package/docs/chain.md +153 -0
  243. package/docs/compatibility.md +36 -0
  244. package/docs/consumer-migrations.md +80 -0
  245. package/docs/create-slot.md +104 -0
  246. package/docs/document-signing.md +243 -0
  247. package/docs/encrypted-notes.md +129 -0
  248. package/docs/encryption.md +100 -0
  249. package/docs/errors.md +76 -0
  250. package/docs/flows.md +289 -0
  251. package/docs/fuji.md +127 -0
  252. package/docs/funding.md +126 -0
  253. package/docs/getting-started.md +94 -0
  254. package/docs/glossary.md +44 -0
  255. package/docs/installation.md +132 -0
  256. package/docs/manage-slot.md +95 -0
  257. package/docs/native-approvals.md +124 -0
  258. package/docs/prerequisites.md +137 -0
  259. package/docs/read-slot.md +41 -0
  260. package/docs/reference/README.md +30 -0
  261. package/docs/reference/app-node.md +102 -0
  262. package/docs/reference/app.md +1737 -0
  263. package/docs/reference/chain-node.md +159 -0
  264. package/docs/reference/chain.md +3609 -0
  265. package/docs/reference/committee.md +2176 -0
  266. package/docs/reference/main.md +4068 -0
  267. package/docs/reference/oid4vp.md +2547 -0
  268. package/docs/reference/verifier-agent.md +498 -0
  269. package/docs/shared-account.md +168 -0
  270. package/docs/signing-and-encryption.md +52 -0
  271. package/docs/signing.md +172 -0
  272. package/examples/committee-slot.ts +16 -0
  273. package/examples/connect-fuji.ts +41 -0
  274. package/examples/connect-network.ts +14 -0
  275. package/examples/credential-approvals.ts +46 -0
  276. package/examples/document-signing/README.md +59 -0
  277. package/examples/document-signing/backend.ts +132 -0
  278. package/examples/document-signing/build.mjs +19 -0
  279. package/examples/document-signing/config.ts +34 -0
  280. package/examples/document-signing/gitignore.template +9 -0
  281. package/examples/document-signing/model.ts +140 -0
  282. package/examples/document-signing/network.ts +58 -0
  283. package/examples/document-signing/package.json +25 -0
  284. package/examples/document-signing/public/index.html +27 -0
  285. package/examples/document-signing/public/sample.pdf +31 -0
  286. package/examples/document-signing/public/styles.css +531 -0
  287. package/examples/document-signing/server.ts +358 -0
  288. package/examples/document-signing/setup.ts +111 -0
  289. package/examples/document-signing/store.ts +105 -0
  290. package/examples/document-signing/tsconfig.json +24 -0
  291. package/examples/document-signing/verify.ts +24 -0
  292. package/examples/document-signing/web/app.ts +312 -0
  293. package/examples/document-signing/web/preview.ts +67 -0
  294. package/examples/document-signing/web/wallet.ts +146 -0
  295. package/examples/document-signing/workflow.test.ts +228 -0
  296. package/examples/document-signing/workflow.ts +241 -0
  297. package/examples/document-signing.ts +96 -0
  298. package/examples/encrypted-notes.ts +86 -0
  299. package/examples/ethers-signer.ts +204 -0
  300. package/examples/fund-slot.ts +73 -0
  301. package/examples/getting-started.ts +25 -0
  302. package/examples/learning-authorize.ts +23 -0
  303. package/examples/learning-cancel-slot.ts +11 -0
  304. package/examples/learning-context.ts +28 -0
  305. package/examples/learning-create-slot.ts +25 -0
  306. package/examples/learning-read-slot.ts +8 -0
  307. package/examples/learning-renew-slot.ts +12 -0
  308. package/examples/learning-sign.ts +8 -0
  309. package/examples/live-config.ts +71 -0
  310. package/examples/minimal.ts +6 -0
  311. package/examples/native-approvals.ts +57 -0
  312. package/examples/network.ts +58 -0
  313. package/examples/offline.ts +16 -0
  314. package/examples/personal-vault.ts +20 -0
  315. package/examples/provision-slot.ts +47 -0
  316. package/examples/shared-account.ts +46 -0
  317. package/examples/slot-address.ts +13 -0
  318. package/examples/slot-creation.ts +9 -0
  319. package/examples/tutorial-negative.ts +26 -0
  320. package/examples/tutorial-support.ts +76 -0
  321. package/examples/viem-account.ts +203 -0
  322. package/package.json +303 -4
@@ -0,0 +1,4068 @@
1
+ # @t3foundry/tasra-sdk
2
+
3
+ Generated from public TypeScript exports.
4
+
5
+ [SDK reference](README.md) · [Task guides](../README.md) · [Errors](../errors.md)
6
+
7
+ ## Classes
8
+
9
+ Clients, adapters and error classes.
10
+
11
+ <details>
12
+ <summary>Browse 11 classes</summary>
13
+
14
+ - [RecipientStore](#recipientstore)
15
+ - [AuthDeniedError](#authdeniederror)
16
+ - [CommitteeAuthorizeError](#committeeauthorizeerror)
17
+ - [DcqlMalformedError](#dcqlmalformederror)
18
+ - [NodeUnreachableError](#nodeunreachableerror)
19
+ - [RegoEnvelopeError](#regoenvelopeerror)
20
+ - [SlotRotatedError](#slotrotatederror)
21
+ - [TasraError](#tasraerror)
22
+ - [TasraHttpError](#tasrahttperror)
23
+ - [ThresholdNotMetError](#thresholdnotmeterror)
24
+ - [VerifierAgentSessionError](#verifieragentsessionerror)
25
+
26
+ </details>
27
+
28
+ ### RecipientStore
29
+
30
+ A recipient's local credential store. Holds structured credentials and
31
+ evaluates them against DCQL rules for advisory matching. It does not verify
32
+ credential signatures or establish issuer trust.
33
+
34
+ Everything here is in-memory and synchronous: deciding access reveals nothing
35
+ to the platform.
36
+
37
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/recipient/store.ts#L41)
38
+
39
+ Import: `import {RecipientStore} from '@t3foundry/tasra-sdk'`
40
+
41
+ ```ts
42
+ declare class RecipientStore {
43
+ constructor(credentials?: (HeldCredential | CredentialView)[]);
44
+ }
45
+ ```
46
+
47
+ - ` add(credential: HeldCredential | CredentialView): this; ` — Add a credential (returns `this` for chaining).
48
+
49
+ - ` views(): readonly CredentialView[]; ` — The credential views held in this store.
50
+
51
+ - ` satisfies(rule: string): boolean; ` — Check whether held credential views match the DCQL rule without network access.
52
+
53
+ **static fromJwtBodies** — Build a store from parsed JWT credential bodies.
54
+ Each entry needs a `type` array and an `iss` field in the body at minimum.
55
+
56
+ ```ts
57
+ static fromJwtBodies(bodies: Array<{
58
+ type: string[];
59
+ iss: string;
60
+ [key: string]: unknown;
61
+ }>): RecipientStore;
62
+ ```
63
+
64
+ ### AuthDeniedError
65
+
66
+ The credential was rejected: 401 or 403. Never retryable - the same token will
67
+ be refused again. Re-claim (redeem a fresh credential or renewal) instead.
68
+
69
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L75)
70
+
71
+ Import: `import {AuthDeniedError} from '@t3foundry/tasra-sdk'`
72
+
73
+ ```ts
74
+ declare class AuthDeniedError {
75
+ constructor(args: {
76
+ status: number;
77
+ url: string;
78
+ body?: string;
79
+ message?: string;
80
+ });
81
+ }
82
+ ```
83
+
84
+ - ` readonly status: number; ` — HTTP status code returned by the service.
85
+
86
+ - ` readonly url: string; ` — Service URL that failed.
87
+
88
+ - ` readonly body: string; ` — Response body retained as diagnostic information.
89
+
90
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
91
+
92
+ - ` name: string; `
93
+
94
+ - ` message: string; `
95
+
96
+ - ` stack?: string; `
97
+
98
+ - ` cause?: unknown; `
99
+
100
+ ### CommitteeAuthorizeError
101
+
102
+ A verifier refused to co-sign a committee token. Extends
103
+ [TasraHttpError](#tasrahttperror), so `.status`, `.url`, `.body`, and `.retryable` are
104
+ all available and `isAuthDenied()` recognises a 401/403 here too.
105
+
106
+ Distinct from a generic HTTP error because the committee flow polls several
107
+ verifiers and tolerates individual refusals as long as a quorum co-signs - see
108
+ [ThresholdNotMetError](#thresholdnotmeterror) for the failure that means the quorum was missed.
109
+
110
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#L71)
111
+
112
+ Import: `import {CommitteeAuthorizeError} from '@t3foundry/tasra-sdk'`
113
+
114
+ ```ts
115
+ declare class CommitteeAuthorizeError {
116
+ constructor(status: number, message: string, opts?: {
117
+ url?: string;
118
+ body?: string;
119
+ });
120
+ }
121
+ ```
122
+
123
+ - ` readonly status: number; ` — HTTP status code returned by the service.
124
+
125
+ - ` readonly url: string; ` — Service URL that failed.
126
+
127
+ - ` readonly body: string; ` — Response body retained as diagnostic information.
128
+
129
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
130
+
131
+ - ` name: string; `
132
+
133
+ - ` message: string; `
134
+
135
+ - ` stack?: string; `
136
+
137
+ - ` cause?: unknown; `
138
+
139
+ ### DcqlMalformedError
140
+
141
+ The rule is not a well-formed OID4VP-DCQL query (or exceeds `MAX_RULE_LEN`).
142
+ Never retryable - the same rule fails identically. Extends
143
+ [TasraError](#tasraerror) so one `instanceof` catches every SDK error.
144
+
145
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L20)
146
+
147
+ Import: `import {DcqlMalformedError} from '@t3foundry/tasra-sdk'`
148
+
149
+ ```ts
150
+ declare class DcqlMalformedError {
151
+ constructor(message: string);
152
+ }
153
+ ```
154
+
155
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
156
+
157
+ - ` name: string; `
158
+
159
+ - ` message: string; `
160
+
161
+ - ` stack?: string; `
162
+
163
+ - ` cause?: unknown; `
164
+
165
+ ### NodeUnreachableError
166
+
167
+ The request never got an HTTP answer - DNS failure, connection refused,
168
+ timeout, CORS. Retryable: the service may simply not be up yet.
169
+
170
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L85)
171
+
172
+ Import: `import {NodeUnreachableError} from '@t3foundry/tasra-sdk'`
173
+
174
+ ```ts
175
+ declare class NodeUnreachableError {
176
+ constructor(args: {
177
+ url: string;
178
+ message?: string;
179
+ cause?: unknown;
180
+ });
181
+ }
182
+ ```
183
+
184
+ - ` readonly url: string; ` — Endpoint that could not be reached.
185
+
186
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
187
+
188
+ - ` name: string; `
189
+
190
+ - ` message: string; `
191
+
192
+ - ` stack?: string; `
193
+
194
+ - ` cause?: unknown; `
195
+
196
+ ### RegoEnvelopeError
197
+
198
+ A refused envelope operation: the rule or its authored parts are malformed.
199
+
200
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L395)
201
+
202
+ Import: `import {RegoEnvelopeError} from '@t3foundry/tasra-sdk'`
203
+
204
+ ```ts
205
+ declare class RegoEnvelopeError {
206
+ constructor(kind: 'malformed' | 'reject', message: string);
207
+ }
208
+ ```
209
+
210
+ - ` readonly kind: 'malformed' | 'reject'; ` — `malformed` for a schema or gate failure; `reject` never reaches this class.
211
+
212
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
213
+
214
+ - ` name: string; `
215
+
216
+ - ` message: string; `
217
+
218
+ - ` stack?: string; `
219
+
220
+ - ` cause?: unknown; `
221
+
222
+ ### SlotRotatedError
223
+
224
+ The slot was re-keyed (rotated) since the key in hand was assembled, so that
225
+ key cannot read anything encrypted after the rotation. Retryable: re-assemble
226
+ at the new epoch and try again - the managed [Session](#session) does this for you.
227
+
228
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L133)
229
+
230
+ Import: `import {SlotRotatedError} from '@t3foundry/tasra-sdk'`
231
+
232
+ ```ts
233
+ declare class SlotRotatedError {
234
+ constructor(args: {
235
+ expected: number;
236
+ actual: number;
237
+ slotId?: string;
238
+ message?: string;
239
+ });
240
+ }
241
+ ```
242
+
243
+ - ` readonly expected: number; ` — The epoch the caller's key/envelope belongs to.
244
+
245
+ - ` readonly actual: number; ` — The slot's current on-chain/served epoch.
246
+
247
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
248
+
249
+ - ` name: string; `
250
+
251
+ - ` message: string; `
252
+
253
+ - ` stack?: string; `
254
+
255
+ - ` cause?: unknown; `
256
+
257
+ ### TasraError
258
+
259
+ Base class for typed SDK failures with a retryability hint.
260
+ Some SDK errors extend plain Error, including relay and agent-session
261
+ reconciliation errors. A retryable failure does not make a write safe to repeat.
262
+
263
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L34)
264
+
265
+ Import: `import {TasraError} from '@t3foundry/tasra-sdk'`
266
+
267
+ ```ts
268
+ declare class TasraError {
269
+ constructor(message: string, opts?: {
270
+ retryable?: boolean;
271
+ cause?: unknown;
272
+ });
273
+ }
274
+ ```
275
+
276
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
277
+
278
+ - ` name: string; `
279
+
280
+ - ` message: string; `
281
+
282
+ - ` stack?: string; `
283
+
284
+ - ` cause?: unknown; `
285
+
286
+ ### TasraHttpError
287
+
288
+ A node or verifier answered with a non-2xx status. `body` is the response body,
289
+ truncated to 200 characters - enough to carry the service's own error text
290
+ without dumping a page of HTML into a log line.
291
+
292
+ 5xx and 429 are marked retryable; other 4xx are not.
293
+
294
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L52)
295
+
296
+ Import: `import {TasraHttpError} from '@t3foundry/tasra-sdk'`
297
+
298
+ ```ts
299
+ declare class TasraHttpError {
300
+ constructor(args: {
301
+ status: number;
302
+ url: string;
303
+ body?: string;
304
+ message?: string;
305
+ retryable?: boolean;
306
+ });
307
+ }
308
+ ```
309
+
310
+ - ` readonly status: number; ` — HTTP status code returned by the service.
311
+
312
+ - ` readonly url: string; ` — Service URL that failed.
313
+
314
+ - ` readonly body: string; ` — Response body retained as diagnostic information.
315
+
316
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
317
+
318
+ - ` name: string; `
319
+
320
+ - ` message: string; `
321
+
322
+ - ` stack?: string; `
323
+
324
+ - ` cause?: unknown; `
325
+
326
+ ### ThresholdNotMetError
327
+
328
+ Fewer than the required number of participants answered - too few shards to
329
+ assemble a key, too few verifier signatures for a quorum, too few nodes for a
330
+ signing set.
331
+
332
+ `reasons` carries one entry per participant that failed, which is what makes
333
+ this actionable: previously those were collected and then discarded, so a DNS
334
+ failure and a cold DKG produced the same opaque message.
335
+
336
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L104)
337
+
338
+ Import: `import {ThresholdNotMetError} from '@t3foundry/tasra-sdk'`
339
+
340
+ ```ts
341
+ declare class ThresholdNotMetError {
342
+ constructor(args: {
343
+ got: number;
344
+ need: number;
345
+ reasons?: readonly string[];
346
+ message?: string;
347
+ retryable?: boolean;
348
+ });
349
+ }
350
+ ```
351
+
352
+ - ` readonly got: number; ` — How many participants answered successfully.
353
+
354
+ - ` readonly need: number; ` — How many were needed.
355
+
356
+ - ` readonly reasons: readonly string[]; ` — Why each failing participant failed, one string per participant.
357
+
358
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
359
+
360
+ - ` name: string; `
361
+
362
+ - ` message: string; `
363
+
364
+ - ` stack?: string; `
365
+
366
+ - ` cause?: unknown; `
367
+
368
+ ### VerifierAgentSessionError
369
+
370
+ A Verifier Agent session did not produce a compound token. `kind` says why;
371
+ `retryable` is true only for `timeout` and `unavailable` - the session may
372
+ still complete, so poll again. Extends [TasraError](#tasraerror).
373
+
374
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L134)
375
+
376
+ Import: `import {VerifierAgentSessionError} from '@t3foundry/tasra-sdk'`
377
+
378
+ ```ts
379
+ declare class VerifierAgentSessionError {
380
+ constructor(kind: VerifierAgentSessionErrorKind, correlation: string, message: string, httpStatus?: number);
381
+ }
382
+ ```
383
+
384
+ - ` readonly kind: VerifierAgentSessionErrorKind; ` — Failure category used to select recovery behavior.
385
+
386
+ - ` readonly correlation: string; ` — The session id - safe to show and to log.
387
+
388
+ - ` readonly httpStatus?: number; ` — The HTTP status that produced a `protocol`/`unavailable` error, when there was one.
389
+
390
+ - ` readonly retryable: boolean; ` — `false` when retrying the identical request cannot succeed.
391
+
392
+ - ` name: string; `
393
+
394
+ - ` message: string; `
395
+
396
+ - ` stack?: string; `
397
+
398
+ - ` cause?: unknown; `
399
+
400
+ ## Functions
401
+
402
+ Operations you can import and call.
403
+
404
+ <details>
405
+ <summary>Browse 86 functions</summary>
406
+
407
+ - [accessTokenHash](#accesstokenhash)
408
+ - [addressFromEoaPubkey](#addressfromeoapubkey)
409
+ - [aggregateFrostSignature](#aggregatefrostsignature)
410
+ - [auth0DpopSigner](#auth0dpopsigner)
411
+ - [buildHolderProof](#buildholderproof)
412
+ - [buildTasraText](#buildtasratext)
413
+ - [canAccess](#canaccess)
414
+ - [canonicalizeDcql](#canonicalizedcql)
415
+ - [combineDecryptShares](#combinedecryptshares)
416
+ - [createDpopKey](#createdpopkey)
417
+ - [createHolderProof](#createholderproof)
418
+ - [createOauthSession](#createoauthsession)
419
+ - [createOid4vpSession](#createoid4vpsession)
420
+ - [createRenewal](#createrenewal)
421
+ - [createTasraClient](#createtasraclient)
422
+ - [credentialsCommitment](#credentialscommitment)
423
+ - [decodeJwtClaims](#decodejwtclaims)
424
+ - [decryptCustody](#decryptcustody)
425
+ - [decryptWithMasterKey](#decryptwithmasterkey)
426
+ - [decryptWithShardDelivery](#decryptwithsharddelivery)
427
+ - [ed25519DidKey](#ed25519didkey)
428
+ - [encryptEnvelope](#encryptenvelope)
429
+ - [ethSignatureV](#ethsignaturev)
430
+ - [evaluateDcql](#evaluatedcql)
431
+ - [evaluateEnvelope](#evaluateenvelope)
432
+ - [evaluateIdentityScoped](#evaluateidentityscoped)
433
+ - [fetchAndAssembleKey](#fetchandassemblekey)
434
+ - [fetchHolderNonce](#fetchholdernonce)
435
+ - [fetchMpk](#fetchmpk)
436
+ - [fromBytes](#frombytes)
437
+ - [hexToBytes](#hextobytes)
438
+ - [httpFaucet](#httpfaucet)
439
+ - [ibeBlobChunkRange](#ibeblobchunkrange)
440
+ - [ibeBlobDecryptKey](#ibeblobdecryptkey)
441
+ - [ibeBlobDigest](#ibeblobdigest)
442
+ - [ibeBlobWrappedKey](#ibeblobwrappedkey)
443
+ - [ibeCombineDecrypt](#ibecombinedecrypt)
444
+ - [ibeCombineExtract](#ibecombineextract)
445
+ - [ibeDecryptBlobChunk](#ibedecryptblobchunk)
446
+ - [ibeDecryptRequest](#ibedecryptrequest)
447
+ - [ibeDecryptWithKey](#ibedecryptwithkey)
448
+ - [ibeEncrypt](#ibeencrypt)
449
+ - [ibeExtractRequest](#ibeextractrequest)
450
+ - [ibeOpenBlob](#ibeopenblob)
451
+ - [ibeSealBlob](#ibesealblob)
452
+ - [ibeUnwrapBlobKey](#ibeunwrapblobkey)
453
+ - [ibeVerifyShare](#ibeverifyshare)
454
+ - [isAuthDenied](#isauthdenied)
455
+ - [isHeaderSafeNonce](#isheadersafenonce)
456
+ - [isJwtExpiringSoon](#isjwtexpiringsoon)
457
+ - [isOauthEnvelope](#isoauthenvelope)
458
+ - [isOid4vpRule](#isoid4vprule)
459
+ - [isRetryable](#isretryable)
460
+ - [issueAdminCredential](#issueadmincredential)
461
+ - [isTasraPost](#istasrapost)
462
+ - [jsonCredential](#jsoncredential)
463
+ - [jwkThumbprint](#jwkthumbprint)
464
+ - [jwtExpMs](#jwtexpms)
465
+ - [lintEnvelope](#lintenvelope)
466
+ - [loadRego](#loadrego)
467
+ - [packEnvelope](#packenvelope)
468
+ - [parseTasraPost](#parsetasrapost)
469
+ - [payloadDigest](#payloaddigest)
470
+ - [pollOid4vpSession](#polloid4vpsession)
471
+ - [redeemCredential](#redeemcredential)
472
+ - [redeemRenewalToken](#redeemrenewaltoken)
473
+ - [requestIbeExtractionPartials](#requestibeextractionpartials)
474
+ - [revokeRenewal](#revokerenewal)
475
+ - [revokeSlotUser](#revokeslotuser)
476
+ - [scopeCovers](#scopecovers)
477
+ - [selectDcql](#selectdcql)
478
+ - [signCustody](#signcustody)
479
+ - [signEoaDigest](#signeoadigest)
480
+ - [signUserRequest](#signuserrequest)
481
+ - [signWithShardDelivery](#signwithsharddelivery)
482
+ - [submitOauthResponse](#submitoauthresponse)
483
+ - [toBytes](#tobytes)
484
+ - [unpackEnvelope](#unpackenvelope)
485
+ - [userSignaturePayload](#usersignaturepayload)
486
+ - [validateDcql](#validatedcql)
487
+ - [validateRecipientRule](#validaterecipientrule)
488
+ - [verifyDecryptShare](#verifydecryptshare)
489
+ - [verifyFrostSignature](#verifyfrostsignature)
490
+ - [verifyPresentation](#verifypresentation)
491
+ - [verifyVpJwt](#verifyvpjwt)
492
+ - [waitForSession](#waitforsession)
493
+
494
+ </details>
495
+
496
+ ### accessTokenHash
497
+
498
+ Compute the base64url SHA-256 access-token hash for the DPoP ath claim.
499
+
500
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L64)
501
+
502
+ Import: `import {accessTokenHash} from '@t3foundry/tasra-sdk'`
503
+
504
+ ```ts
505
+ declare function accessTokenHash(accessToken: string): Promise<string>;
506
+ ```
507
+
508
+ | Parameter | Type | Description |
509
+ |---|---|---|
510
+ | ` accessToken ` | ` string ` | - Exact access token string to bind into the DPoP proof. |
511
+
512
+ Returns: ` Promise<string> `.
513
+
514
+ ### addressFromEoaPubkey
515
+
516
+ Derive the EIP-55 checksummed `0x` Ethereum address of a threshold EOA from its
517
+ secp256k1 group public key - pass `EoaSignature.groupPublicKey` (33-byte
518
+ compressed) or a 65-byte uncompressed key. Pure `@noble` (no ethers/web3): the
519
+ key is decompressed, keccak-256'd over X||Y, and the low 20 bytes are checksummed.
520
+ This is what an ethers `Signer.getAddress()` returns for a Tasra EOA slot.
521
+
522
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/ecdsa.ts#L111)
523
+
524
+ Import: `import {addressFromEoaPubkey} from '@t3foundry/tasra-sdk'`
525
+
526
+ ```ts
527
+ declare function addressFromEoaPubkey(pubkey: Uint8Array): `0x${string}`;
528
+ ```
529
+
530
+ | Parameter | Type | Description |
531
+ |---|---|---|
532
+ | ` pubkey ` | ` Uint8Array ` | - SEC1-encoded secp256k1 public key, compressed or uncompressed. |
533
+
534
+ Returns: `` `0x${string}` ``.
535
+
536
+ ### aggregateFrostSignature
537
+
538
+ Combine k Round-1 commitments + k Round-2 shares into the group signature.
539
+ `commitments` MUST be in the same order that was sent to every node (the
540
+ binding factors depend on the serialized list order). Each share is
541
+ identifiable-abort verified; an invalid share throws naming its identifier.
542
+
543
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/frost.ts#L135)
544
+
545
+ Import: `import {aggregateFrostSignature} from '@t3foundry/tasra-sdk'`
546
+
547
+ ```ts
548
+ declare function aggregateFrostSignature(message: Uint8Array, groupPublicKey: Uint8Array, commitments: FrostCommitment[], shares: FrostShare[]): FrostSignature;
549
+ ```
550
+
551
+ | Parameter | Type | Description |
552
+ |---|---|---|
553
+ | ` message ` | ` Uint8Array ` | - Message signed by every participant. |
554
+ | ` groupPublicKey ` | ` Uint8Array ` | - 32-byte FROST group public key. |
555
+ | ` commitments ` | ` FrostCommitment[] ` | - Commitments from the selected signing participants. |
556
+ | ` shares ` | ` FrostShare[] ` | - Signature shares for those commitments. |
557
+
558
+ Returns: ` FrostSignature `.
559
+
560
+ ### auth0DpopSigner
561
+
562
+ Wrap `auth0-spa-js`'s own proof minter as a [DpopSigner](#dpopsigner).
563
+
564
+ The SDK holds the key, so this is the ONLY way an Auth0 app can produce a proof whose
565
+ `jkt` matches its token's `cnf.jkt`.
566
+
567
+ ```ts
568
+ const signer = auth0DpopSigner((args) => auth0.generateDpopProof(args))
569
+ ```
570
+
571
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L174)
572
+
573
+ Import: `import {auth0DpopSigner} from '@t3foundry/tasra-sdk'`
574
+
575
+ ```ts
576
+ declare function auth0DpopSigner(generate: (args: {
577
+ url: string;
578
+ method: string;
579
+ nonce?: string;
580
+ accessToken?: string;
581
+ }) => Promise<string>): DpopSigner;
582
+ ```
583
+
584
+ | Parameter | Type | Description |
585
+ |---|---|---|
586
+ | ` generate ` | ` (args: { url: string; method: string; nonce?: string; accessToken?: string; }) => Promise<string> ` | - Callback that creates a DPoP proof using the identity provider client's bound key. |
587
+
588
+ Returns: ` DpopSigner `.
589
+
590
+ ### buildHolderProof
591
+
592
+ Build a holder-proof compact-JWS (header.payload.signature).
593
+
594
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L135)
595
+
596
+ Import: `import {buildHolderProof} from '@t3foundry/tasra-sdk'`
597
+
598
+ ```ts
599
+ declare function buildHolderProof(opts: BuildHolderProofOpts): Promise<string>;
600
+ ```
601
+
602
+ | Parameter | Type | Description |
603
+ |---|---|---|
604
+ | ` opts ` | ` BuildHolderProofOpts ` | - Holder signer, challenge, audience and ordered credentials to bind. |
605
+
606
+ Returns: ` Promise<string> `.
607
+
608
+ ### buildTasraText
609
+
610
+ Encode serialized envelope bytes as a Tasra encrypted text payload.
611
+
612
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/detect.ts#L46)
613
+
614
+ Import: `import {buildTasraText} from '@t3foundry/tasra-sdk'`
615
+
616
+ ```ts
617
+ declare function buildTasraText(envelopeBytes: Uint8Array): string;
618
+ ```
619
+
620
+ | Parameter | Type | Description |
621
+ |---|---|---|
622
+ | ` envelopeBytes ` | ` Uint8Array ` | - Binary envelope produced by the envelope serializer. |
623
+
624
+ Returns: ` string `.
625
+
626
+ ### canAccess
627
+
628
+ Check whether held credential views match a DCQL rule without network access.
629
+
630
+ Accepts a [RecipientStore](#recipientstore) or a bare [HeldCredential](#heldcredential) list.
631
+ Unlike ` RecipientStore.satisfies `, a malformed rule returns `false`
632
+ (fail-closed) rather than throwing.
633
+
634
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/recipient/store.ts#L108)
635
+
636
+ Import: `import {canAccess} from '@t3foundry/tasra-sdk'`
637
+
638
+ ```ts
639
+ declare function canAccess(rule: string, store: RecipientStore | HeldCredential[]): boolean;
640
+ ```
641
+
642
+ | Parameter | Type | Description |
643
+ |---|---|---|
644
+ | ` rule ` | ` string ` | - DCQL policy encoded as JSON text. |
645
+ | ` store ` | ` RecipientStore \| HeldCredential[] ` | - Held credential views used for the local access decision. |
646
+
647
+ Returns: ` boolean `.
648
+
649
+ ### canonicalizeDcql
650
+
651
+ RFC 8785 (JCS) canonical form: sorted keys, no insignificant whitespace, ECMAScript
652
+ number formatting, UTF-8.
653
+
654
+ Why the commitment needs this at all: the rule stops being an opaque string the
655
+ moment it becomes the `dcql_query` inside a signed OID4VP request object. It must be
656
+ parsed and re-serialised, and any JSON library may reorder keys or restyle
657
+ whitespace. Hashing raw bytes would break the commitment at exactly the point the
658
+ rule is used for its new purpose.
659
+
660
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L945)
661
+
662
+ Import: `import {canonicalizeDcql} from '@t3foundry/tasra-sdk'`
663
+
664
+ ```ts
665
+ declare function canonicalizeDcql(rule: string): string;
666
+ ```
667
+
668
+ | Parameter | Type | Description |
669
+ |---|---|---|
670
+ | ` rule ` | ` string ` | - DCQL policy encoded as JSON text. |
671
+
672
+ Returns: ` string `.
673
+
674
+ ### combineDecryptShares
675
+
676
+ Interpolate distinct partial decryptions and authenticate the plaintext. Enable verify to check each share before combining; the caller supplies a sufficient threshold.
677
+
678
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L286)
679
+
680
+ Import: `import {combineDecryptShares} from '@t3foundry/tasra-sdk'`
681
+
682
+ ```ts
683
+ declare function combineDecryptShares(shares: DecryptShare[], ct: Ciphertext, identity: Uint8Array, opts?: {
684
+ verify?: boolean;
685
+ }): Uint8Array;
686
+ ```
687
+
688
+ | Parameter | Type | Description |
689
+ |---|---|---|
690
+ | ` shares ` | ` DecryptShare[] ` | - Distinct participant shares sufficient for the slot threshold. |
691
+ | ` ct ` | ` Ciphertext ` | - Ciphertext associated with the partial decryptions. |
692
+ | ` identity ` | ` Uint8Array ` | - Original encryption associated data. |
693
+ | ` opts? ` | ` { verify?: boolean; } ` | - Whether to verify each partial decryption before combining. |
694
+
695
+ Returns: ` Uint8Array `.
696
+
697
+ ### createDpopKey
698
+
699
+ Generate an ES256 DPoP key pair with a non-extractable private key.
700
+ The returned signer can create proofs without exposing the private key bytes.
701
+
702
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L89)
703
+
704
+ Import: `import {createDpopKey} from '@t3foundry/tasra-sdk'`
705
+
706
+ ```ts
707
+ declare function createDpopKey(): Promise<DpopKey>;
708
+ ```
709
+
710
+ Returns: ` Promise<DpopKey> `.
711
+
712
+ ### createHolderProof
713
+
714
+ Convenience: fetch a nonce and build the holder proof in one step. Returns the
715
+ compact-JWS to put in the `holder_proof` field of a `verify-vp-jwt` /
716
+ `committee-authorize` request.
717
+
718
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L173)
719
+
720
+ Import: `import {createHolderProof} from '@t3foundry/tasra-sdk'`
721
+
722
+ ```ts
723
+ declare function createHolderProof(verifierUrl: string, opts: {
724
+ signer: HolderSigner;
725
+ audience: string;
726
+ credentials: string[];
727
+ slotId?: string;
728
+ action?: string;
729
+ ttlSecs?: number;
730
+ }): Promise<string>;
731
+ ```
732
+
733
+ | Parameter | Type | Description |
734
+ |---|---|---|
735
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
736
+ | ` opts ` | ` { signer: HolderSigner; audience: string; credentials: string[]; slotId?: string; action?: string; ttlSecs?: number; } ` | - Holder signer, verifier audience, credentials and optional operation binding. |
737
+
738
+ Returns: ` Promise<string> `.
739
+
740
+ ### createOauthSession
741
+
742
+ Open an `oauth` session - same creator authorisation, same committee draw, same
743
+ derived nonce, same poll contract as [createOid4vpSession](#createoid4vpsession). No QR, no Request
744
+ Object, no JWE key: the client presents an access token its own IdP minted.
745
+
746
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L278)
747
+
748
+ Import: `import {createOauthSession} from '@t3foundry/tasra-sdk'`
749
+
750
+ ```ts
751
+ declare function createOauthSession(verifierAgentUrl: string, params: CreateSessionParams): Promise<CreateOauthSessionResult>;
752
+ ```
753
+
754
+ | Parameter | Type | Description |
755
+ |---|---|---|
756
+ | ` verifierAgentUrl ` | ` string ` | - Verifier-agent HTTP base URL from the selected network manifest. |
757
+ | ` params ` | ` CreateSessionParams ` | - Signed operation, optional delegation and raw payload. |
758
+
759
+ Returns: ` Promise<CreateOauthSessionResult> `.
760
+
761
+ ### createOid4vpSession
762
+
763
+ Create an OID4VP session on the Verifier Agent.
764
+
765
+ The verifier-agent derives a nonce, generates an ECDH key for JWE, and returns a QR
766
+ payload the wallet scans. The session ID and poll secret are used to poll
767
+ for the result.
768
+
769
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L238)
770
+
771
+ Import: `import {createOid4vpSession} from '@t3foundry/tasra-sdk'`
772
+
773
+ ```ts
774
+ declare function createOid4vpSession(verifierAgentUrl: string, params: CreateSessionParams): Promise<CreateSessionResult>;
775
+ ```
776
+
777
+ | Parameter | Type | Description |
778
+ |---|---|---|
779
+ | ` verifierAgentUrl ` | ` string ` | - Verifier-agent HTTP base URL from the selected network manifest. |
780
+ | ` params ` | ` CreateSessionParams ` | - Signed operation, optional delegation and raw payload. |
781
+
782
+ Returns: ` Promise<CreateSessionResult> `.
783
+
784
+ ### createRenewal
785
+
786
+ Create a long-lived renewal from a presentation. On the prod (signed) path,
787
+ pass `credentials` (compact JWS JWT-VCs) - they're signature-verified and
788
+ replace the presentation's credentials. `slot_ids` (if given) are rotated via
789
+ a webhook when the renewal is revoked.
790
+ POST {verifier}/v1/renewals
791
+
792
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L57)
793
+
794
+ Import: `import {createRenewal} from '@t3foundry/tasra-sdk'`
795
+
796
+ ```ts
797
+ declare function createRenewal(verifierUrl: string, body: {
798
+ dcql_rule: string;
799
+ presentation: unknown;
800
+ credentials?: string[];
801
+ slot_ids?: string[];
802
+ }): Promise<RenewalGrant>;
803
+ ```
804
+
805
+ | Parameter | Type | Description |
806
+ |---|---|---|
807
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
808
+ | ` body ` | ` { dcql_rule: string; presentation: unknown; credentials?: string[]; slot_ids?: string[]; } ` | - Policy, presentation and optional signed credentials or revocation-bound slots. |
809
+
810
+ Returns: ` Promise<RenewalGrant> `.
811
+
812
+ ### createTasraClient
813
+
814
+ Create a client for JWT-authorized slot sessions. Configure endpoints from a network manifest downloaded from the tasra-releases repository.
815
+
816
+ Sessions assemble the master key lazily on first decryption and clear it on close. Only renewal-token authorization renews automatically; other modes require a new session after expiry.
817
+
818
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/client.ts#L190)
819
+
820
+ Import: `import {createTasraClient} from '@t3foundry/tasra-sdk'`
821
+
822
+ ```ts
823
+ declare function createTasraClient(config: TasraClientConfig): TasraClient;
824
+ ```
825
+
826
+ | Parameter | Type | Description |
827
+ |---|---|---|
828
+ | ` config ` | ` TasraClientConfig ` | - Keeper URLs and the verifier or holder identity required by the selected authorization mode. |
829
+
830
+ Returns: ` TasraClient `.
831
+
832
+ Return details: A client that opens and tracks managed slot sessions.
833
+
834
+ Throws: If no keeper URL is supplied.
835
+
836
+ ### credentialsCommitment
837
+
838
+ `base64url(sha256(credentials joined by "\n"))`.
839
+
840
+ MUST byte-for-byte match the verifier's `credentials_commitment`
841
+ (the reference holder-proof implementation). Order-sensitive and delimiter-framed so both
842
+ sides agree without JSON canonicalization. Binds a holder proof to the exact set of
843
+ compact-JWS credentials being presented.
844
+
845
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L43)
846
+
847
+ Import: `import {credentialsCommitment} from '@t3foundry/tasra-sdk'`
848
+
849
+ ```ts
850
+ declare function credentialsCommitment(credentials: string[]): string;
851
+ ```
852
+
853
+ | Parameter | Type | Description |
854
+ |---|---|---|
855
+ | ` credentials ` | ` string[] ` | - Ordered compact credential strings; order is part of the commitment. |
856
+
857
+ Returns: ` string `.
858
+
859
+ ### decodeJwtClaims
860
+
861
+ Decode JWT claims WITHOUT verifying the signature (for expiry/UX only).
862
+
863
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L274)
864
+
865
+ Import: `import {decodeJwtClaims} from '@t3foundry/tasra-sdk'`
866
+
867
+ ```ts
868
+ declare function decodeJwtClaims(jwt: string): JwtClaims | null;
869
+ ```
870
+
871
+ | Parameter | Type | Description |
872
+ |---|---|---|
873
+ | ` jwt ` | ` string ` | - Compact JWT to decode without signature verification. |
874
+
875
+ Returns: ` JwtClaims | null `.
876
+
877
+ ### decryptCustody
878
+
879
+ Decrypt via the custody path: the node runs the whole k-of-n ceremony and
880
+ returns the plaintext (one HTTP round-trip).
881
+
882
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L81)
883
+
884
+ Import: `import {decryptCustody} from '@t3foundry/tasra-sdk'`
885
+
886
+ ```ts
887
+ declare function decryptCustody(opts: DecryptCustodyOpts): Promise<Uint8Array>;
888
+ ```
889
+
890
+ | Parameter | Type | Description |
891
+ |---|---|---|
892
+ | ` opts ` | ` DecryptCustodyOpts ` | - Keeper endpoint, JWT, ciphertext, associated data and decryption participants. |
893
+
894
+ Returns: ` Promise<Uint8Array> `.
895
+
896
+ ### decryptWithMasterKey
897
+
898
+ Decrypt with a reconstructed BLS master secret key and the original associated data. Reject malformed keys or failed authentication.
899
+
900
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L214)
901
+
902
+ Import: `import {decryptWithMasterKey} from '@t3foundry/tasra-sdk'`
903
+
904
+ ```ts
905
+ declare function decryptWithMasterKey(mskBytes: Uint8Array, ct: Ciphertext, identity: Uint8Array): Uint8Array;
906
+ ```
907
+
908
+ | Parameter | Type | Description |
909
+ |---|---|---|
910
+ | ` mskBytes ` | ` Uint8Array ` | - 32-byte little-endian master secret scalar. |
911
+ | ` ct ` | ` Ciphertext ` | - Group ciphertext to decrypt. |
912
+ | ` identity ` | ` Uint8Array ` | - Original associated data supplied during encryption. |
913
+
914
+ Returns: ` Uint8Array `.
915
+
916
+ ### decryptWithShardDelivery
917
+
918
+ Decrypt via the shard-delivery path: fetch a partial decryption from each
919
+ node and combine the shares locally (the master key is never assembled).
920
+
921
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L149)
922
+
923
+ Import: `import {decryptWithShardDelivery} from '@t3foundry/tasra-sdk'`
924
+
925
+ ```ts
926
+ declare function decryptWithShardDelivery(opts: ShardDecryptOpts): Promise<Uint8Array>;
927
+ ```
928
+
929
+ | Parameter | Type | Description |
930
+ |---|---|---|
931
+ | ` opts ` | ` ShardDecryptOpts ` | - Keeper endpoints, JWT, ciphertext and optional per-share verification. |
932
+
933
+ Returns: ` Promise<Uint8Array> `.
934
+
935
+ ### ed25519DidKey
936
+
937
+ A did:key identifier for an Ed25519 public key (multicodec 0xed01, base58btc). Useful
938
+ when the holder is identified by a self-certifying did:key.
939
+
940
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L202)
941
+
942
+ Import: `import {ed25519DidKey} from '@t3foundry/tasra-sdk'`
943
+
944
+ ```ts
945
+ declare function ed25519DidKey(publicKey: Uint8Array): string;
946
+ ```
947
+
948
+ | Parameter | Type | Description |
949
+ |---|---|---|
950
+ | ` publicKey ` | ` Uint8Array ` | - 32-byte Ed25519 public key. |
951
+
952
+ Returns: ` string `.
953
+
954
+ ### encryptEnvelope
955
+
956
+ Encrypt `plaintext` to a slot's group key - ChaCha20-Poly1305 under a BLS12-381
957
+ G2 ElGamal KEM. Local and synchronous: it needs only the slot's **public** key,
958
+ so no JWT, no node round-trip, and no assembled secret.
959
+
960
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/envelope.ts#L257)
961
+
962
+ Import: `import {encryptEnvelope} from '@t3foundry/tasra-sdk'`
963
+
964
+ ```ts
965
+ declare function encryptEnvelope(slotId: Uint8Array, mpkBytes: Uint8Array, identity: Uint8Array, plaintext: Uint8Array, epoch?: bigint | null): GroupEnvelope;
966
+ ```
967
+
968
+ | Parameter | Type | Description |
969
+ |---|---|---|
970
+ | ` slotId ` | ` Uint8Array ` | the 32-byte slot id (raw bytes, not hex) |
971
+ | ` mpkBytes ` | ` Uint8Array ` | the slot's 96-byte compressed G2 group public key, as served by `GET /v1/keys/{slot}/public` (see `fetchMpk`) |
972
+ | ` identity ` | ` Uint8Array ` | additional authenticated data bound into the AEAD. Conventionally the slot id itself; the managed session defaults to exactly that. |
973
+ | ` plaintext ` | ` Uint8Array ` | the bytes to encrypt |
974
+ | ` epoch? ` | ` bigint \| null ` | the current slot epoch, producing a v0x02 envelope; `null` produces a legacy v0x01 envelope with no epoch binding |
975
+
976
+ Returns: ` GroupEnvelope `.
977
+
978
+ Return details: the envelope - pass through `toBytes()` then `buildTasraText()` for
979
+ the opaque `[KK]<base64>` wire form
980
+
981
+ Throws: {Error} if `slotId` is not 32 bytes, `identity` exceeds its cap, `plaintext`
982
+ exceeds ` MAX_PLAINTEXT_LEN `, or `epoch` is negative or above 2^63 - 1
983
+
984
+ Example from source:
985
+
986
+ ```ts
987
+ const {mpkBytes, epoch} = await fetchMpk(nodeUrl, slotHex)
988
+ const env = encryptEnvelope(hexToBytes(slotHex), mpkBytes, hexToBytes(slotHex), bytes, BigInt(epoch))
989
+ const wire = buildTasraText(toBytes(env)) // hand to ANY transport
990
+ ```
991
+
992
+ ### ethSignatureV
993
+
994
+ Map the raw recovery id (0/1) to an Ethereum `v`: legacy 27/28, or EIP-155
995
+ (`35 + 2*chainId + yParity`) when a chainId is given.
996
+
997
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/ecdsa.ts#L88)
998
+
999
+ Import: `import {ethSignatureV} from '@t3foundry/tasra-sdk'`
1000
+
1001
+ ```ts
1002
+ declare function ethSignatureV(yParity: number, chainId?: number): number;
1003
+ ```
1004
+
1005
+ | Parameter | Type | Description |
1006
+ |---|---|---|
1007
+ | ` yParity ` | ` number ` | - Recovery parity, zero or one. |
1008
+ | ` chainId? ` | ` number ` | - Optional chain identifier for an EIP-155 transaction signature. |
1009
+
1010
+ Returns: ` number `.
1011
+
1012
+ ### evaluateDcql
1013
+
1014
+ Does `credentials` satisfy `rule`?
1015
+
1016
+ Returns `true` to grant and `false` to deny; throws [DcqlMalformedError](#dcqlmalformederror) when
1017
+ the rule itself is broken. Takes NO holder identity - DCQL constrains credentials,
1018
+ and holder identity is established by the presentation's holder binding. That is why
1019
+ the legacy `required_sub_in` clause has no encoding here.
1020
+
1021
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L656)
1022
+
1023
+ Import: `import {evaluateDcql} from '@t3foundry/tasra-sdk'`
1024
+
1025
+ ```ts
1026
+ declare function evaluateDcql(rule: string, credentials: readonly CredentialView[]): boolean;
1027
+ ```
1028
+
1029
+ | Parameter | Type | Description |
1030
+ |---|---|---|
1031
+ | ` rule ` | ` string ` | - DCQL policy encoded as JSON text. |
1032
+ | ` credentials ` | ` readonly CredentialView[] ` | - Credential views whose signatures and trust were already validated. |
1033
+
1034
+ Returns: ` boolean `.
1035
+
1036
+ ### evaluateEnvelope
1037
+
1038
+ Evaluate an envelope against a presentation locally - the same gate and evaluator the
1039
+ network's verifiers run. Advisory: the network still verifies the token, its DPoP proof,
1040
+ its age and audience before any policy runs, which this does not.
1041
+
1042
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L588)
1043
+
1044
+ Import: `import {evaluateEnvelope} from '@t3foundry/tasra-sdk'`
1045
+
1046
+ ```ts
1047
+ declare function evaluateEnvelope(rule: string, presentation: OauthPresentation | string): Promise<EnvelopeVerdict>;
1048
+ ```
1049
+
1050
+ | Parameter | Type | Description |
1051
+ |---|---|---|
1052
+ | ` rule ` | ` string ` | - Envelope rule text. |
1053
+ | ` presentation ` | ` OauthPresentation \| string ` | - Holder and the verified claims of each presented token, or its JSON text passed verbatim (keeps integers beyond 2^53 exact, as the network reads them). |
1054
+
1055
+ Returns: ` Promise<EnvelopeVerdict> `.
1056
+
1057
+ ### evaluateIdentityScoped
1058
+
1059
+ Does `credentials` authorize an identity-scoped operation on `identity`?
1060
+
1061
+ The ` evaluate ` WHO gate PLUS the WHICH gate: a satisfied credential query
1062
+ carrying `kk_identity_scope_claim` must have a matching credential whose scope grant
1063
+ (a string or array at that path) covers `identity` ([scopeCovers](#scopecovers)) and - under
1064
+ `kk_scope_namespace: "issuer"` - whose verified issuer owns the identity's namespace
1065
+ (its first `/`-segment must byte-equal the issuer DID, the self-grant-over-others
1066
+ gate). A rule with no scope binding on any satisfied query denies: an unscoped rule
1067
+ can never authorize a scoped operation.
1068
+
1069
+ Local evaluation is ADVISORY here as everywhere in this SDK - the verifier
1070
+ committee runs the authoritative check; a wrong local answer costs a wasted request,
1071
+ never access.
1072
+
1073
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L802)
1074
+
1075
+ Import: `import {evaluateIdentityScoped} from '@t3foundry/tasra-sdk'`
1076
+
1077
+ ```ts
1078
+ declare function evaluateIdentityScoped(rule: string, credentials: readonly CredentialView[], identity: string): boolean;
1079
+ ```
1080
+
1081
+ | Parameter | Type | Description |
1082
+ |---|---|---|
1083
+ | ` rule ` | ` string ` | - DCQL policy containing identity-scope constraints. |
1084
+ | ` credentials ` | ` readonly CredentialView[] ` | - Authenticated credential views to evaluate. |
1085
+ | ` identity ` | ` string ` | - Requested identity string whose scope must be authorized. |
1086
+
1087
+ Returns: ` boolean `.
1088
+
1089
+ ### fetchAndAssembleKey
1090
+
1091
+ Fetch key shards concurrently and interpolate the slot's master secret key in this process. The caller must obtain a sufficient threshold from one epoch and clear the returned key after use.
1092
+
1093
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/keys/node-client.ts#L57)
1094
+
1095
+ Import: `import {fetchAndAssembleKey} from '@t3foundry/tasra-sdk'`
1096
+
1097
+ ```ts
1098
+ declare function fetchAndAssembleKey(cfg: NodeConfig, slotHex: string): Promise<Uint8Array>;
1099
+ ```
1100
+
1101
+ | Parameter | Type | Description |
1102
+ |---|---|---|
1103
+ | ` cfg ` | ` NodeConfig ` | - Keeper URLs and a JWT authorizing shard release. |
1104
+ | ` slotHex ` | ` string ` | - 32-byte slot identifier, with or without the 0x prefix. |
1105
+
1106
+ Returns: ` Promise<Uint8Array> `.
1107
+
1108
+ Return details: The reconstructed master secret key as a 32-byte little-endian scalar.
1109
+
1110
+ Throws: If no shards are returned or interpolation fails.
1111
+
1112
+ ### fetchHolderNonce
1113
+
1114
+ Mint a single-use challenge nonce, optionally bound to a slot id + action (F4).
1115
+ POST {verifier}/v1/nonce
1116
+
1117
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L68)
1118
+
1119
+ Import: `import {fetchHolderNonce} from '@t3foundry/tasra-sdk'`
1120
+
1121
+ ```ts
1122
+ declare function fetchHolderNonce(verifierUrl: string, opts?: {
1123
+ slotId?: string;
1124
+ action?: string;
1125
+ }): Promise<HolderNonce>;
1126
+ ```
1127
+
1128
+ | Parameter | Type | Description |
1129
+ |---|---|---|
1130
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
1131
+ | ` opts? ` | ` { slotId?: string; action?: string; } ` | - Optional slot and action binding for the single-use challenge. |
1132
+
1133
+ Returns: ` Promise<HolderNonce> `.
1134
+
1135
+ ### fetchMpk
1136
+
1137
+ Fetch a slot's group public key and epoch from a keeper. Reject a reply without a ready key.
1138
+
1139
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/keys/node-client.ts#L25)
1140
+
1141
+ Import: `import {fetchMpk} from '@t3foundry/tasra-sdk'`
1142
+
1143
+ ```ts
1144
+ declare function fetchMpk(nodeUrl: string, slotHex: string): Promise<{
1145
+ mpkBytes: Uint8Array;
1146
+ epoch: number;
1147
+ }>;
1148
+ ```
1149
+
1150
+ | Parameter | Type | Description |
1151
+ |---|---|---|
1152
+ | ` nodeUrl ` | ` string ` | - Keeper HTTP base URL from the downloaded network manifest or authenticated registry. |
1153
+ | ` slotHex ` | ` string ` | - 32-byte slot identifier, with or without the 0x prefix. |
1154
+
1155
+ Returns:
1156
+
1157
+ ```ts
1158
+ Promise<{
1159
+ mpkBytes: Uint8Array;
1160
+ epoch: number;
1161
+ }>
1162
+ ```
1163
+
1164
+ ### fromBytes
1165
+
1166
+ Parse a supported binary envelope and validate its version, field lengths and boundaries.
1167
+
1168
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/envelope.ts#L118)
1169
+
1170
+ Import: `import {fromBytes} from '@t3foundry/tasra-sdk'`
1171
+
1172
+ ```ts
1173
+ declare function fromBytes(bytes: Uint8Array): GroupEnvelope;
1174
+ ```
1175
+
1176
+ | Parameter | Type | Description |
1177
+ |---|---|---|
1178
+ | ` bytes ` | ` Uint8Array ` | - Complete binary envelope to parse. |
1179
+
1180
+ Returns: ` GroupEnvelope `.
1181
+
1182
+ ### hexToBytes
1183
+
1184
+ Decode hexadecimal text, accepting an optional 0x prefix. Reject odd-length input; callers must validate hexadecimal characters before decoding.
1185
+
1186
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/hex.ts#L7)
1187
+
1188
+ Import: `import {hexToBytes} from '@t3foundry/tasra-sdk'`
1189
+
1190
+ ```ts
1191
+ declare function hexToBytes(hex: string): Uint8Array;
1192
+ ```
1193
+
1194
+ | Parameter | Type | Description |
1195
+ |---|---|---|
1196
+ | ` hex ` | ` string ` | - Hexadecimal bytes, with an optional 0x prefix. |
1197
+
1198
+ Returns: ` Uint8Array `.
1199
+
1200
+ ### httpFaucet
1201
+
1202
+ HTTP faucet client: POST {faucetUrl}/faucet {address} to FaucetGrant.
1203
+ Matches the network faucet service.
1204
+
1205
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/slots/faucet.ts#L32)
1206
+
1207
+ Import: `import {httpFaucet} from '@t3foundry/tasra-sdk'`
1208
+
1209
+ ```ts
1210
+ declare function httpFaucet(faucetUrl: string): Faucet;
1211
+ ```
1212
+
1213
+ | Parameter | Type | Description |
1214
+ |---|---|---|
1215
+ | ` faucetUrl ` | ` string ` | - Faucet HTTP base URL advertised for the selected network. |
1216
+
1217
+ Returns: ` Faucet `.
1218
+
1219
+ ### ibeBlobChunkRange
1220
+
1221
+ Return a chunk's encrypted byte range as [start, end), including its 16-byte tag.
1222
+ The final chunk has header.size - index * header.chunkSize plaintext bytes.
1223
+ An empty object has one chunk: start 0, end 16, plainLength 0.
1224
+ Use a trusted header and validate that index is a safe integer before calling.
1225
+ Negative indices and indices at or beyond header.chunkCount throw RangeError.
1226
+ For an HTTP Range header, use end - 1 as the inclusive last byte.
1227
+
1228
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L104)
1229
+
1230
+ Import: `import {ibeBlobChunkRange} from '@t3foundry/tasra-sdk'`
1231
+
1232
+ ```ts
1233
+ declare function ibeBlobChunkRange(header: IbeBlobHeader, index: number): {
1234
+ start: number;
1235
+ end: number;
1236
+ plainLength: number;
1237
+ };
1238
+ ```
1239
+
1240
+ | Parameter | Type | Description |
1241
+ |---|---|---|
1242
+ | ` header ` | ` IbeBlobHeader ` | - Blob header describing plaintext length and chunk size. |
1243
+ | ` index ` | ` number ` | - Zero-based integer chunk index below header.chunkCount. |
1244
+
1245
+ Returns:
1246
+
1247
+ ```ts
1248
+ {
1249
+ start: number;
1250
+ end: number;
1251
+ plainLength: number;
1252
+ }
1253
+ ```
1254
+
1255
+ ### ibeBlobDecryptKey
1256
+
1257
+ A WebCrypto key for `dek`, importable once per blob and reused across chunks.
1258
+
1259
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L188)
1260
+
1261
+ Import: `import {ibeBlobDecryptKey} from '@t3foundry/tasra-sdk'`
1262
+
1263
+ ```ts
1264
+ declare function ibeBlobDecryptKey(dek: Uint8Array): Promise<CryptoKey>;
1265
+ ```
1266
+
1267
+ | Parameter | Type | Description |
1268
+ |---|---|---|
1269
+ | ` dek ` | ` Uint8Array ` | - 32-byte unwrapped AES data key to import for decryption. |
1270
+
1271
+ Returns: ` Promise<CryptoKey> `.
1272
+
1273
+ ### ibeBlobDigest
1274
+
1275
+ `sha256(body)` - what a producer signs in its manifest so a reader can check provenance.
1276
+
1277
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L242)
1278
+
1279
+ Import: `import {ibeBlobDigest} from '@t3foundry/tasra-sdk'`
1280
+
1281
+ ```ts
1282
+ declare function ibeBlobDigest(body: Uint8Array): Uint8Array;
1283
+ ```
1284
+
1285
+ | Parameter | Type | Description |
1286
+ |---|---|---|
1287
+ | ` body ` | ` Uint8Array ` | - Complete encrypted blob body to hash. |
1288
+
1289
+ Returns: ` Uint8Array `.
1290
+
1291
+ ### ibeBlobWrappedKey
1292
+
1293
+ The blob's IBE-wrapped data key as an `IbeCiphertext` (what `ibeDecryptWithKey` takes).
1294
+
1295
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L165)
1296
+
1297
+ Import: `import {ibeBlobWrappedKey} from '@t3foundry/tasra-sdk'`
1298
+
1299
+ ```ts
1300
+ declare function ibeBlobWrappedKey(header: IbeBlobHeader): IbeCiphertext;
1301
+ ```
1302
+
1303
+ | Parameter | Type | Description |
1304
+ |---|---|---|
1305
+ | ` header ` | ` IbeBlobHeader ` | - Blob header containing the wrapped data key. |
1306
+
1307
+ Returns: ` IbeCiphertext `.
1308
+
1309
+ ### ibeCombineDecrypt
1310
+
1311
+ Combine k extraction partials and AEAD-decrypt `ct` - mirrors
1312
+ `bls::ibe::combine_decrypt` (verify every share to Lagrange-combine to `T = e(sk_ID,U)`
1313
+ to KDF to open). The intermediate `sk_ID` never leaves this function.
1314
+
1315
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L298)
1316
+
1317
+ Import: `import {ibeCombineDecrypt} from '@t3foundry/tasra-sdk'`
1318
+
1319
+ ```ts
1320
+ declare function ibeCombineDecrypt(verifyingShares: IbeVerifyingShares, shares: IbeDecryptionShare[], ct: IbeCiphertext, identity: Uint8Array): Uint8Array;
1321
+ ```
1322
+
1323
+ | Parameter | Type | Description |
1324
+ |---|---|---|
1325
+ | ` verifyingShares ` | ` IbeVerifyingShares ` | - Participant identifiers and authenticated G2 verifying shares. |
1326
+ | ` shares ` | ` IbeDecryptionShare[] ` | - Distinct identity-key shares sufficient for the slot threshold. |
1327
+ | ` ct ` | ` IbeCiphertext ` | - IBE ciphertext to decrypt. |
1328
+ | ` identity ` | ` Uint8Array ` | - Identity bytes used during encryption. |
1329
+
1330
+ Returns: ` Uint8Array `.
1331
+
1332
+ ### ibeCombineExtract
1333
+
1334
+ Lagrange-combine k verified partials into the identity key `sk_ID = msk * Q_ID`
1335
+ (48-byte compressed G1).
1336
+
1337
+ Holding `sk_ID` is a DURABLE capability over every past and future ciphertext to
1338
+ this identity - prefer [ibeCombineDecrypt](#ibecombinedecrypt), which uses and drops it. Verifies
1339
+ every share first (a caller combining unverified shares could be fed garbage that
1340
+ silently fails the AEAD later, unattributed).
1341
+
1342
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L267)
1343
+
1344
+ Import: `import {ibeCombineExtract} from '@t3foundry/tasra-sdk'`
1345
+
1346
+ ```ts
1347
+ declare function ibeCombineExtract(verifyingShares: IbeVerifyingShares, shares: IbeDecryptionShare[], identity: Uint8Array): Uint8Array;
1348
+ ```
1349
+
1350
+ | Parameter | Type | Description |
1351
+ |---|---|---|
1352
+ | ` verifyingShares ` | ` IbeVerifyingShares ` | - Participant identifiers and authenticated G2 verifying shares. |
1353
+ | ` shares ` | ` IbeDecryptionShare[] ` | - Distinct identity-key shares sufficient for the slot threshold. |
1354
+ | ` identity ` | ` Uint8Array ` | - Exact bytes of the requested identity. |
1355
+
1356
+ Returns: ` Uint8Array `.
1357
+
1358
+ ### ibeDecryptBlobChunk
1359
+
1360
+ Decrypt one chunk (its exact body slice, see [ibeBlobChunkRange](#ibeblobchunkrange)).
1361
+
1362
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L200)
1363
+
1364
+ Import: `import {ibeDecryptBlobChunk} from '@t3foundry/tasra-sdk'`
1365
+
1366
+ ```ts
1367
+ declare function ibeDecryptBlobChunk(key: CryptoKey, header: IbeBlobHeader, index: number, chunk: Uint8Array): Promise<Uint8Array>;
1368
+ ```
1369
+
1370
+ | Parameter | Type | Description |
1371
+ |---|---|---|
1372
+ | ` key ` | ` CryptoKey ` | - AES-GCM decryption key imported from the unwrapped data key. |
1373
+ | ` header ` | ` IbeBlobHeader ` | - Header providing chunk identity and authentication context. |
1374
+ | ` index ` | ` number ` | - Zero-based integer chunk index below header.chunkCount. |
1375
+ | ` chunk ` | ` Uint8Array ` | - Complete encrypted chunk including its authentication tag. |
1376
+
1377
+ Returns: ` Promise<Uint8Array> `.
1378
+
1379
+ ### ibeDecryptRequest
1380
+
1381
+ One-call identity-scoped decrypt (the read path): token to extraction fan-out
1382
+ to verify each partial to combine to decrypt. The intermediate `sk_ID` never surfaces.
1383
+
1384
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#L501)
1385
+
1386
+ Import: `import {ibeDecryptRequest} from '@t3foundry/tasra-sdk'`
1387
+
1388
+ ```ts
1389
+ declare function ibeDecryptRequest(opts: IbeExtractRequestOpts & {
1390
+ ciphertext: IbeCiphertext;
1391
+ }): Promise<Uint8Array>;
1392
+ ```
1393
+
1394
+ | Parameter | Type | Description |
1395
+ |---|---|---|
1396
+ | ` opts ` | ` IbeExtractRequestOpts & { ciphertext: IbeCiphertext; } ` | - Authorization context, identity and IBE ciphertext to decrypt. |
1397
+
1398
+ Returns: ` Promise<Uint8Array> `.
1399
+
1400
+ ### ibeDecryptWithKey
1401
+
1402
+ Decrypt with an already-extracted identity key (48-byte compressed G1) - the
1403
+ custody-opt-in path pairing with [ibeCombineExtract](#ibecombineextract).
1404
+
1405
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L320)
1406
+
1407
+ Import: `import {ibeDecryptWithKey} from '@t3foundry/tasra-sdk'`
1408
+
1409
+ ```ts
1410
+ declare function ibeDecryptWithKey(skIdBytes: Uint8Array, ct: IbeCiphertext, identity: Uint8Array): Uint8Array;
1411
+ ```
1412
+
1413
+ | Parameter | Type | Description |
1414
+ |---|---|---|
1415
+ | ` skIdBytes ` | ` Uint8Array ` | - 48-byte compressed extracted identity key. |
1416
+ | ` ct ` | ` IbeCiphertext ` | - IBE ciphertext to decrypt. |
1417
+ | ` identity ` | ` Uint8Array ` | - Identity bytes used during encryption. |
1418
+
1419
+ Returns: ` Uint8Array `.
1420
+
1421
+ ### ibeEncrypt
1422
+
1423
+ Encrypt `message` to `identity` under the slot's master public key (96-byte
1424
+ compressed G2). Offline and permissionless - the identity's key need not exist yet.
1425
+
1426
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L193)
1427
+
1428
+ Import: `import {ibeEncrypt} from '@t3foundry/tasra-sdk'`
1429
+
1430
+ ```ts
1431
+ declare function ibeEncrypt(mpkBytes: Uint8Array, identity: Uint8Array, message: Uint8Array): IbeCiphertext;
1432
+ ```
1433
+
1434
+ | Parameter | Type | Description |
1435
+ |---|---|---|
1436
+ | ` mpkBytes ` | ` Uint8Array ` | - 96-byte compressed BLS master public key. |
1437
+ | ` identity ` | ` Uint8Array ` | - Exact identity bytes that decryption must use. |
1438
+ | ` message ` | ` Uint8Array ` | - Plaintext bytes to encrypt. |
1439
+
1440
+ Returns: ` IbeCiphertext `.
1441
+
1442
+ ### ibeExtractRequest
1443
+
1444
+ Resolve an identity-scoped committee token, fan out for extraction partials, verify
1445
+ each (identifiable abort - the error names the node), and return `sk_ID` (48-byte
1446
+ compressed G1).
1447
+
1448
+ CUSTODY OPT-IN: holding `sk_ID` is a durable capability over every past and future
1449
+ ciphertext to this identity. Prefer [ibeDecryptRequest](#ibedecryptrequest), which combines,
1450
+ decrypts and drops it. Zeroize the returned bytes when done.
1451
+
1452
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#L485)
1453
+
1454
+ Import: `import {ibeExtractRequest} from '@t3foundry/tasra-sdk'`
1455
+
1456
+ ```ts
1457
+ declare function ibeExtractRequest(opts: IbeExtractRequestOpts): Promise<Uint8Array>;
1458
+ ```
1459
+
1460
+ | Parameter | Type | Description |
1461
+ |---|---|---|
1462
+ | ` opts ` | ` IbeExtractRequestOpts ` | - Authorization context, keeper endpoints and requested identity. |
1463
+
1464
+ Returns: ` Promise<Uint8Array> `.
1465
+
1466
+ ### ibeOpenBlob
1467
+
1468
+ Open a whole sealed blob with `sk_ID`: unwrap the key, decrypt every chunk, return the
1469
+ plaintext. Streaming consumers use `ibeUnwrapBlobKey` + `ibeDecryptBlobChunk` per range.
1470
+
1471
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L220)
1472
+
1473
+ Import: `import {ibeOpenBlob} from '@t3foundry/tasra-sdk'`
1474
+
1475
+ ```ts
1476
+ declare function ibeOpenBlob(skIdBytes: Uint8Array, header: IbeBlobHeader, body: Uint8Array): Promise<Uint8Array>;
1477
+ ```
1478
+
1479
+ | Parameter | Type | Description |
1480
+ |---|---|---|
1481
+ | ` skIdBytes ` | ` Uint8Array ` | - 48-byte compressed extracted identity key. |
1482
+ | ` header ` | ` IbeBlobHeader ` | - Header returned when the blob was sealed. |
1483
+ | ` body ` | ` Uint8Array ` | - Concatenated encrypted chunks in their original order. |
1484
+
1485
+ Returns: ` Promise<Uint8Array> `.
1486
+
1487
+ ### ibeSealBlob
1488
+
1489
+ Seal `plaintext` to `identity` under the slot's master public key: a fresh data key,
1490
+ IBE-wrapped, and the body as independently-decryptable AES-256-GCM chunks. Offline and
1491
+ permissionless, like `ibeEncrypt`.
1492
+ Empty plaintext produces one authenticated chunk with no plaintext and a 16-byte tag.
1493
+ An exact multiple of chunkSize has no extra chunk; otherwise the last chunk is shorter.
1494
+ Retain a trusted header, or authenticate a manifest containing both the header
1495
+ and body digest. A signed body digest alone does not authenticate the media type.
1496
+
1497
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L125)
1498
+
1499
+ Import: `import {ibeSealBlob} from '@t3foundry/tasra-sdk'`
1500
+
1501
+ ```ts
1502
+ declare function ibeSealBlob(mpkBytes: Uint8Array, identity: string, plaintext: Uint8Array, opts?: {
1503
+ contentType?: string;
1504
+ chunkSize?: number;
1505
+ }): Promise<SealedBlob>;
1506
+ ```
1507
+
1508
+ | Parameter | Type | Description |
1509
+ |---|---|---|
1510
+ | ` mpkBytes ` | ` Uint8Array ` | - 96-byte compressed BLS master public key. |
1511
+ | ` identity ` | ` string ` | - Identity string used to wrap the object data key. |
1512
+ | ` plaintext ` | ` Uint8Array ` | - Complete plaintext object bytes. |
1513
+ | ` opts? ` | ` { contentType?: string; chunkSize?: number; } ` | - Optional media type and integer plaintext chunk size of at least 1024 bytes; default chunk size is 1 MiB. |
1514
+
1515
+ Returns: ` Promise<SealedBlob> `.
1516
+
1517
+ ### ibeUnwrapBlobKey
1518
+
1519
+ Unwrap the data key with the identity's extracted key `sk_ID` (48-byte compressed G1 -
1520
+ `ibeCombineExtract`'s output). One pairing; the caller keeps the returned key in memory only
1521
+ as long as it decrypts, then zeroizes it.
1522
+
1523
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L177)
1524
+
1525
+ Import: `import {ibeUnwrapBlobKey} from '@t3foundry/tasra-sdk'`
1526
+
1527
+ ```ts
1528
+ declare function ibeUnwrapBlobKey(skIdBytes: Uint8Array, header: IbeBlobHeader): Uint8Array;
1529
+ ```
1530
+
1531
+ | Parameter | Type | Description |
1532
+ |---|---|---|
1533
+ | ` skIdBytes ` | ` Uint8Array ` | - 48-byte compressed extracted identity key. |
1534
+ | ` header ` | ` IbeBlobHeader ` | - Header containing the wrapped data key and identity. |
1535
+
1536
+ Returns: ` Uint8Array `.
1537
+
1538
+ ### ibeVerifyShare
1539
+
1540
+ Verify one extraction partial against its node's dual-group verifying share (the
1541
+ 96-byte G2 half): `e(D_i, G2) == e(Q_ID, Y_i)`. Throws naming the identifier -
1542
+ identifiable abort: the caller knows WHICH node served a bad share.
1543
+
1544
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L237)
1545
+
1546
+ Import: `import {ibeVerifyShare} from '@t3foundry/tasra-sdk'`
1547
+
1548
+ ```ts
1549
+ declare function ibeVerifyShare(verifyingShares: IbeVerifyingShares, identity: Uint8Array, share: IbeDecryptionShare): void;
1550
+ ```
1551
+
1552
+ | Parameter | Type | Description |
1553
+ |---|---|---|
1554
+ | ` verifyingShares ` | ` IbeVerifyingShares ` | - Independently established participant identifiers and G2 verifying shares. |
1555
+ | ` identity ` | ` Uint8Array ` | - Exact bytes of the requested identity. |
1556
+ | ` share ` | ` IbeDecryptionShare ` | - Identity-key share to verify. |
1557
+
1558
+ Returns: ` void `.
1559
+
1560
+ ### isAuthDenied
1561
+
1562
+ True when `e` is an auth rejection - i.e. retrying is pointless, re-claim
1563
+ instead. Keyed on the HTTP status rather than the class, so it also catches
1564
+ subclasses that carry their own name (e.g. `CommitteeAuthorizeError`).
1565
+
1566
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L178)
1567
+
1568
+ Import: `import {isAuthDenied} from '@t3foundry/tasra-sdk'`
1569
+
1570
+ ```ts
1571
+ declare function isAuthDenied(e: unknown): e is TasraHttpError;
1572
+ ```
1573
+
1574
+ | Parameter | Type | Description |
1575
+ |---|---|---|
1576
+ | ` e ` | ` unknown ` | - Caught value to classify as an authorization rejection. |
1577
+
1578
+ Returns: ` e is TasraHttpError `.
1579
+
1580
+ ### isHeaderSafeNonce
1581
+
1582
+ Guard for a nonce that can ride in a header (the agent's challenge carries it back).
1583
+
1584
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L194)
1585
+
1586
+ Import: `import {isHeaderSafeNonce} from '@t3foundry/tasra-sdk'`
1587
+
1588
+ ```ts
1589
+ declare function isHeaderSafeNonce(nonce: string): boolean;
1590
+ ```
1591
+
1592
+ | Parameter | Type | Description |
1593
+ |---|---|---|
1594
+ | ` nonce ` | ` string ` | - Nonce text to check before using it as an HTTP header value. |
1595
+
1596
+ Returns: ` boolean `.
1597
+
1598
+ ### isJwtExpiringSoon
1599
+
1600
+ True when the token is expired or within `skewMs` of expiring.
1601
+
1602
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L300)
1603
+
1604
+ Import: `import {isJwtExpiringSoon} from '@t3foundry/tasra-sdk'`
1605
+
1606
+ ```ts
1607
+ declare function isJwtExpiringSoon(jwt: string, skewMs?: number): boolean;
1608
+ ```
1609
+
1610
+ | Parameter | Type | Description |
1611
+ |---|---|---|
1612
+ | ` jwt ` | ` string ` | - Compact JWT to inspect without signature verification. |
1613
+ | ` skewMs? ` | ` number ` | - Refresh lead time in milliseconds. |
1614
+
1615
+ Returns: ` boolean `.
1616
+
1617
+ ### isOauthEnvelope
1618
+
1619
+ Whether `rule` is a `kk_oauth` policy envelope: a JSON object whose only member is
1620
+ `kk_oauth`. Structural only - the envelope's contents are not validated (use
1621
+ [lintEnvelope](#lintenvelope)). Total: never throws.
1622
+
1623
+ Matches the network's grammar dispatch exactly, so the SDK commits an envelope the same way
1624
+ every keeper and verifier re-derives it. A duplicated `kk_oauth` member is not an envelope,
1625
+ and neither is anything longer than `MAX_RULE_LEN` UTF-8 bytes.
1626
+
1627
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L59)
1628
+
1629
+ Import: `import {isOauthEnvelope} from '@t3foundry/tasra-sdk'`
1630
+
1631
+ ```ts
1632
+ declare function isOauthEnvelope(rule: string): boolean;
1633
+ ```
1634
+
1635
+ | Parameter | Type | Description |
1636
+ |---|---|---|
1637
+ | ` rule ` | ` string ` | - Clear rule text to classify. |
1638
+
1639
+ Returns: ` boolean `.
1640
+
1641
+ ### isOid4vpRule
1642
+
1643
+ True when `rule` parses as a supported OID4VP-DCQL query.
1644
+
1645
+ This is the grammar dispatch used by the commitment. It must stay a TOTAL function -
1646
+ a legacy kk-DCQL rule is not an error here, it is simply "not OID4VP".
1647
+
1648
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L998)
1649
+
1650
+ Import: `import {isOid4vpRule} from '@t3foundry/tasra-sdk'`
1651
+
1652
+ ```ts
1653
+ declare function isOid4vpRule(rule: string): boolean;
1654
+ ```
1655
+
1656
+ | Parameter | Type | Description |
1657
+ |---|---|---|
1658
+ | ` rule ` | ` string ` | - Policy text to check for a supported DCQL shape. |
1659
+
1660
+ Returns: ` boolean `.
1661
+
1662
+ ### isRetryable
1663
+
1664
+ True when a typed failure may be transient. Errors outside the TasraError
1665
+ hierarchy return false. This hint does not make a write safe to repeat.
1666
+
1667
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/errors.ts#L188)
1668
+
1669
+ Import: `import {isRetryable} from '@t3foundry/tasra-sdk'`
1670
+
1671
+ ```ts
1672
+ declare function isRetryable(e: unknown): boolean;
1673
+ ```
1674
+
1675
+ | Parameter | Type | Description |
1676
+ |---|---|---|
1677
+ | ` e ` | ` unknown ` | - Caught value to inspect for a retryable Tasra error. |
1678
+
1679
+ Returns: ` boolean `.
1680
+
1681
+ ### issueAdminCredential
1682
+
1683
+ Admin-mint a single-use credential (redemption token) for the given scopes.
1684
+ Requires the verifier's admin secret. Pair with redeemCredential() to get a
1685
+ JWT whose `sub` is the recipient DID you pass there.
1686
+ POST {verifier}/v1/admin/credentials/issue (header: X-Admin-Secret)
1687
+
1688
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L145)
1689
+
1690
+ Import: `import {issueAdminCredential} from '@t3foundry/tasra-sdk'`
1691
+
1692
+ ```ts
1693
+ declare function issueAdminCredential(verifierUrl: string, adminSecret: string, opts: {
1694
+ scopes: string[];
1695
+ slotIds?: string[];
1696
+ ttlSecs?: number;
1697
+ }): Promise<RedemptionGrant>;
1698
+ ```
1699
+
1700
+ | Parameter | Type | Description |
1701
+ |---|---|---|
1702
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
1703
+ | ` adminSecret ` | ` string ` | - Verifier administrative secret; keep it out of browser code and logs. |
1704
+ | ` opts ` | ` { scopes: string[]; slotIds?: string[]; ttlSecs?: number; } ` | - Authorized scopes, optional slot bindings and lifetime. |
1705
+
1706
+ Returns: ` Promise<RedemptionGrant> `.
1707
+
1708
+ ### isTasraPost
1709
+
1710
+ Check the Tasra text prefix and minimum length. This does not validate the envelope.
1711
+
1712
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/detect.ts#L11)
1713
+
1714
+ Import: `import {isTasraPost} from '@t3foundry/tasra-sdk'`
1715
+
1716
+ ```ts
1717
+ declare function isTasraPost(text: string): boolean;
1718
+ ```
1719
+
1720
+ | Parameter | Type | Description |
1721
+ |---|---|---|
1722
+ | ` text ` | ` string ` | - Text payload to inspect for the Tasra prefix. |
1723
+
1724
+ Returns: ` boolean `.
1725
+
1726
+ ### jsonCredential
1727
+
1728
+ A [CredentialView](#credentialview) over a parsed JSON credential body.
1729
+
1730
+ Path resolution walks object keys, plus `null` for "every element of this array". A path
1731
+ that runs into the wrong shape is ABSENT rather than an error, which is what makes the
1732
+ evaluator fail closed.
1733
+
1734
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L182)
1735
+
1736
+ Import: `import {jsonCredential} from '@t3foundry/tasra-sdk'`
1737
+
1738
+ ```ts
1739
+ declare function jsonCredential(args: {
1740
+ format: string;
1741
+ types: readonly string[];
1742
+ body: unknown;
1743
+ }): CredentialView;
1744
+ ```
1745
+
1746
+ | Parameter | Type | Description |
1747
+ |---|---|---|
1748
+ | ` args ` | ` { format: string; types: readonly string[]; body: unknown; } ` | - Format, credential types and parsed JSON body exposed to the evaluator. |
1749
+
1750
+ Returns: ` CredentialView `.
1751
+
1752
+ ### jwkThumbprint
1753
+
1754
+ RFC 7638 JWK thumbprint of an EC P-256 public key.
1755
+
1756
+ The member order is LEXICOGRAPHIC and the JSON has no whitespace - the RFC hashes an
1757
+ exactly specified string, so `JSON.stringify` over an object literal in a different order
1758
+ yields a different thumbprint and the token's `cnf.jkt` would never match.
1759
+
1760
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L145)
1761
+
1762
+ Import: `import {jwkThumbprint} from '@t3foundry/tasra-sdk'`
1763
+
1764
+ ```ts
1765
+ declare function jwkThumbprint(jwk: JsonWebKey): Promise<string>;
1766
+ ```
1767
+
1768
+ | Parameter | Type | Description |
1769
+ |---|---|---|
1770
+ | ` jwk ` | ` JsonWebKey ` | - Public JSON Web Key whose required members form the thumbprint. |
1771
+
1772
+ Returns: ` Promise<string> `.
1773
+
1774
+ ### jwtExpMs
1775
+
1776
+ Expiry as epoch-ms, or null if absent/unparseable.
1777
+
1778
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L289)
1779
+
1780
+ Import: `import {jwtExpMs} from '@t3foundry/tasra-sdk'`
1781
+
1782
+ ```ts
1783
+ declare function jwtExpMs(jwt: string): number | null;
1784
+ ```
1785
+
1786
+ | Parameter | Type | Description |
1787
+ |---|---|---|
1788
+ | ` jwt ` | ` string ` | - Compact JWT whose expiration claim will be inspected without verification. |
1789
+
1790
+ Returns: ` number | null `.
1791
+
1792
+ ### lintEnvelope
1793
+
1794
+ Run the schema and static gate and report whether a keeper would store the envelope today.
1795
+ Throws [RegoEnvelopeError](#regoenvelopeerror) when the envelope is malformed; an envelope valid in a later
1796
+ phase but not admissible now returns `admissible: false` with the reason.
1797
+
1798
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L575)
1799
+
1800
+ Import: `import {lintEnvelope} from '@t3foundry/tasra-sdk'`
1801
+
1802
+ ```ts
1803
+ declare function lintEnvelope(envelope: string): Promise<EnvelopeLint>;
1804
+ ```
1805
+
1806
+ | Parameter | Type | Description |
1807
+ |---|---|---|
1808
+ | ` envelope ` | ` string ` | - Envelope rule text. |
1809
+
1810
+ Returns: ` Promise<EnvelopeLint> `.
1811
+
1812
+ ### loadRego
1813
+
1814
+ Load the policy engine once and reuse it. The module's SHA-256 is verified before it is
1815
+ instantiated; a mismatch refuses to load. Concurrent callers share one load.
1816
+
1817
+ In a bundler that does not emit assets referenced through `new URL(..., import.meta.url)`,
1818
+ pass `wasm` explicitly (bytes or a URL).
1819
+
1820
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L453)
1821
+
1822
+ Import: `import {loadRego} from '@t3foundry/tasra-sdk'`
1823
+
1824
+ ```ts
1825
+ declare function loadRego(opts?: LoadRegoOptions): Promise<RegoEngine>;
1826
+ ```
1827
+
1828
+ | Parameter | Type | Description |
1829
+ |---|---|---|
1830
+ | ` opts? ` | ` LoadRegoOptions ` | - Optional module source and HTTP implementation. |
1831
+
1832
+ Returns: ` Promise<RegoEngine> `.
1833
+
1834
+ ### packEnvelope
1835
+
1836
+ Pack a Rego policy and its token specifications into the canonical (RFC 8785) envelope a
1837
+ slot commits to. The policy source is committed byte for byte - reformatting it is an
1838
+ amendment. Refuses (with [RegoEnvelopeError](#regoenvelopeerror)) anything the static gate refuses.
1839
+
1840
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L554)
1841
+
1842
+ Import: `import {packEnvelope} from '@t3foundry/tasra-sdk'`
1843
+
1844
+ ```ts
1845
+ declare function packEnvelope(policy: string, tokens: OauthTokens | string, entrypoint?: string): Promise<string>;
1846
+ ```
1847
+
1848
+ | Parameter | Type | Description |
1849
+ |---|---|---|
1850
+ | ` policy ` | ` string ` | - Rego v1 module source. |
1851
+ | ` tokens ` | ` OauthTokens \| string ` | - Token specifications (object or JSON text). Duplicate keys in JSON text are refused. |
1852
+ | ` entrypoint? ` | ` string ` | - Rule to evaluate; defaults to ` DEFAULT_REGO_ENTRYPOINT `. |
1853
+
1854
+ Returns: ` Promise<string> `.
1855
+
1856
+ Return details: The envelope string to pass as the slot's rule.
1857
+
1858
+ ### parseTasraPost
1859
+
1860
+ Decode a Tasra text payload into an envelope; return null for invalid input.
1861
+
1862
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/detect.ts#L29)
1863
+
1864
+ Import: `import {parseTasraPost} from '@t3foundry/tasra-sdk'`
1865
+
1866
+ ```ts
1867
+ declare function parseTasraPost(text: string): GroupEnvelope | null;
1868
+ ```
1869
+
1870
+ | Parameter | Type | Description |
1871
+ |---|---|---|
1872
+ | ` text ` | ` string ` | - Text payload to inspect and decode. |
1873
+
1874
+ Returns: ` GroupEnvelope | null `.
1875
+
1876
+ ### payloadDigest
1877
+
1878
+ Compute the `payload_digest` for a given action and message.
1879
+
1880
+ For `sign` and `ibe-extract`, this is `sha256(message_bytes)` as 0x-hex.
1881
+ Other actions should supply the digest directly.
1882
+
1883
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L215)
1884
+
1885
+ Import: `import {payloadDigest} from '@t3foundry/tasra-sdk'`
1886
+
1887
+ ```ts
1888
+ declare function payloadDigest(action: string, messageHex: string): string;
1889
+ ```
1890
+
1891
+ | Parameter | Type | Description |
1892
+ |---|---|---|
1893
+ | ` action ` | ` string ` | - Operation name: sign and ibe-extract hash the supplied bytes. |
1894
+ | ` messageHex ` | ` string ` | - Hexadecimal message bytes or an already computed digest for other actions. |
1895
+
1896
+ Returns: ` string `.
1897
+
1898
+ ### pollOid4vpSession
1899
+
1900
+ 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.
1901
+
1902
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L424)
1903
+
1904
+ Import: `import {pollOid4vpSession} from '@t3foundry/tasra-sdk'`
1905
+
1906
+ ```ts
1907
+ declare function pollOid4vpSession(verifierAgentUrl: string, sessionId: string, pollSecret: string): Promise<SessionStatusResult>;
1908
+ ```
1909
+
1910
+ | Parameter | Type | Description |
1911
+ |---|---|---|
1912
+ | ` verifierAgentUrl ` | ` string ` | - Verifier-agent HTTP base URL. |
1913
+ | ` sessionId ` | ` string ` | - Opened session identifier. |
1914
+ | ` pollSecret ` | ` string ` | - Secret returned at session creation; do not expose it in logs. |
1915
+
1916
+ Returns: ` Promise<SessionStatusResult> `.
1917
+
1918
+ ### redeemCredential
1919
+
1920
+ Redeem an admin-issued, single-use credential/invite token for a JWT.
1921
+ POST {verifier}/v1/credentials/redeem {redemption_token, recipient_did}
1922
+
1923
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L113)
1924
+
1925
+ Import: `import {redeemCredential} from '@t3foundry/tasra-sdk'`
1926
+
1927
+ ```ts
1928
+ declare function redeemCredential(verifierUrl: string, redemptionToken: string, recipientDid: string): Promise<IssuedToken>;
1929
+ ```
1930
+
1931
+ | Parameter | Type | Description |
1932
+ |---|---|---|
1933
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
1934
+ | ` redemptionToken ` | ` string ` | - Single-use credential redemption token. |
1935
+ | ` recipientDid ` | ` string ` | - DID of the recipient redeeming the token. |
1936
+
1937
+ Returns: ` Promise<IssuedToken> `.
1938
+
1939
+ ### redeemRenewalToken
1940
+
1941
+ Redeem a long-lived renewal token for a fresh JWT.
1942
+ POST {verifier}/v1/renewals/redeem {renewal_token}
1943
+
1944
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L95)
1945
+
1946
+ Import: `import {redeemRenewalToken} from '@t3foundry/tasra-sdk'`
1947
+
1948
+ ```ts
1949
+ declare function redeemRenewalToken(verifierUrl: string, renewalToken: string): Promise<IssuedToken>;
1950
+ ```
1951
+
1952
+ | Parameter | Type | Description |
1953
+ |---|---|---|
1954
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
1955
+ | ` renewalToken ` | ` string ` | - Long-lived renewal token to redeem. |
1956
+
1957
+ Returns: ` Promise<IssuedToken> `.
1958
+
1959
+ ### requestIbeExtractionPartials
1960
+
1961
+ Fan out to the keeper nodes and collect extraction partials. Nodes that refuse or are
1962
+ down are skipped; throws - naming every node and its reason - only when NONE served.
1963
+ The caller combines with `ibeCombineDecrypt`/`ibeCombineExtract`, which pairing-verify
1964
+ each partial (identifiable abort names the node via the identifier).
1965
+
1966
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#L627)
1967
+
1968
+ Import: `import {requestIbeExtractionPartials} from '@t3foundry/tasra-sdk'`
1969
+
1970
+ ```ts
1971
+ declare function requestIbeExtractionPartials(opts: IbeExtractOpts): Promise<IbeExtractionPartial[]>;
1972
+ ```
1973
+
1974
+ | Parameter | Type | Description |
1975
+ |---|---|---|
1976
+ | ` opts ` | ` IbeExtractOpts ` | - Compound token, identity, keepers and optional expected epoch. |
1977
+
1978
+ Returns: ` Promise<IbeExtractionPartial[]> `.
1979
+
1980
+ ### revokeRenewal
1981
+
1982
+ Revoke a renewal token - future redeems are denied, and any bound slots get a
1983
+ rotation webhook. POST {verifier}/v1/renewals/revoke {renewal_token}
1984
+
1985
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L77)
1986
+
1987
+ Import: `import {revokeRenewal} from '@t3foundry/tasra-sdk'`
1988
+
1989
+ ```ts
1990
+ declare function revokeRenewal(verifierUrl: string, renewalToken: string): Promise<void>;
1991
+ ```
1992
+
1993
+ | Parameter | Type | Description |
1994
+ |---|---|---|
1995
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
1996
+ | ` renewalToken ` | ` string ` | - Renewal token to revoke. |
1997
+
1998
+ Returns: ` Promise<void> `.
1999
+
2000
+ ### revokeSlotUser
2001
+
2002
+ Submit an administrative request to revoke a holder DID's slot access.
2003
+ Rotation is requested by default. A successful HTTP response confirms request
2004
+ acceptance only; callers must confirm the new slot key and epoch before relying
2005
+ on completed rotation. Resolve application handles to DIDs before calling.
2006
+
2007
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L175)
2008
+
2009
+ Import: `import {revokeSlotUser} from '@t3foundry/tasra-sdk'`
2010
+
2011
+ ```ts
2012
+ declare function revokeSlotUser(verifierUrl: string, adminSecret: string, opts: {
2013
+ slotId: string;
2014
+ did: string;
2015
+ rotate?: boolean;
2016
+ reason?: string;
2017
+ }): Promise<void>;
2018
+ ```
2019
+
2020
+ | Parameter | Type | Description |
2021
+ |---|---|---|
2022
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
2023
+ | ` adminSecret ` | ` string ` | - Verifier administrative secret. |
2024
+ | ` opts ` | ` { slotId: string; did: string; rotate?: boolean; reason?: string; } ` | - Slot, holder DID, optional rotation request and revocation reason. |
2025
+
2026
+ Returns: ` Promise<void> `.
2027
+
2028
+ ### scopeCovers
2029
+
2030
+ Whether the scope `grant` (from a verified credential) covers the requested
2031
+ `identity`. Fail-closed on oversize or NUL-bearing inputs.
2032
+
2033
+ Implemented over UTF-8 BYTES, not UTF-16 code units, deliberately: the reference implementation
2034
+ compares raw bytes, the length cap is in bytes, and the `/`-boundary check indexes a
2035
+ byte position. Operating on `.length`/`charAt` would diverge for any non-ASCII
2036
+ segment.
2037
+
2038
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/identityScope.ts#L47)
2039
+
2040
+ Import: `import {scopeCovers} from '@t3foundry/tasra-sdk'`
2041
+
2042
+ ```ts
2043
+ declare function scopeCovers(grant: string, identity: string): boolean;
2044
+ ```
2045
+
2046
+ | Parameter | Type | Description |
2047
+ |---|---|---|
2048
+ | ` grant ` | ` string ` | - Slash-delimited scope grant, optionally ending in a wildcard. |
2049
+ | ` identity ` | ` string ` | - Requested identity string to compare with the grant. |
2050
+
2051
+ Returns: ` boolean `.
2052
+
2053
+ ### selectDcql
2054
+
2055
+ Select the minimal set of credentials that satisfy `rule` - the inverse of
2056
+ ` evaluate `. Given a rule and held credentials, returns which to present.
2057
+
2058
+ When `credential_sets` are present, picks the cheapest satisfying option
2059
+ (fewest credential queries). When absent, every credential query must be
2060
+ satisfied.
2061
+
2062
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L718)
2063
+
2064
+ Import: `import {selectDcql} from '@t3foundry/tasra-sdk'`
2065
+
2066
+ ```ts
2067
+ declare function selectDcql(rule: string, credentials: readonly CredentialView[], opts?: ValidateOptions): Selection;
2068
+ ```
2069
+
2070
+ | Parameter | Type | Description |
2071
+ |---|---|---|
2072
+ | ` rule ` | ` string ` | - DCQL policy encoded as JSON text. |
2073
+ | ` credentials ` | ` readonly CredentialView[] ` | - Credential views available for local matching. |
2074
+ | ` opts? ` | ` ValidateOptions ` | - Issuer-constraint validation options. |
2075
+
2076
+ Returns: ` Selection `.
2077
+
2078
+ ### signCustody
2079
+
2080
+ Sign a message via the custody path: the node runs the whole FROST ceremony
2081
+ and returns the final group signature (one HTTP round-trip).
2082
+
2083
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/frost.ts#L97)
2084
+
2085
+ Import: `import {signCustody} from '@t3foundry/tasra-sdk'`
2086
+
2087
+ ```ts
2088
+ declare function signCustody(opts: SignCustodyOpts): Promise<FrostSignResult>;
2089
+ ```
2090
+
2091
+ | Parameter | Type | Description |
2092
+ |---|---|---|
2093
+ | ` opts ` | ` SignCustodyOpts ` | - Keeper endpoint, JWT, message and optional participant or owner-approval settings. |
2094
+
2095
+ Returns: ` Promise<FrostSignResult> `.
2096
+
2097
+ ### signEoaDigest
2098
+
2099
+ Threshold-sign a 32-byte digest with a tecdsa slot's key. Returns the raw
2100
+ Ethereum signature components; assemble into a transaction with ethSignatureV().
2101
+
2102
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/ecdsa.ts#L50)
2103
+
2104
+ Import: `import {signEoaDigest} from '@t3foundry/tasra-sdk'`
2105
+
2106
+ ```ts
2107
+ declare function signEoaDigest(opts: EoaSignOpts): Promise<EoaSignature>;
2108
+ ```
2109
+
2110
+ | Parameter | Type | Description |
2111
+ |---|---|---|
2112
+ | ` opts ` | ` EoaSignOpts ` | - Keeper endpoint, JWT, slot and 32-byte ECDSA digest. |
2113
+
2114
+ Returns: ` Promise<EoaSignature> `.
2115
+
2116
+ ### signUserRequest
2117
+
2118
+ Sign the user-gated payload with the slot owner's 32-byte Ed25519 secret key.
2119
+ The result goes in SignCustodyOpts.userSignature (also pass the same requestId).
2120
+
2121
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/frost.ts#L163)
2122
+
2123
+ Import: `import {signUserRequest} from '@t3foundry/tasra-sdk'`
2124
+
2125
+ ```ts
2126
+ declare function signUserRequest(secretKey: Uint8Array, slotId: string, message: Uint8Array, requestId: string): Uint8Array;
2127
+ ```
2128
+
2129
+ | Parameter | Type | Description |
2130
+ |---|---|---|
2131
+ | ` secretKey ` | ` Uint8Array ` | - 32-byte Ed25519 owner secret key. |
2132
+ | ` slotId ` | ` string ` | - 32-byte slot identifier as hexadecimal text. |
2133
+ | ` message ` | ` Uint8Array ` | - Raw message bytes to authorize. |
2134
+ | ` requestId ` | ` string ` | - Request identifier to bind into the owner approval. |
2135
+
2136
+ Returns: ` Uint8Array `.
2137
+
2138
+ ### signWithShardDelivery
2139
+
2140
+ Sign via the shard-delivery path: the CLIENT fans out to k nodes (Round 1
2141
+ commit, Round 2 partial) and aggregates the shares locally into the group
2142
+ signature. The node URLs must be exactly the k committee members.
2143
+
2144
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/frost.ts#L254)
2145
+
2146
+ Import: `import {signWithShardDelivery} from '@t3foundry/tasra-sdk'`
2147
+
2148
+ ```ts
2149
+ declare function signWithShardDelivery(opts: ShardSignOpts): Promise<FrostSignature>;
2150
+ ```
2151
+
2152
+ | Parameter | Type | Description |
2153
+ |---|---|---|
2154
+ | ` opts ` | ` ShardSignOpts ` | - Selected keepers, JWT, message and local signature verification settings. |
2155
+
2156
+ Returns: ` Promise<FrostSignature> `.
2157
+
2158
+ ### submitOauthResponse
2159
+
2160
+ Submit a DPoP-bound access token and proof to an OAuth session. The signer must use the key bound to that token. Retry once when the server responds with a DPoP nonce challenge.
2161
+
2162
+ Speaks the RFC 9449 §9 resource-server contract — token in `Authorization: DPoP`, proof in
2163
+ `DPoP:` — so a conformant client library needs no custom code. It also handles the
2164
+ `use_dpop_nonce` challenge ITSELF: on a `401` carrying `DPoP-Nonce`, it re-mints the proof
2165
+ with the server's nonce and resends ONCE. One retry, not a loop: a server that keeps
2166
+ challenging is broken, and retrying forever would hide that.
2167
+
2168
+ `signer` must be the key the token is bound to — see `../auth/dpop.js` for the two shapes.
2169
+
2170
+ Note: the proof is signed over `dpopHtu` — the agent's PUBLIC origin plus this session's route,
2171
+ as [createOauthSession](#createoauthsession) returned it — and posted to `verifierAgentUrl`. When the two
2172
+ name the same host (the normal case) they are the same URL. When a client reaches the
2173
+ agent through a different base URL, the proof must still name the public one: that is
2174
+ the origin the verifiers approved.
2175
+
2176
+ Throws `VerifierAgentSessionError`: `refused` when the agent reports the session failed
2177
+ (the committee refused, or could not be reached — `message` says which; not retryable on
2178
+ this session), `unavailable` for other 502/503/504, `protocol` for any other non-2xx.
2179
+
2180
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L346)
2181
+
2182
+ Import: `import {submitOauthResponse} from '@t3foundry/tasra-sdk'`
2183
+
2184
+ ```ts
2185
+ declare function submitOauthResponse(verifierAgentUrl: string, args: {
2186
+ sessionId: string;
2187
+ pollSecret: string;
2188
+ accessToken: string;
2189
+ nonce: string;
2190
+ dpopHtu: string;
2191
+ signer: DpopSigner;
2192
+ }): Promise<void>;
2193
+ ```
2194
+
2195
+ | Parameter | Type | Description |
2196
+ |---|---|---|
2197
+ | ` verifierAgentUrl ` | ` string ` | - Verifier-agent HTTP base URL. |
2198
+ | ` args ` | ` { sessionId: string; pollSecret: string; accessToken: string; nonce: string; dpopHtu: string; signer: DpopSigner; } ` | - Session credentials, DPoP-bound access token, nonce, `dpopHtu` and matching signer. |
2199
+
2200
+ Returns: ` Promise<void> `.
2201
+
2202
+ ### toBytes
2203
+
2204
+ Serialize an envelope using the version selected by its epoch. Reject invalid epoch and oversized fields.
2205
+
2206
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/envelope.ts#L57)
2207
+
2208
+ Import: `import {toBytes} from '@t3foundry/tasra-sdk'`
2209
+
2210
+ ```ts
2211
+ declare function toBytes(env: GroupEnvelope): Uint8Array;
2212
+ ```
2213
+
2214
+ | Parameter | Type | Description |
2215
+ |---|---|---|
2216
+ | ` env ` | ` GroupEnvelope ` | - Envelope to serialize, including its slot, ciphertext and optional epoch. |
2217
+
2218
+ Returns: ` Uint8Array `.
2219
+
2220
+ ### unpackEnvelope
2221
+
2222
+ Take an envelope apart into its exact policy source, tokens and entrypoint.
2223
+ `packEnvelope(unpacked.policy, unpacked.tokens, unpacked.entrypoint)` reproduces it.
2224
+
2225
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L564)
2226
+
2227
+ Import: `import {unpackEnvelope} from '@t3foundry/tasra-sdk'`
2228
+
2229
+ ```ts
2230
+ declare function unpackEnvelope(envelope: string): Promise<UnpackedEnvelope>;
2231
+ ```
2232
+
2233
+ | Parameter | Type | Description |
2234
+ |---|---|---|
2235
+ | ` envelope ` | ` string ` | - Envelope rule text. |
2236
+
2237
+ Returns: ` Promise<UnpackedEnvelope> `.
2238
+
2239
+ ### userSignaturePayload
2240
+
2241
+ The canonical payload the node verifies for a user-gated sign:
2242
+ domain || u64_LE(len slot) || slot || u64_LE(32) || SHA256(message) ||
2243
+ u64_LE(len requestId) || requestId.
2244
+
2245
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/frost.ts#L136)
2246
+
2247
+ Import: `import {userSignaturePayload} from '@t3foundry/tasra-sdk'`
2248
+
2249
+ ```ts
2250
+ declare function userSignaturePayload(slotId: string, message: Uint8Array, requestId: string): Uint8Array;
2251
+ ```
2252
+
2253
+ | Parameter | Type | Description |
2254
+ |---|---|---|
2255
+ | ` slotId ` | ` string ` | - 32-byte slot identifier as hexadecimal text. |
2256
+ | ` message ` | ` Uint8Array ` | - Raw message bytes to authorize. |
2257
+ | ` requestId ` | ` string ` | - Request identifier to bind into the owner approval. |
2258
+
2259
+ Returns: ` Uint8Array `.
2260
+
2261
+ ### validateDcql
2262
+
2263
+ Parse and validate the supported DCQL rule grammar. Reject unknown fields, unsupported constraints and rules that exceed the byte limit.
2264
+
2265
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L389)
2266
+
2267
+ Import: `import {validateDcql} from '@t3foundry/tasra-sdk'`
2268
+
2269
+ ```ts
2270
+ declare function validateDcql(rule: string, opts?: ValidateOptions): Query;
2271
+ ```
2272
+
2273
+ | Parameter | Type | Description |
2274
+ |---|---|---|
2275
+ | ` rule ` | ` string ` | - DCQL policy encoded as JSON text. |
2276
+ | ` opts? ` | ` ValidateOptions ` | - Whether each credential query must explicitly constrain its issuer. |
2277
+
2278
+ Returns: ` Query `.
2279
+
2280
+ ### validateRecipientRule
2281
+
2282
+ Explicitly validate a slot's rule client-side: returns normally if well-formed,
2283
+ throws [DcqlMalformedError](#dcqlmalformederror) otherwise.
2284
+
2285
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/recipient/store.ts#L124)
2286
+
2287
+ Import: `import {validateRecipientRule} from '@t3foundry/tasra-sdk'`
2288
+
2289
+ ```ts
2290
+ declare function validateRecipientRule(rule: string): void;
2291
+ ```
2292
+
2293
+ | Parameter | Type | Description |
2294
+ |---|---|---|
2295
+ | ` rule ` | ` string ` | - DCQL policy encoded as JSON text. |
2296
+
2297
+ Returns: ` void `.
2298
+
2299
+ ### verifyDecryptShare
2300
+
2301
+ Check a partial decryption against its supplied verifying share using a pairing. Return false for missing or malformed material.
2302
+
2303
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L260)
2304
+
2305
+ Import: `import {verifyDecryptShare} from '@t3foundry/tasra-sdk'`
2306
+
2307
+ ```ts
2308
+ declare function verifyDecryptShare(share: DecryptShare, u: Uint8Array): boolean;
2309
+ ```
2310
+
2311
+ | Parameter | Type | Description |
2312
+ |---|---|---|
2313
+ | ` share ` | ` DecryptShare ` | - Partial decryption and its public verifying share. |
2314
+ | ` u ` | ` Uint8Array ` | - 96-byte compressed ephemeral G2 key from the ciphertext. |
2315
+
2316
+ Returns: ` boolean `.
2317
+
2318
+ ### verifyFrostSignature
2319
+
2320
+ Verify the FROST-Ed25519 group signature using the challenge SHA-512 over
2321
+ the concatenated commitment, group public key and message, reduced modulo
2322
+ the scalar order. Return false if point decoding or signature verification fails.
2323
+
2324
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/frost.ts#L199)
2325
+
2326
+ Import: `import {verifyFrostSignature} from '@t3foundry/tasra-sdk'`
2327
+
2328
+ ```ts
2329
+ declare function verifyFrostSignature(groupPublicKey: Uint8Array, message: Uint8Array, sig: FrostSignature): boolean;
2330
+ ```
2331
+
2332
+ | Parameter | Type | Description |
2333
+ |---|---|---|
2334
+ | ` groupPublicKey ` | ` Uint8Array ` | - 32-byte FROST group public key. |
2335
+ | ` message ` | ` Uint8Array ` | - Original signed message bytes. |
2336
+ | ` sig ` | ` FrostSignature ` | - Aggregated FROST signature to verify. |
2337
+
2338
+ Returns: ` boolean `.
2339
+
2340
+ ### verifyPresentation
2341
+
2342
+ Present credentials directly for a JWT. The `body` shape is defined by the
2343
+ verifier (a DCQL rule + a presentation/credentials); we pass it through
2344
+ untouched so this stays agnostic to the credential format.
2345
+ POST {verifier}/v1/verify
2346
+
2347
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L206)
2348
+
2349
+ Import: `import {verifyPresentation} from '@t3foundry/tasra-sdk'`
2350
+
2351
+ ```ts
2352
+ declare function verifyPresentation(verifierUrl: string, body: {
2353
+ dcql_rule: string;
2354
+ presentation: unknown;
2355
+ credentials?: unknown;
2356
+ }): Promise<IssuedToken>;
2357
+ ```
2358
+
2359
+ | Parameter | Type | Description |
2360
+ |---|---|---|
2361
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
2362
+ | ` body ` | ` { dcql_rule: string; presentation: unknown; credentials?: unknown; } ` | - Policy and credential presentation for verifier evaluation. |
2363
+
2364
+ Returns: ` Promise<IssuedToken> `.
2365
+
2366
+ ### verifyVpJwt
2367
+
2368
+ The PRODUCTION credential path: present signed JWT-VCs + holder proof for a
2369
+ DCQL-gated JWT. The verifier checks each credential's signature against its
2370
+ configured trust anchor (by `iss`), that each `sub` equals `holder`, that
2371
+ `holder_proof` proves live control of the holder DID authentication key, then
2372
+ evaluates the rule. `credentials` are compact JWS strings (e.g. from
2373
+ `tasra-cli vc issue`).
2374
+ POST {verifier}/v1/verify-vp-jwt
2375
+
2376
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L230)
2377
+
2378
+ Import: `import {verifyVpJwt} from '@t3foundry/tasra-sdk'`
2379
+
2380
+ ```ts
2381
+ declare function verifyVpJwt(verifierUrl: string, body: {
2382
+ dcql_rule: string;
2383
+ holder: string;
2384
+ credentials: string[];
2385
+ holder_proof: string;
2386
+ }): Promise<IssuedToken>;
2387
+ ```
2388
+
2389
+ | Parameter | Type | Description |
2390
+ |---|---|---|
2391
+ | ` verifierUrl ` | ` string ` | - Verifier HTTP base URL. |
2392
+ | ` body ` | ` { dcql_rule: string; holder: string; credentials: string[]; holder_proof: string; } ` | - Policy, holder DID, signed credentials and proof of holder-key possession. |
2393
+
2394
+ Returns: ` Promise<IssuedToken> `.
2395
+
2396
+ ### waitForSession
2397
+
2398
+ Poll until the session reaches a terminal state (done or failed) - bounded by
2399
+ `timeoutMs`, with a growing jittered interval so many clients never poll in lock-step.
2400
+ A transient `unavailable` answer (a 503, a dropped connection) is retried within the
2401
+ deadline; a `protocol` answer stops at once; the deadline is a `timeout` error; the
2402
+ caller's `signal` is a `cancelled` error. A terminal `failed` is RETURNED (the caller
2403
+ decides how to explain it) - see `awaitVerifierAgentResult` for the version that throws `refused`.
2404
+
2405
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L521)
2406
+
2407
+ Import: `import {waitForSession} from '@t3foundry/tasra-sdk'`
2408
+
2409
+ ```ts
2410
+ declare function waitForSession(verifierAgentUrl: string, sessionId: string, pollSecret: string, intervalMs?: number, timeoutMs?: number, opts?: WaitOpts): Promise<SessionStatusResult>;
2411
+ ```
2412
+
2413
+ | Parameter | Type | Description |
2414
+ |---|---|---|
2415
+ | ` verifierAgentUrl ` | ` string ` | - Verifier-agent HTTP base URL. |
2416
+ | ` sessionId ` | ` string ` | - Opened session identifier. |
2417
+ | ` pollSecret ` | ` string ` | - bearer token returned by `createOid4vpSession` |
2418
+ | ` intervalMs? ` | ` number ` | - initial polling interval in milliseconds (default 2000) |
2419
+ | ` timeoutMs? ` | ` number ` | - total deadline in milliseconds (default 300000 = 5 min) |
2420
+ | ` opts? ` | ` WaitOpts ` | - Cancellation, phase callback and polling backoff controls. |
2421
+
2422
+ Returns: ` Promise<SessionStatusResult> `.
2423
+
2424
+ ## Types
2425
+
2426
+ Options, data structures and return types.
2427
+
2428
+ <details>
2429
+ <summary>Browse 68 types</summary>
2430
+
2431
+ - [BlsPeer](#blspeer)
2432
+ - [BuildHolderProofOpts](#buildholderproofopts)
2433
+ - [Ciphertext](#ciphertext)
2434
+ - [ClaimResult](#claimresult)
2435
+ - [CreateOauthSessionResult](#createoauthsessionresult)
2436
+ - [CreateSessionParams](#createsessionparams)
2437
+ - [CreateSessionResult](#createsessionresult)
2438
+ - [CredentialView](#credentialview)
2439
+ - [DcqlClaimQuery](#dcqlclaimquery)
2440
+ - [DcqlCredentialQuery](#dcqlcredentialquery)
2441
+ - [DcqlCredentialSetQuery](#dcqlcredentialsetquery)
2442
+ - [DcqlMeta](#dcqlmeta)
2443
+ - [DcqlQuery](#dcqlquery)
2444
+ - [DcqlSelection](#dcqlselection)
2445
+ - [DecryptCustodyOpts](#decryptcustodyopts)
2446
+ - [DecryptShare](#decryptshare)
2447
+ - [DpopKey](#dpopkey)
2448
+ - [DpopSigner](#dpopsigner)
2449
+ - [EnvelopeGateReport](#envelopegatereport)
2450
+ - [EnvelopeLint](#envelopelint)
2451
+ - [EnvelopeVerdict](#envelopeverdict)
2452
+ - [EoaSignature](#eoasignature)
2453
+ - [EoaSignOpts](#eoasignopts)
2454
+ - [Faucet](#faucet)
2455
+ - [FaucetGrant](#faucetgrant)
2456
+ - [FrostCommitment](#frostcommitment)
2457
+ - [FrostShare](#frostshare)
2458
+ - [FrostSignature](#frostsignature)
2459
+ - [FrostSignResult](#frostsignresult)
2460
+ - [GroupEnvelope](#groupenvelope)
2461
+ - [HeldCredential](#heldcredential)
2462
+ - [HolderNonce](#holdernonce)
2463
+ - [HolderProofAuth](#holderproofauth)
2464
+ - [HolderSigner](#holdersigner)
2465
+ - [IbeBlobHeader](#ibeblobheader)
2466
+ - [IbeCiphertext](#ibeciphertext)
2467
+ - [IbeDecryptionShare](#ibedecryptionshare)
2468
+ - [IbeExtractionPartial](#ibeextractionpartial)
2469
+ - [IbeExtractOpts](#ibeextractopts)
2470
+ - [IbeExtractRequestOpts](#ibeextractrequestopts)
2471
+ - [IbeVerifyingShares](#ibeverifyingshares)
2472
+ - [IssuedToken](#issuedtoken)
2473
+ - [JwtClaims](#jwtclaims)
2474
+ - [LoadRegoOptions](#loadregooptions)
2475
+ - [OauthPolicyInput](#oauthpolicyinput)
2476
+ - [OauthPresentation](#oauthpresentation)
2477
+ - [OauthTokens](#oauthtokens)
2478
+ - [OauthTokenSpec](#oauthtokenspec)
2479
+ - [OpenSessionOpts](#opensessionopts)
2480
+ - [PresentationDelegation](#presentationdelegation)
2481
+ - [PresentationOperation](#presentationoperation)
2482
+ - [RedemptionGrant](#redemptiongrant)
2483
+ - [RegoEngine](#regoengine)
2484
+ - [RenewalGrant](#renewalgrant)
2485
+ - [ScopeNamespace](#scopenamespace)
2486
+ - [SealedBlob](#sealedblob)
2487
+ - [Session](#session)
2488
+ - [SessionAuth](#sessionauth)
2489
+ - [SessionStatusResult](#sessionstatusresult)
2490
+ - [ShardDecryptOpts](#sharddecryptopts)
2491
+ - [ShardSignOpts](#shardsignopts)
2492
+ - [SignCustodyOpts](#signcustodyopts)
2493
+ - [SignOpts](#signopts)
2494
+ - [TasraClient](#tasraclient)
2495
+ - [TasraClientConfig](#tasraclientconfig)
2496
+ - [UnpackedEnvelope](#unpackedenvelope)
2497
+ - [VerifierAgentSessionErrorKind](#verifieragentsessionerrorkind)
2498
+ - [VpJwtAuth](#vpjwtauth)
2499
+
2500
+ </details>
2501
+
2502
+ ### BlsPeer
2503
+
2504
+ A node's BLS identifier + its libp2p PeerId, for the custody decrypting set.
2505
+
2506
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L42)
2507
+
2508
+ ```ts
2509
+ export interface BlsPeer {
2510
+ id: number;
2511
+ peerId: string;
2512
+ }
2513
+ ```
2514
+
2515
+ Fields:
2516
+
2517
+ - **` id `**: BLS threshold participant identifier.
2518
+ - **` peerId `**: Network peer identifier for that participant.
2519
+
2520
+ ### BuildHolderProofOpts
2521
+
2522
+ Holder signing key, verifier challenge and credentials to bind into a proof.
2523
+
2524
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L111)
2525
+
2526
+ ```ts
2527
+ export interface BuildHolderProofOpts {
2528
+ signer: HolderSigner;
2529
+ audience: string;
2530
+ nonce: string;
2531
+ credentials: string[];
2532
+ slotId?: string;
2533
+ action?: string;
2534
+ ttlSecs?: number;
2535
+ nowSecs?: number;
2536
+ }
2537
+ ```
2538
+
2539
+ Fields:
2540
+
2541
+ - **` signer `**: Holder DID authentication key or signing callback.
2542
+ - **` audience `**: The verifier's expected audience (its token `iss`).
2543
+ - **` nonce `**: The challenge from [fetchHolderNonce](#fetchholdernonce).
2544
+ - **` credentials `**: The exact compact-JWS credentials being presented, in order.
2545
+ - **` slotId `**: Echo the nonce's slot binding (when the nonce was slot-bound).
2546
+ - **` action `**: Echo the nonce's action binding.
2547
+ - **` ttlSecs `**: Proof lifetime, seconds (default 300).
2548
+ - **` nowSecs `**: Override `iat` (Unix seconds) - for tests.
2549
+
2550
+ ### Ciphertext
2551
+
2552
+ BLS group encryption ciphertext containing an ephemeral key, nonce and authenticated payload.
2553
+
2554
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L128)
2555
+
2556
+ ```ts
2557
+ export interface Ciphertext {
2558
+ u: Uint8Array;
2559
+ nonce: Uint8Array;
2560
+ aeadCt: Uint8Array;
2561
+ }
2562
+ ```
2563
+
2564
+ Fields:
2565
+
2566
+ - **` u `**: 96-byte compressed G2 ephemeral public key U = r*G2.
2567
+ - **` nonce `**: 12-byte ChaCha20-Poly1305 nonce, derived from U.
2568
+ - **` aeadCt `**: AEAD ciphertext: plaintext.len + 16 (Poly1305 tag).
2569
+
2570
+ ### ClaimResult
2571
+
2572
+ Claim lookup result that distinguishes an absent claim from a present value, including JSON null.
2573
+
2574
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L145)
2575
+
2576
+ ```ts
2577
+ export type ClaimResult = {
2578
+ found: true;
2579
+ value: unknown;
2580
+ } | {
2581
+ found: false;
2582
+ };
2583
+ ```
2584
+
2585
+ Fields:
2586
+
2587
+ - **` found `**: Whether the claim path resolves; a present JSON null value counts as found.
2588
+
2589
+ ### CreateOauthSessionResult
2590
+
2591
+ an `oauth` session - the client brings a DPoP-bound access token.
2592
+
2593
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L80)
2594
+
2595
+ ```ts
2596
+ export interface CreateOauthSessionResult {
2597
+ sessionId: string;
2598
+ pollSecret: string;
2599
+ nonce: string;
2600
+ dpopHtu: string;
2601
+ platformAudience: string;
2602
+ }
2603
+ ```
2604
+
2605
+ Fields:
2606
+
2607
+ - **` sessionId `**: Opened authorization session identifier.
2608
+ - **` pollSecret `**: Session secret used for polling and OAuth submission. Never expose it in logs.
2609
+ - **` nonce `**: Initial DPoP challenge nonce for this session.
2610
+ - **` dpopHtu `**: Canonical OAuth response URI to bind into the DPoP proof.
2611
+ - **` platformAudience `**: Audience the identity provider must include in the access token for this platform.
2612
+
2613
+ ### CreateSessionParams
2614
+
2615
+ Signed operation, optional delegation and payload submitted to the verifier agent.
2616
+
2617
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L56)
2618
+
2619
+ ```ts
2620
+ export interface CreateSessionParams {
2621
+ operation: PresentationOperation;
2622
+ operationSig: string;
2623
+ delegation?: PresentationDelegation;
2624
+ messageHex: string;
2625
+ }
2626
+ ```
2627
+
2628
+ Fields:
2629
+
2630
+ - **` operation `**: Signed operation details presented for authorization.
2631
+ - **` operationSig `**: 0x-hex 65-byte EIP-712 signature over the operation
2632
+ - **` delegation `**: Optional EIP-712 delegation from the slot creator
2633
+ - **` messageHex `**: The raw payload as 0x-hex
2634
+
2635
+ ### CreateSessionResult
2636
+
2637
+ Wallet presentation link and polling credentials for an opened authorization session.
2638
+
2639
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L68)
2640
+
2641
+ ```ts
2642
+ export interface CreateSessionResult {
2643
+ sessionId: string;
2644
+ pollSecret: string;
2645
+ qrPayload: string;
2646
+ requestUri: string;
2647
+ }
2648
+ ```
2649
+
2650
+ Fields:
2651
+
2652
+ - **` sessionId `**: Opened authorization session identifier.
2653
+ - **` pollSecret `**: Bearer token for polling - treat as a secret
2654
+ - **` qrPayload `**: OpenID4VP deep link for a wallet or QR code.
2655
+ - **` requestUri `**: URL from which the wallet retrieves the signed request.
2656
+
2657
+ ### CredentialView
2658
+
2659
+ Credential format, types and claim accessor used by the DCQL evaluator. Authenticate the credential before using an evaluation to authorize access.
2660
+
2661
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L160)
2662
+
2663
+ ```ts
2664
+ export interface CredentialView {
2665
+ readonly format: string;
2666
+ readonly types: readonly string[];
2667
+ claim(path: readonly ClaimPathSegment[]): ClaimResult;
2668
+ }
2669
+ ```
2670
+
2671
+ Fields:
2672
+
2673
+ - **` format `**: The credential's format identifier, e.g. `"jwt_vc_json"`.
2674
+ - **` types `**: The credential's type list (for `jwt_vc_json`, its `type` array).
2675
+ - **` claim `**: The claim at `path`, or absent when the path does not resolve. A `null` segment selects every element of an array, so the answer may be an array the credential does not literally hold.
2676
+
2677
+ ### DcqlClaimQuery
2678
+
2679
+ A claim path with optional allowed values; omitting values requires the claim to exist.
2680
+
2681
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L92)
2682
+
2683
+ ```ts
2684
+ export interface ClaimQuery {
2685
+ path: ClaimPathSegment[];
2686
+ values?: unknown[];
2687
+ }
2688
+ ```
2689
+
2690
+ Fields:
2691
+
2692
+ - **` path `**: Path components into the credential: object keys, and `null` for every array element.
2693
+ - **` values `**: Allowed values. Absent means the claim need only be PRESENT.
2694
+
2695
+ ### DcqlCredentialQuery
2696
+
2697
+ A named credential requirement with format, claims and optional identity-scope constraints.
2698
+
2699
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L108)
2700
+
2701
+ ```ts
2702
+ export interface CredentialQuery {
2703
+ id: string;
2704
+ format: string;
2705
+ meta?: Meta;
2706
+ claims?: ClaimQuery[];
2707
+ kk_identity_scope_claim?: string[];
2708
+ kk_scope_namespace?: ScopeNamespace;
2709
+ }
2710
+ ```
2711
+
2712
+ Fields:
2713
+
2714
+ - **` id `**: Unique within the query; referenced by `credential_sets.options`.
2715
+ - **` format `**: Credential format identifier.
2716
+ - **` meta `**: Credential-format constraints.
2717
+ - **` claims `**: Required claim paths and optional allowed values.
2718
+ - **` kk_identity_scope_claim `**: Claim path containing a scope string or array of scope strings. It must also be requested in claims and accompanied by kk_scope_namespace.
2719
+ - **` kk_scope_namespace `**: whose grant power the scope claim carries. Required whenever `kk_identity_scope_claim` is present; refused without it.
2720
+
2721
+ ### DcqlCredentialSetQuery
2722
+
2723
+ Alternative groups of credential query identifiers, with optional display purpose.
2724
+
2725
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L125)
2726
+
2727
+ ```ts
2728
+ export interface CredentialSetQuery {
2729
+ options: string[][];
2730
+ required?: boolean;
2731
+ purpose?: unknown;
2732
+ }
2733
+ ```
2734
+
2735
+ Fields:
2736
+
2737
+ - **` options `**: Each option is a list of credential-query ids that must ALL match.
2738
+ - **` required `**: Default `true`.
2739
+ - **` purpose `**: Display-only wallet consent text. It does not affect credential matching, but remains part of the committed rule bytes.
2740
+
2741
+ ### DcqlMeta
2742
+
2743
+ Format-specific credential type filters and OAuth authentication freshness requirements.
2744
+
2745
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L79)
2746
+
2747
+ ```ts
2748
+ export interface Meta {
2749
+ type_values?: string[][];
2750
+ vct_values?: string[];
2751
+ max_age_secs?: number;
2752
+ }
2753
+ ```
2754
+
2755
+ Fields:
2756
+
2757
+ - **` type_values `**: `jwt_vc_json`: outer array = alternatives; inner array = types that must ALL be present.
2758
+ - **` vct_values `**: `dc+sd-jwt`: acceptable Verifiable Credential Type (`vct`) values - a flat list of alternatives.
2759
+ - **` max_age_secs `**: Maximum age of OAuth authentication in seconds. Required for OAuth formats and evaluated separately from token expiration.
2760
+
2761
+ ### DcqlQuery
2762
+
2763
+ A DCQL query. `credential_sets` absent means EVERY entry in `credentials` is required.
2764
+
2765
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L135)
2766
+
2767
+ ```ts
2768
+ export interface Query {
2769
+ credentials: CredentialQuery[];
2770
+ credential_sets?: CredentialSetQuery[];
2771
+ }
2772
+ ```
2773
+
2774
+ Fields:
2775
+
2776
+ - **` credentials `**: Named credential requirements.
2777
+ - **` credential_sets `**: Optional alternative groups of credential requirements.
2778
+
2779
+ ### DcqlSelection
2780
+
2781
+ The result of credential selection against a rule.
2782
+
2783
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L697)
2784
+
2785
+ ```ts
2786
+ export interface Selection {
2787
+ satisfied: boolean;
2788
+ credentials: CredentialView[];
2789
+ unsatisfied: string[];
2790
+ }
2791
+ ```
2792
+
2793
+ Fields:
2794
+
2795
+ - **` satisfied `**: Whether the rule can be satisfied by the given credentials.
2796
+ - **` credentials `**: The minimal set of credentials that satisfy the rule (empty when unsatisfied).
2797
+ - **` unsatisfied `**: Credential query ids that no presented credential satisfies.
2798
+
2799
+ ### DecryptCustodyOpts
2800
+
2801
+ JWT-authorized group decryption coordinated by one keeper, including participant selection.
2802
+
2803
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L50)
2804
+
2805
+ ```ts
2806
+ export interface DecryptCustodyOpts {
2807
+ nodeUrl: string;
2808
+ jwt: string;
2809
+ slotId: string;
2810
+ ciphertext: Ciphertext;
2811
+ identity: Uint8Array;
2812
+ decryptingSet: number[];
2813
+ blsPeers: BlsPeer[];
2814
+ userSignature?: Uint8Array;
2815
+ ciphertextEpoch?: number;
2816
+ targetKeykeeper?: string;
2817
+ requestId?: string;
2818
+ }
2819
+ ```
2820
+
2821
+ Fields:
2822
+
2823
+ - **` nodeUrl `**: Keeper HTTP base URL.
2824
+ - **` jwt `**: Compact bearer JWT authorizing the request.
2825
+ - **` slotId `**: 32-byte slot identifier.
2826
+ - **` ciphertext `**: Ciphertext to decrypt.
2827
+ - **` identity `**: AEAD additional-authenticated-data (the identity the envelope was bound to).
2828
+ - **` decryptingSet `**: BLS identifiers (k..n, distinct) to run the ceremony with.
2829
+ - **` blsPeers `**: The libp2p peers for those identifiers.
2830
+ - **` userSignature `**: 64-byte Ed25519 user signature, required iff the slot has an owner pubkey.
2831
+ - **` ciphertextEpoch `**: Pin the ciphertext epoch; a rotated slot returns 410.
2832
+ - **` targetKeykeeper `**: Optional 20-byte operator address to pin the intended keeper.
2833
+ - **` requestId `**: Request identifier used to correlate or resume the operation.
2834
+
2835
+ ### DecryptShare
2836
+
2837
+ One participant's partial BLS decryption and optional public verification material.
2838
+
2839
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/kem.ts#L241)
2840
+
2841
+ ```ts
2842
+ export interface DecryptShare {
2843
+ id: number;
2844
+ decryptionShare: Uint8Array;
2845
+ verifyingShare?: Uint8Array;
2846
+ }
2847
+ ```
2848
+
2849
+ Fields:
2850
+
2851
+ - **` id `**: 1-indexed BLS participant identifier (u16).
2852
+ - **` decryptionShare `**: 96-byte compressed G2 partial decryption D_i = sk_i*U.
2853
+ - **` verifyingShare `**: 144-byte verifying share: 96B compressed G2 (sk_i*g2) || 48B compressed G1 (sk_i*g1). Required only for verifyDecryptShare.
2854
+
2855
+ ### DpopKey
2856
+
2857
+ An ES256 key pair for DPoP, plus a [DpopSigner](#dpopsigner) over it.
2858
+
2859
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L70)
2860
+
2861
+ ```ts
2862
+ export interface DpopKey {
2863
+ publicJwk: JsonWebKey;
2864
+ thumbprint(): Promise<string>;
2865
+ tokenRequestProof(args: {
2866
+ htm: string;
2867
+ htu: string;
2868
+ nonce?: string;
2869
+ }): Promise<string>;
2870
+ signer: DpopSigner;
2871
+ }
2872
+ ```
2873
+
2874
+ Fields:
2875
+
2876
+ - **` publicJwk `**: The public half, as the JWK that rides in every proof header.
2877
+ - **` thumbprint `**: RFC 7638 thumbprint - the value the IdP puts in the token's `cnf.jkt`.
2878
+ - **` tokenRequestProof `**: The proof for a TOKEN REQUEST to the IdP (RFC 9449 §5): `htm`/`htu` of the token endpoint, the IdP's `DPoP-Nonce` only if it challenged for one, and never `ath`. The IdP binds the token it issues to this key (`cnf.jkt`).
2879
+ - **` signer `**: The proof for PRESENTING the token — pass it to `submitOauthResponse`.
2880
+
2881
+ ### DpopSigner
2882
+
2883
+ Anything that can produce a DPoP proof for a given request.
2884
+
2885
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/dpop.ts#L30)
2886
+
2887
+ ```ts
2888
+ export interface DpopSigner {
2889
+ proof(args: {
2890
+ htm: string;
2891
+ htu: string;
2892
+ nonce?: string;
2893
+ accessToken?: string;
2894
+ }): Promise<string>;
2895
+ }
2896
+ ```
2897
+
2898
+ Fields:
2899
+
2900
+ - **` proof `**: Mint a proof over `(htm, htu)`, with `nonce` and `ath` (from `accessToken`) when given. RFC 9449 decides which claims a proof carries, and the two requests differ: a proof PRESENTING a token carries `ath` (and our agent always demands a `nonce`); a proof REQUESTING a token cannot carry `ath` — there is no token yet — and carries `nonce` only when the authorization server has challenged for one. An implementation omits each claim whose argument is absent, never sends it empty. An implementation MUST sign with the key the access token is bound to; a proof under any other key is refused by every drawn verifier with `DPoP proof jwk is not the key the access token is bound to`.
2901
+
2902
+ ### EnvelopeGateReport
2903
+
2904
+ What the static gate found in a policy.
2905
+
2906
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L336)
2907
+
2908
+ ```ts
2909
+ export interface EnvelopeGateReport {
2910
+ package: string;
2911
+ rules: number;
2912
+ functions: string[];
2913
+ builtins: string[];
2914
+ tokensRead: string[];
2915
+ maxIterDepth: number;
2916
+ }
2917
+ ```
2918
+
2919
+ Fields:
2920
+
2921
+ - **` package `**: The module's package.
2922
+ - **` rules `**: Number of rules defined.
2923
+ - **` functions `**: User-defined function names.
2924
+ - **` builtins `**: Builtins the policy calls (all from the allow-list).
2925
+ - **` tokensRead `**: Token ids the policy reads.
2926
+ - **` maxIterDepth `**: Deepest iteration nesting.
2927
+
2928
+ ### EnvelopeLint
2929
+
2930
+ Result of [lintEnvelope](#lintenvelope).
2931
+
2932
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L352)
2933
+
2934
+ ```ts
2935
+ export interface EnvelopeLint {
2936
+ report: EnvelopeGateReport;
2937
+ admissible: boolean;
2938
+ admissionError?: string;
2939
+ }
2940
+ ```
2941
+
2942
+ Fields:
2943
+
2944
+ - **` report `**: The gate's report.
2945
+ - **` admissible `**: Whether a keeper would store this envelope today (current phase limits included).
2946
+ - **` admissionError `**: Why it is not admissible, when it is not.
2947
+
2948
+ ### EnvelopeVerdict
2949
+
2950
+ A local evaluation verdict. `reject`: the policy (or a platform pin such as issuer or
2951
+ audience) refused this presentation. `malformed`: the rule itself is unusable.
2952
+
2953
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L380)
2954
+
2955
+ ```ts
2956
+ export type EnvelopeVerdict = {
2957
+ allow: true;
2958
+ } | {
2959
+ allow: false;
2960
+ kind: 'reject' | 'malformed';
2961
+ message: string;
2962
+ };
2963
+ ```
2964
+
2965
+ Fields:
2966
+
2967
+ - **` allow `**: The policy allows this presentation. The policy does not allow this presentation.
2968
+
2969
+ ### EoaSignature
2970
+
2971
+ Threshold ECDSA signature components, recovery identifier and signing public key.
2972
+
2973
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/ecdsa.ts#L33)
2974
+
2975
+ ```ts
2976
+ export interface EoaSignature {
2977
+ groupPublicKey: Uint8Array;
2978
+ r: Uint8Array;
2979
+ s: Uint8Array;
2980
+ yParity: 0 | 1;
2981
+ }
2982
+ ```
2983
+
2984
+ Fields:
2985
+
2986
+ - **` groupPublicKey `**: 33-byte compressed secp256k1 group public key (the EOA's pubkey).
2987
+ - **` r `**: 32-byte big-endian r.
2988
+ - **` s `**: 32-byte big-endian s (low-s normalized per EIP-2).
2989
+ - **` yParity `**: Raw recovery id, 0 or 1. Use ethSignatureV() to get the EVM `v`.
2990
+
2991
+ ### EoaSignOpts
2992
+
2993
+ Keeper endpoint, JWT, slot and 32-byte digest for threshold ECDSA signing.
2994
+
2995
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/ecdsa.ts#L19)
2996
+
2997
+ ```ts
2998
+ export interface EoaSignOpts {
2999
+ nodeUrl: string;
3000
+ jwt: string;
3001
+ slotId: string;
3002
+ digest: Uint8Array;
3003
+ targetKeykeeper?: string;
3004
+ }
3005
+ ```
3006
+
3007
+ Fields:
3008
+
3009
+ - **` nodeUrl `**: Keeper HTTP base URL.
3010
+ - **` jwt `**: Compact bearer JWT authorizing the request.
3011
+ - **` slotId `**: 0x-prefixed (or bare) bytes32 slot id (must be a tecdsa-mode slot).
3012
+ - **` digest `**: The 32-byte prehash to sign (e.g. the EIP-1559 signing hash).
3013
+ - **` targetKeykeeper `**: 20-byte operator address to pin (anti-Sybil).
3014
+
3015
+ ### Faucet
3016
+
3017
+ Funding adapter that requests native gas and TSRA for an account.
3018
+
3019
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/slots/faucet.ts#L21)
3020
+
3021
+ ```ts
3022
+ export interface Faucet {
3023
+ fund(address: string): Promise<FaucetGrant>;
3024
+ }
3025
+ ```
3026
+
3027
+ Fields:
3028
+
3029
+ - **` fund `**: Top up `address` with gas + TSRA.
3030
+
3031
+ ### FaucetGrant
3032
+
3033
+ Account funding result with optional amounts and transaction hashes reported by the faucet.
3034
+
3035
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/slots/faucet.ts#L9)
3036
+
3037
+ ```ts
3038
+ export interface FaucetGrant {
3039
+ address: string;
3040
+ ethWei?: string;
3041
+ tsra?: string;
3042
+ txHashes?: string[];
3043
+ }
3044
+ ```
3045
+
3046
+ Fields:
3047
+
3048
+ - **` address `**: Account that received or was requested to receive funding.
3049
+ - **` ethWei `**: Native gas funded, wei (decimal string).
3050
+ - **` tsra `**: TSRA funded, base units (decimal string).
3051
+ - **` txHashes `**: Funding tx hashes, if the faucet reports them.
3052
+
3053
+ ### FrostCommitment
3054
+
3055
+ One node's Round-1 commitment (from POST /v1/shards/sign/commit).
3056
+
3057
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/frost.ts#L95)
3058
+
3059
+ ```ts
3060
+ export interface FrostCommitment {
3061
+ identifier: number;
3062
+ hiding: Uint8Array;
3063
+ binding: Uint8Array;
3064
+ }
3065
+ ```
3066
+
3067
+ Fields:
3068
+
3069
+ - **` identifier `**: 1-indexed FROST participant id (u16).
3070
+ - **` hiding `**: 32-byte compressed Edwards hiding nonce commitment D_i.
3071
+ - **` binding `**: 32-byte compressed Edwards binding nonce commitment E_i.
3072
+
3073
+ ### FrostShare
3074
+
3075
+ One node's Round-2 signature share (from POST /v1/shards/sign/partial).
3076
+
3077
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/frost.ts#L105)
3078
+
3079
+ ```ts
3080
+ export interface FrostShare {
3081
+ identifier: number;
3082
+ z: Uint8Array;
3083
+ verifyingShare: Uint8Array;
3084
+ }
3085
+ ```
3086
+
3087
+ Fields:
3088
+
3089
+ - **` identifier `**: Nonzero threshold participant identifier.
3090
+ - **` z `**: 32-byte little-endian scalar z_i.
3091
+ - **` verifyingShare `**: 32-byte compressed Edwards verifying share Y_i = g^{s_i}.
3092
+
3093
+ ### FrostSignature
3094
+
3095
+ A FROST-Ed25519 group signature: R (32B compressed) + z (32B LE scalar).
3096
+
3097
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/frost.ts#L115)
3098
+
3099
+ ```ts
3100
+ export interface FrostSignature {
3101
+ r: Uint8Array;
3102
+ z: Uint8Array;
3103
+ }
3104
+ ```
3105
+
3106
+ Fields:
3107
+
3108
+ - **` r `**: 32-byte compressed Edwards group commitment.
3109
+ - **` z `**: 32-byte little-endian aggregate signature scalar.
3110
+
3111
+ ### FrostSignResult
3112
+
3113
+ FROST group signature with slot, key epoch, message digest and optional keeper receipt.
3114
+
3115
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/frost.ts#L76)
3116
+
3117
+ ```ts
3118
+ export interface FrostSignResult {
3119
+ receipt?: OperationReceipt;
3120
+ keySlotId: string;
3121
+ groupPublicKey: Uint8Array;
3122
+ signature: FrostSignature;
3123
+ messageSha256: Uint8Array;
3124
+ epoch: number;
3125
+ }
3126
+ ```
3127
+
3128
+ Fields:
3129
+
3130
+ - **` receipt `**: Optional keeper evidence; verify separately with verifyOperationReceipt.
3131
+ - **` keySlotId `**: Identifier of the slot that produced the result.
3132
+ - **` groupPublicKey `**: 32-byte compressed Edwards group public key.
3133
+ - **` signature `**: The group signature (R, z). Verify with verifyFrostSignature().
3134
+ - **` messageSha256 `**: SHA-256 of the signed message, as returned by the node.
3135
+ - **` epoch `**: Slot key epoch reported with the signature.
3136
+
3137
+ ### GroupEnvelope
3138
+
3139
+ Serialized group ciphertext context: slot, associated data and optional key epoch.
3140
+
3141
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/envelope.ts#L36)
3142
+
3143
+ ```ts
3144
+ export interface GroupEnvelope {
3145
+ slotId: Uint8Array;
3146
+ identity: Uint8Array;
3147
+ ciphertext: Ciphertext;
3148
+ epoch: bigint | null;
3149
+ }
3150
+ ```
3151
+
3152
+ Fields:
3153
+
3154
+ - **` slotId `**: On-chain key-slot identifier (bytes32).
3155
+ - **` identity `**: AEAD additional authenticated data - must match at decrypt time.
3156
+ - **` ciphertext `**: KEM ciphertext (U, nonce, AEAD output).
3157
+ - **` epoch `**: Slot epoch this envelope was produced under. Present in v0x02 only.
3158
+
3159
+ ### HeldCredential
3160
+
3161
+ One credential the recipient holds, described as a structured credential view.
3162
+ Build these from your own store of verifiable credentials / verifier JWTs.
3163
+
3164
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/recipient/store.ts#L24)
3165
+
3166
+ ```ts
3167
+ export interface HeldCredential {
3168
+ format: string;
3169
+ types: readonly string[];
3170
+ body: unknown;
3171
+ }
3172
+ ```
3173
+
3174
+ Fields:
3175
+
3176
+ - **` format `**: The credential's format identifier (e.g. `"jwt_vc_json"`).
3177
+ - **` types `**: The credential's type list (for `jwt_vc_json`, its `type` array).
3178
+ - **` body `**: The parsed credential body (JSON object with claims).
3179
+
3180
+ ### HolderNonce
3181
+
3182
+ Single-use verifier challenge, expiry and optional disclosed slot policy.
3183
+
3184
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L48)
3185
+
3186
+ ```ts
3187
+ export interface HolderNonce {
3188
+ nonce: string;
3189
+ expiresAt: number;
3190
+ dcqlRule?: string;
3191
+ dcqlSalt?: string;
3192
+ ruleVersion?: number;
3193
+ }
3194
+ ```
3195
+
3196
+ Fields:
3197
+
3198
+ - **` nonce `**: Single-use verifier challenge.
3199
+ - **` expiresAt `**: Expiry, Unix seconds.
3200
+ - **` dcqlRule `**: The slot's DCQL rule (present only for public-disclosure slots).
3201
+ - **` dcqlSalt `**: The salt used in the rule's on-chain commitment (present with dcqlRule).
3202
+ - **` ruleVersion `**: Rule version counter (present with dcqlRule).
3203
+
3204
+ ### HolderProofAuth
3205
+
3206
+ Holder proof-of-possession options (F1/F4). The SDK fetches a `/v1/nonce` and
3207
+ signs a holder proof with `signer` (the holder DID's authentication key), bound
3208
+ to `audience` (the verifier's token `iss`) and the presented credentials.
3209
+
3210
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/client.ts#L37)
3211
+
3212
+ ```ts
3213
+ export interface HolderProofAuth {
3214
+ signer: HolderSigner;
3215
+ audience: string;
3216
+ slotId?: string;
3217
+ action?: string;
3218
+ ttlSecs?: number;
3219
+ }
3220
+ ```
3221
+
3222
+ Fields:
3223
+
3224
+ - **` signer `**: Holder DID authentication key or signing callback.
3225
+ - **` audience `**: The verifier's expected audience (its token `iss`).
3226
+ - **` slotId `**: Optionally scope the proof to a slot / action (must match the slot being opened).
3227
+ - **` action `**: Optional action bound into the nonce and holder proof.
3228
+ - **` ttlSecs `**: Holder-proof lifetime in seconds.
3229
+
3230
+ ### HolderSigner
3231
+
3232
+ A signer for the holder DID's `authentication` key. Either the SDK holds the raw
3233
+ Ed25519 secret, or the caller supplies a `sign` callback (HSM / wallet / WebCrypto)
3234
+ that returns the raw JWS signature bytes for the given signing input.
3235
+
3236
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/holderProof.ts#L98)
3237
+
3238
+ ```ts
3239
+ export type HolderSigner = {
3240
+ alg: 'EdDSA';
3241
+ did: string;
3242
+ secretKey: Uint8Array;
3243
+ kid?: string;
3244
+ } | {
3245
+ alg: 'EdDSA' | 'ES256';
3246
+ did: string;
3247
+ sign: (signingInput: Uint8Array) => Uint8Array | Promise<Uint8Array>;
3248
+ kid?: string;
3249
+ };
3250
+ ```
3251
+
3252
+ Fields:
3253
+
3254
+ - **` alg `**: JWS algorithm used by the holder authentication key.
3255
+ - **` did `**: Holder DID identifying the authentication key.
3256
+ - **` kid `**: Optional JOSE key identifier included in the proof header.
3257
+
3258
+ ### IbeBlobHeader
3259
+
3260
+ The clear header stored beside the ciphertext body. Nothing in it is secret.
3261
+
3262
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L36)
3263
+
3264
+ ```ts
3265
+ export interface IbeBlobHeader {
3266
+ v: 1;
3267
+ blobId: string;
3268
+ identity: string;
3269
+ contentType: string;
3270
+ size: number;
3271
+ chunkSize: number;
3272
+ chunkCount: number;
3273
+ wrappedKey: {
3274
+ u: string;
3275
+ nonce: string;
3276
+ aead_ct: string;
3277
+ };
3278
+ }
3279
+ ```
3280
+
3281
+ Fields:
3282
+
3283
+ - **` v `**: Encrypted blob format version.
3284
+ - **` blobId `**: 16 random bytes, base64 - the object's identity for the chunk binding.
3285
+ - **` identity `**: The IBE identity the data key is wrapped to.
3286
+ - **` contentType `**: Media type of the original plaintext object.
3287
+ - **` size `**: Plaintext size in bytes.
3288
+ - **` chunkSize `**: Maximum plaintext bytes in each chunk.
3289
+ - **` chunkCount `**: Number of encrypted chunks in the body.
3290
+ - **` wrappedKey `**: `ibeEncrypt(mpk, identity, dek)` - the wire shape of `bls::ibe::Ciphertext`.
3291
+
3292
+ ### IbeCiphertext
3293
+
3294
+ Encrypted message - wire shape of `bls::ibe::Ciphertext`.
3295
+
3296
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L46)
3297
+
3298
+ ```ts
3299
+ export interface IbeCiphertext {
3300
+ u: Uint8Array;
3301
+ nonce: Uint8Array;
3302
+ aeadCt: Uint8Array;
3303
+ }
3304
+ ```
3305
+
3306
+ Fields:
3307
+
3308
+ - **` u `**: 96-byte compressed G2 ephemeral public key U = r*G2.
3309
+ - **` nonce `**: 12-byte ChaCha20-Poly1305 nonce, derived deterministically from U.
3310
+ - **` aeadCt `**: AEAD output (plaintext.len + 16-byte tag).
3311
+
3312
+ ### IbeDecryptionShare
3313
+
3314
+ One node's partial `D_i = sk_i * Q_ID` (48-byte compressed G1).
3315
+
3316
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L56)
3317
+
3318
+ ```ts
3319
+ export interface IbeDecryptionShare {
3320
+ identifier: number;
3321
+ value: Uint8Array;
3322
+ }
3323
+ ```
3324
+
3325
+ Fields:
3326
+
3327
+ - **` identifier `**: 1-indexed BLS group identifier (the extract reply's `identifier`).
3328
+ - **` value `**: 48-byte compressed G1.
3329
+
3330
+ ### IbeExtractionPartial
3331
+
3332
+ One node's extraction partial, decoded from the wire.
3333
+
3334
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#L529)
3335
+
3336
+ ```ts
3337
+ export interface IbeExtractionPartial {
3338
+ keySlotId?: string;
3339
+ receipt?: OperationReceipt;
3340
+ identifier: number;
3341
+ value: Uint8Array;
3342
+ verifyingShareG2: Uint8Array;
3343
+ epoch: number;
3344
+ nodeUrl: string;
3345
+ }
3346
+ ```
3347
+
3348
+ Fields:
3349
+
3350
+ - **` keySlotId `**: Echoed slot, when supplied by the server. Required by the strict helper.
3351
+ - **` receipt `**: Optional keeper attestation; presence alone does not establish validity.
3352
+ - **` identifier `**: The node's BLS group identifier (1..n).
3353
+ - **` value `**: 48-byte compressed G1 partial `D_i = sk_i * Q_ID`.
3354
+ - **` verifyingShareG2 `**: The node's 96-byte G2 verifying share (the dual-group reply's first half).
3355
+ - **` epoch `**: Slot epoch when served.
3356
+ - **` nodeUrl `**: The node that served it (for identifiable-abort reporting).
3357
+
3358
+ ### IbeExtractOpts
3359
+
3360
+ Committee authorization and keeper endpoints for extracting shares of one IBE identity key.
3361
+
3362
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/client.ts#L547)
3363
+
3364
+ ```ts
3365
+ export interface IbeExtractOpts {
3366
+ signal?: AbortSignal;
3367
+ fetchImpl?: typeof fetch;
3368
+ nodeUrls: string[];
3369
+ committeeToken: CompoundTokenWire;
3370
+ identity: string;
3371
+ userSignature?: Uint8Array;
3372
+ ciphertextEpoch?: number;
3373
+ verifierProofs?: VerifierProof[];
3374
+ clientPubkey?: Uint8Array;
3375
+ clientSignature?: Uint8Array;
3376
+ evidenceCt?: string;
3377
+ }
3378
+ ```
3379
+
3380
+ Fields:
3381
+
3382
+ - **` signal `**: Optional signal that cancels the request.
3383
+ - **` fetchImpl `**: HTTP transport override; defaults to the global fetch implementation.
3384
+ - **` nodeUrls `**: Base URLs of at least k keeper nodes holding the slot's BLS shards.
3385
+ - **` committeeToken `**: MUST be identity-scoped: the keeper enforces `identity_hash == keccak256(identity)`.
3386
+ - **` identity `**: The requested IBE identity, in the clear (the node computes Q_ID from it).
3387
+ - **` userSignature `**: Owner signature over `keccak256("keykeeper:ibe-extract:v1" || identity)` when the slot has a registered `user_pubkey`.
3388
+ - **` ciphertextEpoch `**: Expected key epoch of the ciphertext; used to detect rotation.
3389
+ - **` verifierProofs `**: Verifier membership proofs for the selected snapshot.
3390
+ - **` clientPubkey `**: 32-byte Ed25519 client public key used to verify clientSignature; supply both fields together.
3391
+ - **` clientSignature `**: Client signature over the slot and compound token binding.
3392
+ - **` evidenceCt `**: the sealed presentation beside the token (`VerifierAgentResult.evidenceCt`), posted as `evidence_ct`. Required by a keeper with `require_committee_evidence`.
3393
+
3394
+ ### IbeExtractRequestOpts
3395
+
3396
+ Operation-specific fields for [ibeDecryptRequest](#ibedecryptrequest) / [ibeExtractRequest](#ibeextractrequest).
3397
+
3398
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/committee/request.ts#L462)
3399
+
3400
+ ```ts
3401
+ export interface IbeExtractRequestOpts extends RequestCommitteeTokenOpts {
3402
+ nodeUrls: string[];
3403
+ identity: string;
3404
+ userSignature?: Uint8Array;
3405
+ ciphertextEpoch?: number;
3406
+ }
3407
+ ```
3408
+
3409
+ Fields:
3410
+
3411
+ - **` nodeUrls `**: Base URLs of at least k keeper nodes holding the slot's BLS shards.
3412
+ - **` identity `**: The IBE identity to extract for - becomes the token's `scopedIdentity`, so a quorum attests exactly this identity and the keepers enforce the hash binding.
3413
+ - **` userSignature `**: Owner signature over the identity-bound extract marker, when the slot has one.
3414
+ - **` ciphertextEpoch `**: Expected key epoch of the ciphertext; used to detect rotation.
3415
+ - **` chain `**: Reader methods for the beacon and slot verifier policy.
3416
+ - **` epochLag `**: Pin the draw to `latest - epochLag` (0 or 1). 1 = the previous epoch, always anchored: no wait for the accountants.
3417
+ - **` verifiers `**: The active verifier set (index to URL; add operator+pubkey to enable trustless proofs). Asking the whole set is fine - non-drawn verifiers reply 403 and are skipped.
3418
+ - **` slotId `**: 0x-prefixed 32-byte slot id.
3419
+ - **` holder `**: Holder DID (the credentials' subject).
3420
+ - **` credentials `**: Compact-JWS verifiable credentials.
3421
+ - **` holderProof `**: Proof of holder-key possession. Supply a per-verifier callback when each verifier has its own nonce store. Omitting it requires allowNoHolderProof and compatible verifier policy.
3422
+ - **` allowNoHolderProof `**: Send no holder proof. Only valid against `require_holder_binding = false`.
3423
+ - **` tokenType `**: Token type - default `'JWT'`.
3424
+ - **` ttlSecs `**: Token TTL in seconds - default 300.
3425
+ - **` nowSecs `**: Override "now" (unix seconds), mainly for tests.
3426
+ - **` clientSigner `**: sign the request bundle with the holder's key so the keeper + audit can verify the user authorized this operation. Omit to skip (keeper accepts unless it requires it).
3427
+ - **` scopedIdentity `**: Identity string for an IBE-scoped operation. Verifiers bind its hash into the token and evaluate the credential scope. Omit for group signing and group decryption; ciphertext associated data is a separate field.
3428
+
3429
+ ### IbeVerifyingShares
3430
+
3431
+ A node's dual-group verifying share - only the 96-byte G2 half is needed here.
3432
+
3433
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe.ts#L64)
3434
+
3435
+ ```ts
3436
+ export type IbeVerifyingShares = ReadonlyMap<number, Uint8Array>;
3437
+ ```
3438
+
3439
+ ### IssuedToken
3440
+
3441
+ Verifier-issued bearer JWT with its holder identifier and expiry in Unix seconds.
3442
+
3443
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L12)
3444
+
3445
+ ```ts
3446
+ export interface IssuedToken {
3447
+ token: string;
3448
+ exp: number;
3449
+ holder: string;
3450
+ }
3451
+ ```
3452
+
3453
+ Fields:
3454
+
3455
+ - **` token `**: The signed JWT (EdDSA) to present to keykeeper-nodes as a Bearer token.
3456
+ - **` exp `**: Expiry, Unix seconds.
3457
+ - **` holder `**: Subject / holder the token was minted for.
3458
+
3459
+ ### JwtClaims
3460
+
3461
+ Decoded JWT claims for local inspection. Their presence does not establish signature validity.
3462
+
3463
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L248)
3464
+
3465
+ ```ts
3466
+ export interface JwtClaims {
3467
+ sub?: string;
3468
+ iss?: string;
3469
+ aud?: string;
3470
+ exp?: number;
3471
+ iat?: number;
3472
+ scope?: string | string[];
3473
+ [k: string]: unknown;
3474
+ }
3475
+ ```
3476
+
3477
+ Fields:
3478
+
3479
+ - **` sub `**: Unverified subject claim.
3480
+ - **` iss `**: Unverified issuer claim.
3481
+ - **` aud `**: Unverified audience claim.
3482
+ - **` exp `**: Unverified expiration time in Unix seconds.
3483
+ - **` iat `**: Unverified issue time in Unix seconds.
3484
+ - **` scope `**: Unverified scope claim.
3485
+
3486
+ ### LoadRegoOptions
3487
+
3488
+ Where [loadRego](#loadrego) reads the module from.
3489
+
3490
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L422)
3491
+
3492
+ ```ts
3493
+ export interface LoadRegoOptions {
3494
+ wasm?: BufferSource | URL | string;
3495
+ fetchImpl?: typeof fetch;
3496
+ }
3497
+ ```
3498
+
3499
+ Fields:
3500
+
3501
+ - **` wasm `**: The .wasm bytes, or a URL to fetch them from. Defaults to the module shipped beside this file. Whatever the source, the bytes must hash to ` REGO_WASM_SHA256 `.
3502
+ - **` fetchImpl `**: HTTP implementation used for a non-`file:` URL.
3503
+
3504
+ ### OauthPolicyInput
3505
+
3506
+ The authored parts of an envelope.
3507
+
3508
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L316)
3509
+
3510
+ ```ts
3511
+ export interface OauthPolicyInput {
3512
+ policy: string;
3513
+ tokens: OauthTokens | string;
3514
+ entrypoint?: string;
3515
+ }
3516
+ ```
3517
+
3518
+ Fields:
3519
+
3520
+ - **` policy `**: Rego v1 module source, committed byte for byte.
3521
+ - **` tokens `**: Token specifications, as an object or as the JSON text of one.
3522
+ - **` entrypoint `**: Rule to evaluate; defaults to ` DEFAULT_REGO_ENTRYPOINT `.
3523
+
3524
+ ### OauthPresentation
3525
+
3526
+ The presentation an envelope is evaluated against: the verified claims of each token.
3527
+
3528
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L362)
3529
+
3530
+ ```ts
3531
+ export interface OauthPresentation {
3532
+ holder: string;
3533
+ credentials: {
3534
+ format: string;
3535
+ issuer: string;
3536
+ claims: Record<string, unknown>;
3537
+ }[];
3538
+ }
3539
+ ```
3540
+
3541
+ Fields:
3542
+
3543
+ - **` holder `**: Stable holder identity (`{iss}#{sub}` on the network).
3544
+ - **` credentials `**: One entry per presented token.
3545
+
3546
+ ### OauthTokens
3547
+
3548
+ The envelope's token map: token id (`^[a-z][a-z0-9_]{0,31}$`) to its specification.
3549
+
3550
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L313)
3551
+
3552
+ ```ts
3553
+ export type OauthTokens = Record<string, OauthTokenSpec>;
3554
+ ```
3555
+
3556
+ ### OauthTokenSpec
3557
+
3558
+ One token an envelope trusts: its format, issuers, audiences and freshness bound.
3559
+
3560
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L299)
3561
+
3562
+ ```ts
3563
+ export interface OauthTokenSpec {
3564
+ format: string;
3565
+ iss: string[];
3566
+ aud: string[];
3567
+ max_age_secs: number;
3568
+ ci_claims?: string[];
3569
+ }
3570
+ ```
3571
+
3572
+ Fields:
3573
+
3574
+ - **` format `**: Token format; phase 1 admits `oauth+access-token+dpop` only.
3575
+ - **` iss `**: Accepted issuers, each byte-equal to the IdP's discovery `issuer`.
3576
+ - **` aud `**: Audiences the token must carry (the platform audience the tenant registered).
3577
+ - **` max_age_secs `**: Maximum token age in seconds (1..=86400).
3578
+ - **` ci_claims `**: Top-level claim names also exposed lower-cased under `claims_ci`.
3579
+
3580
+ ### OpenSessionOpts
3581
+
3582
+ Associated data and token refresh skew for a managed slot session.
3583
+
3584
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/client.ts#L104)
3585
+
3586
+ ```ts
3587
+ export interface OpenSessionOpts {
3588
+ identity?: Uint8Array;
3589
+ skewMs?: number;
3590
+ }
3591
+ ```
3592
+
3593
+ Fields:
3594
+
3595
+ - **` identity `**: AAD for envelopes this session encrypts. Default = the 32-byte slot id.
3596
+ - **` skewMs `**: JWT refresh skew (ms) for isJwtExpiringSoon. Default 30_000.
3597
+
3598
+ ### PresentationDelegation
3599
+
3600
+ EIP-712 delegation from the slot creator to a delegate address.
3601
+
3602
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L38)
3603
+
3604
+ ```ts
3605
+ export interface PresentationDelegation {
3606
+ chain_id: number;
3607
+ slot_ids: string[];
3608
+ delegate: string;
3609
+ actions: string[];
3610
+ exp: number;
3611
+ nonce: number;
3612
+ signature: string;
3613
+ }
3614
+ ```
3615
+
3616
+ Fields:
3617
+
3618
+ - **` chain_id `**: EVM chain identifier.
3619
+ - **` slot_ids `**: Slot identifiers covered by this delegation.
3620
+ - **` delegate `**: 0x-hex 20-byte delegate address
3621
+ - **` actions `**: Operation names the delegate may authorize.
3622
+ - **` exp `**: Expiration time in Unix seconds.
3623
+ - **` nonce `**: Delegation nonce included in the signed payload.
3624
+ - **` signature `**: 0x-hex 65-byte EIP-712 signature
3625
+
3626
+ ### PresentationOperation
3627
+
3628
+ Operation details signed by a slot creator or delegate for credential authorization.
3629
+
3630
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L22)
3631
+
3632
+ ```ts
3633
+ export interface PresentationOperation {
3634
+ chain_id: number;
3635
+ slot_id: string;
3636
+ action: string;
3637
+ payload_digest: string;
3638
+ description: string;
3639
+ exp: number;
3640
+ }
3641
+ ```
3642
+
3643
+ Fields:
3644
+
3645
+ - **` chain_id `**: EVM chain identifier.
3646
+ - **` slot_id `**: 0x-hex 32-byte slot identifier
3647
+ - **` action `**: "sign" | "decrypt" | "ibe-extract" | "dual-approve"
3648
+ - **` payload_digest `**: 0x-hex 32-byte digest (sha256 of the message for sign/ibe-extract)
3649
+ - **` description `**: Human-readable description shown in transaction_data
3650
+ - **` exp `**: Unix timestamp - when the authorization expires
3651
+
3652
+ ### RedemptionGrant
3653
+
3654
+ Single-use credential redemption token and its expiry in Unix seconds.
3655
+
3656
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L128)
3657
+
3658
+ ```ts
3659
+ export interface RedemptionGrant {
3660
+ redemptionToken: string;
3661
+ expiresAt: number;
3662
+ }
3663
+ ```
3664
+
3665
+ Fields:
3666
+
3667
+ - **` redemptionToken `**: Single-use token to exchange for a JWT via redeemCredential().
3668
+ - **` expiresAt `**: Expiry of the redemption token, Unix seconds.
3669
+
3670
+ ### RegoEngine
3671
+
3672
+ The loaded engine. Every method is synchronous once loaded.
3673
+
3674
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L405)
3675
+
3676
+ ```ts
3677
+ export interface RegoEngine {
3678
+ pack(input: OauthPolicyInput): string;
3679
+ unpack(envelope: string): UnpackedEnvelope;
3680
+ lint(envelope: string): EnvelopeLint;
3681
+ evaluate(rule: string, presentation: OauthPresentation | string): EnvelopeVerdict;
3682
+ allowlistV1(): string[];
3683
+ }
3684
+ ```
3685
+
3686
+ Fields:
3687
+
3688
+ - **` pack `**: Pack authored parts into the canonical envelope; throws [RegoEnvelopeError](#regoenvelopeerror).
3689
+ - **` unpack `**: Take an envelope apart; throws [RegoEnvelopeError](#regoenvelopeerror).
3690
+ - **` lint `**: Schema + gate report and admissibility; throws [RegoEnvelopeError](#regoenvelopeerror) when malformed.
3691
+ - **` evaluate `**: Evaluate the policy against a presentation (an object, or its JSON text verbatim - the lossless form for claims holding integers beyond 2^53). Never throws for a refusal.
3692
+ - **` allowlistV1 `**: The builtin allow-list this build enforces.
3693
+
3694
+ ### RenewalGrant
3695
+
3696
+ Long-lived renewal token, authenticated holder, expiry and authorized scopes.
3697
+
3698
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/verifier.ts#L36)
3699
+
3700
+ ```ts
3701
+ export interface RenewalGrant {
3702
+ renewalToken: string;
3703
+ holder: string;
3704
+ expiresAt: number;
3705
+ scopes: string[];
3706
+ }
3707
+ ```
3708
+
3709
+ Fields:
3710
+
3711
+ - **` renewalToken `**: Long-lived token to exchange for fresh JWTs via redeemRenewalToken().
3712
+ - **` holder `**: Authenticated holder identifier.
3713
+ - **` expiresAt `**: Expiry, Unix seconds.
3714
+ - **` scopes `**: Scopes authorized by the renewal grant.
3715
+
3716
+ ### ScopeNamespace
3717
+
3718
+ Identity-scope authority. The issuer mode restricts grants to the verified issuer DID namespace. The any mode permits other namespaces and requires an explicit issuer allowlist.
3719
+
3720
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L105)
3721
+
3722
+ ```ts
3723
+ export type ScopeNamespace = 'issuer' | 'any';
3724
+ ```
3725
+
3726
+ ### SealedBlob
3727
+
3728
+ Encrypted blob header and ordered authenticated ciphertext chunks.
3729
+
3730
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L56)
3731
+
3732
+ ```ts
3733
+ export interface SealedBlob {
3734
+ header: IbeBlobHeader;
3735
+ body: Uint8Array;
3736
+ }
3737
+ ```
3738
+
3739
+ Fields:
3740
+
3741
+ - **` header `**: Metadata and wrapped data key required to open the blob.
3742
+ - **` body `**: The concatenated encrypted chunks.
3743
+
3744
+ ### Session
3745
+
3746
+ A live, managed access session for one key slot.
3747
+
3748
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/session.ts#L35)
3749
+
3750
+ ```ts
3751
+ export interface Session {
3752
+ readonly slotId: string;
3753
+ readonly holder: string;
3754
+ readonly mpkBytes: Uint8Array;
3755
+ readonly epoch: number;
3756
+ readonly jwt: string;
3757
+ encrypt(plaintext: Uint8Array, opts?: {
3758
+ identity?: Uint8Array;
3759
+ epoch?: bigint | null;
3760
+ }): Uint8Array;
3761
+ decrypt(envelope: Uint8Array | GroupEnvelope): Promise<Uint8Array>;
3762
+ sign(message: Uint8Array, opts?: SignOpts): Promise<FrostSignResult>;
3763
+ signDigest(digest: Uint8Array, opts?: {
3764
+ targetKeykeeper?: string;
3765
+ }): Promise<EoaSignature>;
3766
+ ensureFresh(): Promise<void>;
3767
+ close(): Promise<void>;
3768
+ }
3769
+ ```
3770
+
3771
+ Fields:
3772
+
3773
+ - **` slotId `**: 0x-prefixed bytes32 slot id.
3774
+ - **` holder `**: Subject the JWT was minted for.
3775
+ - **` mpkBytes `**: 96-byte compressed G2 group public key of the currently-assembled epoch.
3776
+ - **` epoch `**: Epoch of the currently-assembled master key.
3777
+ - **` jwt `**: The current JWT. Access after close throws.
3778
+ - **` encrypt `**: Encrypt to this slot's group key. Local + synchronous (needs no JWT).
3779
+ - **` decrypt `**: Decrypt with the assembled master key. Refreshes the JWT first and, on an epoch mismatch (the slot rotated), re-assembles and retries once.
3780
+ - **` sign `**: FROST-Ed25519 custody signature over `message`.
3781
+ - **` signDigest `**: Threshold-ECDSA signature over a 32-byte digest (EVM EOA slots).
3782
+ - **` ensureFresh `**: Renew the JWT if it is near expiry and re-assemble on rotation.
3783
+ - **` close `**: End this session, clear held key material and prevent further operations. Safe to call again.
3784
+
3785
+ ### SessionAuth
3786
+
3787
+ Choose exactly one JWT authorization mode. Renewal tokens support automatic refresh; other modes require a new session after expiry.
3788
+
3789
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/client.ts#L61)
3790
+
3791
+ ```ts
3792
+ export type SessionAuth = {
3793
+ jwt: string;
3794
+ renewalToken?: undefined;
3795
+ redemptionToken?: undefined;
3796
+ vpJwt?: undefined;
3797
+ } | {
3798
+ renewalToken: string;
3799
+ jwt?: undefined;
3800
+ redemptionToken?: undefined;
3801
+ vpJwt?: undefined;
3802
+ } | {
3803
+ redemptionToken: string;
3804
+ jwt?: undefined;
3805
+ renewalToken?: undefined;
3806
+ vpJwt?: undefined;
3807
+ } | {
3808
+ vpJwt: VpJwtAuth;
3809
+ jwt?: undefined;
3810
+ renewalToken?: undefined;
3811
+ redemptionToken?: undefined;
3812
+ };
3813
+ ```
3814
+
3815
+ Fields:
3816
+
3817
+ - **` jwt `**: Caller-supplied bearer JWT; omit when another authorization mode is selected.
3818
+ - **` renewalToken `**: Renewal token for obtaining and refreshing bearer JWTs; omit when another mode is selected.
3819
+ - **` redemptionToken `**: Single-use token exchanged for a bearer JWT; omit when another mode is selected.
3820
+ - **` vpJwt `**: Credential presentation and holder proof for obtaining a bearer JWT; omit when another mode is selected.
3821
+
3822
+ ### SessionStatusResult
3823
+
3824
+ Authorization session progress and optional committee result or failure detail.
3825
+
3826
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L97)
3827
+
3828
+ ```ts
3829
+ export interface SessionStatusResult {
3830
+ status: 'pending' | 'done' | 'failed';
3831
+ phase: SessionPhase;
3832
+ compoundToken?: Record<string, unknown>;
3833
+ verifierProofs?: unknown;
3834
+ bindingPreimage?: Record<string, unknown>;
3835
+ error?: string;
3836
+ evidenceCt?: string;
3837
+ }
3838
+ ```
3839
+
3840
+ Fields:
3841
+
3842
+ - **` status `**: Pending, completed or failed authorization state.
3843
+ - **` phase `**: Displayable progress within the authorization lifecycle.
3844
+ - **` compoundToken `**: Committee token returned after successful authorization.
3845
+ - **` verifierProofs `**: Verifier membership proofs for the selected snapshot.
3846
+ - **` bindingPreimage `**: Operation context used to derive the request-binding hash.
3847
+ - **` error `**: Optional failure detail reported by the verifier agent.
3848
+ - **` evidenceCt `**: the sealed presentation (base64url `bincode(Ciphertext)`) the token's `evidence_hash` names — post it to the keeper beside the token as `evidence_ct`.
3849
+
3850
+ ### ShardDecryptOpts
3851
+
3852
+ Keeper endpoints, JWT and ciphertext for combining partial decryptions in the caller.
3853
+
3854
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/decryption/client.ts#L100)
3855
+
3856
+ ```ts
3857
+ export interface ShardDecryptOpts {
3858
+ nodeUrls: string[];
3859
+ jwt: string;
3860
+ slotId: string;
3861
+ ciphertext: Ciphertext;
3862
+ identity: Uint8Array;
3863
+ ciphertextEpoch?: number;
3864
+ verifyShares?: boolean;
3865
+ }
3866
+ ```
3867
+
3868
+ Fields:
3869
+
3870
+ - **` nodeUrls `**: Base URLs of at least k nodes to fetch partial decryptions from.
3871
+ - **` jwt `**: Compact bearer JWT authorizing the request.
3872
+ - **` slotId `**: 32-byte slot identifier.
3873
+ - **` ciphertext `**: Ciphertext to decrypt.
3874
+ - **` identity `**: Original encryption associated data.
3875
+ - **` ciphertextEpoch `**: Expected key epoch of the ciphertext; used to detect rotation.
3876
+ - **` verifyShares `**: Pairing-verify each share before combining (identifiable abort). Default false.
3877
+
3878
+ ### ShardSignOpts
3879
+
3880
+ JWT-authorized FROST signing coordinated by the caller across selected keepers.
3881
+
3882
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/frost.ts#L175)
3883
+
3884
+ ```ts
3885
+ export interface ShardSignOpts {
3886
+ nodeUrls: string[];
3887
+ jwt: string;
3888
+ slotId: string;
3889
+ message: Uint8Array;
3890
+ groupPublicKey?: Uint8Array;
3891
+ verify?: boolean;
3892
+ }
3893
+ ```
3894
+
3895
+ Fields:
3896
+
3897
+ - **` nodeUrls `**: Base URLs of exactly the k chosen committee nodes.
3898
+ - **` jwt `**: Compact bearer JWT authorizing the request.
3899
+ - **` slotId `**: 32-byte slot identifier.
3900
+ - **` message `**: Raw message bytes to sign.
3901
+ - **` groupPublicKey `**: The slot's 32-byte group public key. Fetched from nodeUrls[0] if omitted.
3902
+ - **` verify `**: Verify the aggregate locally before returning (default true).
3903
+
3904
+ ### SignCustodyOpts
3905
+
3906
+ JWT-authorized FROST signing coordinated by one keeper, with optional owner approval.
3907
+
3908
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/signing/frost.ts#L54)
3909
+
3910
+ ```ts
3911
+ export interface SignCustodyOpts {
3912
+ nodeUrl: string;
3913
+ jwt: string;
3914
+ slotId: string;
3915
+ message: Uint8Array;
3916
+ signingSet?: number[];
3917
+ userSignature?: Uint8Array;
3918
+ targetKeykeeper?: string;
3919
+ requestId?: string;
3920
+ }
3921
+ ```
3922
+
3923
+ Fields:
3924
+
3925
+ - **` nodeUrl `**: Keeper HTTP base URL.
3926
+ - **` jwt `**: Compact bearer JWT authorizing the request.
3927
+ - **` slotId `**: 0x-prefixed (or bare) bytes32 slot id.
3928
+ - **` message `**: Raw message bytes to sign.
3929
+ - **` signingSet `**: Explicit signer set (u16 ids). Omit to node uses 1..k. Passing MORE than k ids makes the node use the robust ROAST coordinator.
3930
+ - **` userSignature `**: 64-byte Ed25519 user signature - required iff the slot has a registered owner pubkey. Build with signUserRequest().
3931
+ - **` targetKeykeeper `**: 20-byte operator address to pin (anti-Sybil).
3932
+ - **` requestId `**: Idempotency key. Required when userSignature is set.
3933
+
3934
+ ### SignOpts
3935
+
3936
+ Per-call overrides for a FROST custody signature.
3937
+
3938
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/session.ts#L23)
3939
+
3940
+ ```ts
3941
+ export interface SignOpts {
3942
+ signingSet?: number[];
3943
+ userSignature?: Uint8Array;
3944
+ targetKeykeeper?: string;
3945
+ requestId?: string;
3946
+ }
3947
+ ```
3948
+
3949
+ Fields:
3950
+
3951
+ - **` signingSet `**: Explicit signer set (u16 ids); omit to node uses 1..k.
3952
+ - **` userSignature `**: 64-byte Ed25519 user signature - required iff the slot has an owner key.
3953
+ - **` targetKeykeeper `**: 20-byte operator address to pin (anti-Sybil).
3954
+ - **` requestId `**: Idempotency key (required when userSignature is set).
3955
+
3956
+ ### TasraClient
3957
+
3958
+ A configured client. Holds no key material itself - each [Session](#session) it
3959
+ opens owns its own JWT and (lazily) assembled master key.
3960
+
3961
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/client.ts#L115)
3962
+
3963
+ ```ts
3964
+ export interface TasraClient {
3965
+ readonly config: Readonly<TasraClientConfig>;
3966
+ openSession(slotId: string, auth: SessionAuth, opts?: OpenSessionOpts): Promise<Session>;
3967
+ sessions(): readonly Session[];
3968
+ closeAll(): Promise<void>;
3969
+ }
3970
+ ```
3971
+
3972
+ Fields:
3973
+
3974
+ - **` config `**: Read-only snapshot of connection settings supplied when the client was created.
3975
+ - **` openSession `**: Obtain a JWT (per `auth`), assemble the slot key, and return a managed Session.
3976
+ - **` sessions `**: Currently-open sessions (live references).
3977
+ - **` closeAll `**: Zeroize + close every open session.
3978
+
3979
+ ### TasraClientConfig
3980
+
3981
+ Connection parameters for [createTasraClient](#createtasraclient). Set once and reused by
3982
+ every session the client opens.
3983
+
3984
+ `verifier` and `identity` are optional in the type because `{jwt}` auth needs
3985
+ neither, but each is enforced at `openSession` time for the modes that do.
3986
+
3987
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/client.ts#L23)
3988
+
3989
+ ```ts
3990
+ export interface TasraClientConfig {
3991
+ nodes: readonly string[];
3992
+ verifier?: string;
3993
+ identity?: string;
3994
+ }
3995
+ ```
3996
+
3997
+ Fields:
3998
+
3999
+ - **` nodes `**: k-of-n keykeeper-node base URLs.
4000
+ - **` verifier `**: Verifier base URL - required for renewalToken / redemptionToken / vpJwt auth.
4001
+ - **` identity `**: This holder's DID - recipient_did / holder for credential & vp-jwt auth.
4002
+
4003
+ ### UnpackedEnvelope
4004
+
4005
+ An envelope taken apart: the exact policy source, its tokens and its entrypoint.
4006
+
4007
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L326)
4008
+
4009
+ ```ts
4010
+ export interface UnpackedEnvelope {
4011
+ policy: string;
4012
+ tokens: OauthTokens;
4013
+ entrypoint: string;
4014
+ }
4015
+ ```
4016
+
4017
+ Fields:
4018
+
4019
+ - **` policy `**: Rego source exactly as committed.
4020
+ - **` tokens `**: Token specifications.
4021
+ - **` entrypoint `**: Entrypoint rule.
4022
+
4023
+ ### VerifierAgentSessionErrorKind
4024
+
4025
+ Why a session did not yield a token - the class the UI explains, with a NON-SECRET
4026
+ correlation reference (the session id; the poll secret is never part of an error).
4027
+
4028
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/verifier-agent/index.ts#L117)
4029
+
4030
+ ```ts
4031
+ export type VerifierAgentSessionErrorKind = 'timeout' | 'refused' | 'unavailable' | 'protocol' | 'cancelled';
4032
+ ```
4033
+
4034
+ ### VpJwtAuth
4035
+
4036
+ The `vpJwt` auth mode's payload: signed VCs + a holder-key proof to JWT.
4037
+
4038
+ [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/client/client.ts#L51)
4039
+
4040
+ ```ts
4041
+ export interface VpJwtAuth {
4042
+ dcqlRule: string;
4043
+ credentials: string[];
4044
+ holderProof: HolderProofAuth;
4045
+ }
4046
+ ```
4047
+
4048
+ Fields:
4049
+
4050
+ - **` dcqlRule `**: DCQL policy JSON to evaluate.
4051
+ - **` credentials `**: Compact signed credentials presented to the verifier.
4052
+ - **` holderProof `**: Holder-key possession proof settings.
4053
+
4054
+ ## Constants and ABI values
4055
+
4056
+ Shared values and contract definitions.
4057
+
4058
+ | Export | Description | Definition |
4059
+ |---|---|---|
4060
+ | `DCQL_MAX_RULE_LEN` | Cap on a rule, in BYTES, before parsing. Deliberately the same 4096 as the legacy grammar for now, and it is not yet a justified number: 4096 was chosen against a terse five-clause language and an OID4VP-DCQL query expressing the same policy is several times larger. The keeper re-parses the rule on every request, so this bounds real per-request work. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L66) |
4061
+ | `DEFAULT_REGO_ENTRYPOINT` | Entrypoint the network's example policies use (`package tasra.slot`). | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L31) |
4062
+ | `FORMAT_JWT_VC_JSON` | W3C JWT-VC JSON credential format. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/oid4vp.ts#L27) |
4063
+ | `IBE_BLOB_DEFAULT_CHUNK` | Default chunk: 1 MiB of plaintext (+16-byte tag on the wire). | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/ibe-blob.ts#L32) |
4064
+ | `MAX_IDENTITY_LEN` | Max BYTE length of a scope grant or an identity (the reference implementation's cap). Anything longer fails closed - a grant or identity this large is a bug or an attack, not a real subject path. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/identityScope.ts#L31) |
4065
+ | `MAX_PLAINTEXT_LEN` | Largest plaintext one envelope carries: the AEAD ciphertext cap minus the 16-byte tag. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/crypto/envelope.ts#L310) |
4066
+ | `OAUTH_ENVELOPE_KEY` | The single top-level member that marks a rule as an OAuth policy envelope. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L28) |
4067
+ | `REGO_POLICY_REFUSED` | The refusal text a holder sees when an envelope's policy denies. Deliberately generic: rule contents are confidential to the operator set, so a refusal never names a claim or clause. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L37) |
4068
+ | `REGO_WASM_SHA256` | SHA-256 of the vendored `keykeeper_rego_wasm_bg.wasm`, as recorded in its PINS.json. `scripts/check-rego-pins.mjs` asserts the two agree, so this constant cannot drift from the pinned build. | [Source](https://github.com/t3foundry/tasra-sdk/blob/develop/src/auth/rego.ts#L44) |