@psavelis/enterprise-blockchain 0.1.0 → 1.1.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 (296) hide show
  1. package/README.md +15 -2
  2. package/dist/aid-settlement/application/reconciler.d.ts +13 -0
  3. package/dist/aid-settlement/application/reconciler.d.ts.map +1 -0
  4. package/dist/aid-settlement/application/reconciler.js +77 -0
  5. package/dist/aid-settlement/domain/entities.d.ts +24 -0
  6. package/dist/aid-settlement/domain/entities.d.ts.map +1 -0
  7. package/dist/aid-settlement/domain/entities.js +1 -0
  8. package/dist/aid-settlement/domain/ports.d.ts +10 -0
  9. package/dist/aid-settlement/domain/ports.d.ts.map +1 -0
  10. package/dist/aid-settlement/domain/ports.js +1 -0
  11. package/dist/aid-settlement/index.d.ts +19 -0
  12. package/dist/aid-settlement/index.d.ts.map +1 -0
  13. package/dist/aid-settlement/index.js +23 -0
  14. package/dist/aid-settlement/infrastructure/in-memory-store.d.ts +12 -0
  15. package/dist/aid-settlement/infrastructure/in-memory-store.d.ts.map +1 -0
  16. package/dist/aid-settlement/infrastructure/in-memory-store.js +17 -0
  17. package/dist/credentialing/application/clearance-evaluator.d.ts +10 -0
  18. package/dist/credentialing/application/clearance-evaluator.d.ts.map +1 -0
  19. package/dist/credentialing/application/clearance-evaluator.js +63 -0
  20. package/dist/credentialing/domain/entities.d.ts +28 -0
  21. package/dist/credentialing/domain/entities.d.ts.map +1 -0
  22. package/dist/credentialing/domain/entities.js +1 -0
  23. package/dist/credentialing/domain/ports.d.ts +9 -0
  24. package/dist/credentialing/domain/ports.d.ts.map +1 -0
  25. package/dist/credentialing/domain/ports.js +1 -0
  26. package/dist/credentialing/index.d.ts +19 -0
  27. package/dist/credentialing/index.d.ts.map +1 -0
  28. package/dist/credentialing/index.js +23 -0
  29. package/dist/credentialing/infrastructure/in-memory-store.d.ts +11 -0
  30. package/dist/credentialing/infrastructure/in-memory-store.d.ts.map +1 -0
  31. package/dist/credentialing/infrastructure/in-memory-store.js +14 -0
  32. package/dist/hsm/application/asymmetric-key-service.d.ts +23 -0
  33. package/dist/hsm/application/asymmetric-key-service.d.ts.map +1 -0
  34. package/dist/hsm/application/asymmetric-key-service.js +109 -0
  35. package/dist/hsm/application/envelope-encryption-service.d.ts +18 -0
  36. package/dist/hsm/application/envelope-encryption-service.d.ts.map +1 -0
  37. package/dist/hsm/application/envelope-encryption-service.js +59 -0
  38. package/dist/hsm/application/symmetric-key-service.d.ts +34 -0
  39. package/dist/hsm/application/symmetric-key-service.d.ts.map +1 -0
  40. package/dist/hsm/application/symmetric-key-service.js +107 -0
  41. package/dist/hsm/domain/entities.d.ts +104 -0
  42. package/dist/hsm/domain/entities.d.ts.map +1 -0
  43. package/dist/hsm/domain/entities.js +10 -0
  44. package/dist/hsm/domain/ports.d.ts +20 -0
  45. package/dist/hsm/domain/ports.d.ts.map +1 -0
  46. package/dist/hsm/domain/ports.js +1 -0
  47. package/dist/hsm/index.d.ts +48 -0
  48. package/dist/hsm/index.d.ts.map +1 -0
  49. package/dist/hsm/index.js +97 -0
  50. package/dist/hsm/infrastructure/audit-log-factory.d.ts +59 -0
  51. package/dist/hsm/infrastructure/audit-log-factory.d.ts.map +1 -0
  52. package/dist/hsm/infrastructure/audit-log-factory.js +95 -0
  53. package/dist/hsm/infrastructure/audit-log.d.ts +8 -0
  54. package/dist/hsm/infrastructure/audit-log.d.ts.map +1 -0
  55. package/dist/hsm/infrastructure/audit-log.js +18 -0
  56. package/dist/hsm/infrastructure/file-audit-log.d.ts +55 -0
  57. package/dist/hsm/infrastructure/file-audit-log.d.ts.map +1 -0
  58. package/dist/hsm/infrastructure/file-audit-log.js +128 -0
  59. package/dist/hsm/infrastructure/key-store.d.ts +9 -0
  60. package/dist/hsm/infrastructure/key-store.d.ts.map +1 -0
  61. package/dist/hsm/infrastructure/key-store.js +12 -0
  62. package/dist/hsm/infrastructure/syslog-audit-log.d.ts +64 -0
  63. package/dist/hsm/infrastructure/syslog-audit-log.d.ts.map +1 -0
  64. package/dist/hsm/infrastructure/syslog-audit-log.js +167 -0
  65. package/dist/index.d.ts +22 -0
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/index.js +37 -0
  68. package/dist/integrations/besu-client/error-mapper.d.ts +9 -0
  69. package/dist/integrations/besu-client/error-mapper.d.ts.map +1 -0
  70. package/dist/integrations/besu-client/error-mapper.js +22 -0
  71. package/dist/integrations/besu-client/index.d.ts +65 -0
  72. package/dist/integrations/besu-client/index.d.ts.map +1 -0
  73. package/dist/integrations/besu-client/index.js +276 -0
  74. package/dist/integrations/besu-client/ports.d.ts +44 -0
  75. package/dist/integrations/besu-client/ports.d.ts.map +1 -0
  76. package/dist/integrations/besu-client/ports.js +1 -0
  77. package/dist/integrations/corda-gateway/index.d.ts +37 -0
  78. package/dist/integrations/corda-gateway/index.d.ts.map +1 -0
  79. package/dist/integrations/corda-gateway/index.js +234 -0
  80. package/dist/integrations/corda-gateway/ports.d.ts +33 -0
  81. package/dist/integrations/corda-gateway/ports.d.ts.map +1 -0
  82. package/dist/integrations/corda-gateway/ports.js +1 -0
  83. package/dist/integrations/fabric-gateway/index.d.ts +78 -0
  84. package/dist/integrations/fabric-gateway/index.d.ts.map +1 -0
  85. package/dist/integrations/fabric-gateway/index.js +214 -0
  86. package/dist/integrations/fabric-gateway/ports.d.ts +50 -0
  87. package/dist/integrations/fabric-gateway/ports.d.ts.map +1 -0
  88. package/dist/integrations/fabric-gateway/ports.js +1 -0
  89. package/dist/integrations/index.d.ts +19 -0
  90. package/dist/integrations/index.d.ts.map +1 -0
  91. package/dist/integrations/index.js +19 -0
  92. package/dist/integrations/shared/env.d.ts +4 -0
  93. package/dist/integrations/shared/env.d.ts.map +1 -0
  94. package/dist/integrations/shared/env.js +24 -0
  95. package/dist/integrations/shared/retry.d.ts +79 -0
  96. package/dist/integrations/shared/retry.d.ts.map +1 -0
  97. package/dist/integrations/shared/retry.js +315 -0
  98. package/dist/mpc/adapters.d.ts +36 -0
  99. package/dist/mpc/adapters.d.ts.map +1 -0
  100. package/dist/mpc/adapters.js +46 -0
  101. package/dist/mpc/crypto.d.ts +2 -0
  102. package/dist/mpc/crypto.d.ts.map +1 -0
  103. package/dist/mpc/crypto.js +2 -0
  104. package/dist/mpc/dsa.d.ts +134 -0
  105. package/dist/mpc/dsa.d.ts.map +1 -0
  106. package/dist/mpc/dsa.js +127 -0
  107. package/dist/mpc/field.d.ts +127 -0
  108. package/dist/mpc/field.d.ts.map +1 -0
  109. package/dist/mpc/field.js +209 -0
  110. package/dist/mpc/hybrid-kem.d.ts +96 -0
  111. package/dist/mpc/hybrid-kem.d.ts.map +1 -0
  112. package/dist/mpc/hybrid-kem.js +136 -0
  113. package/dist/mpc/index.d.ts +135 -0
  114. package/dist/mpc/index.d.ts.map +1 -0
  115. package/dist/mpc/index.js +348 -0
  116. package/dist/mpc/kyber.d.ts +134 -0
  117. package/dist/mpc/kyber.d.ts.map +1 -0
  118. package/dist/mpc/kyber.js +143 -0
  119. package/dist/mpc/ports.d.ts +67 -0
  120. package/dist/mpc/ports.d.ts.map +1 -0
  121. package/dist/mpc/ports.js +9 -0
  122. package/dist/mpc/quantum.d.ts +80 -0
  123. package/dist/mpc/quantum.d.ts.map +1 -0
  124. package/dist/mpc/quantum.js +180 -0
  125. package/dist/p2mr/adapters.d.ts +31 -0
  126. package/dist/p2mr/adapters.d.ts.map +1 -0
  127. package/dist/p2mr/adapters.js +35 -0
  128. package/dist/p2mr/index.d.ts +63 -0
  129. package/dist/p2mr/index.d.ts.map +1 -0
  130. package/dist/p2mr/index.js +59 -0
  131. package/dist/p2mr/merkle-tree.d.ts +109 -0
  132. package/dist/p2mr/merkle-tree.d.ts.map +1 -0
  133. package/dist/p2mr/merkle-tree.js +239 -0
  134. package/dist/p2mr/p2mr-output.d.ts +142 -0
  135. package/dist/p2mr/p2mr-output.d.ts.map +1 -0
  136. package/dist/p2mr/p2mr-output.js +150 -0
  137. package/dist/p2mr/ports.d.ts +52 -0
  138. package/dist/p2mr/ports.d.ts.map +1 -0
  139. package/dist/p2mr/ports.js +9 -0
  140. package/dist/p2mr/script-interpreter.d.ts +92 -0
  141. package/dist/p2mr/script-interpreter.d.ts.map +1 -0
  142. package/dist/p2mr/script-interpreter.js +535 -0
  143. package/dist/p2mr/script-leaf.d.ts +70 -0
  144. package/dist/p2mr/script-leaf.d.ts.map +1 -0
  145. package/dist/p2mr/script-leaf.js +203 -0
  146. package/dist/p2mr/spend-proof.d.ts +95 -0
  147. package/dist/p2mr/spend-proof.d.ts.map +1 -0
  148. package/dist/p2mr/spend-proof.js +358 -0
  149. package/dist/p2mr/types.d.ts +209 -0
  150. package/dist/p2mr/types.d.ts.map +1 -0
  151. package/dist/p2mr/types.js +9 -0
  152. package/dist/privacy/application/view-projector.d.ts +13 -0
  153. package/dist/privacy/application/view-projector.d.ts.map +1 -0
  154. package/dist/privacy/application/view-projector.js +85 -0
  155. package/dist/privacy/domain/entities.d.ts +26 -0
  156. package/dist/privacy/domain/entities.d.ts.map +1 -0
  157. package/dist/privacy/domain/entities.js +1 -0
  158. package/dist/privacy/domain/ports.d.ts +7 -0
  159. package/dist/privacy/domain/ports.d.ts.map +1 -0
  160. package/dist/privacy/domain/ports.js +1 -0
  161. package/dist/privacy/index.d.ts +21 -0
  162. package/dist/privacy/index.d.ts.map +1 -0
  163. package/dist/privacy/index.js +25 -0
  164. package/dist/privacy/infrastructure/in-memory-store.d.ts +8 -0
  165. package/dist/privacy/infrastructure/in-memory-store.d.ts.map +1 -0
  166. package/dist/privacy/infrastructure/in-memory-store.js +7 -0
  167. package/dist/protocols/besu-port.d.ts +80 -0
  168. package/dist/protocols/besu-port.d.ts.map +1 -0
  169. package/dist/protocols/besu-port.js +1 -0
  170. package/dist/protocols/corda-port.d.ts +103 -0
  171. package/dist/protocols/corda-port.d.ts.map +1 -0
  172. package/dist/protocols/corda-port.js +9 -0
  173. package/dist/protocols/credentialing-port.d.ts +11 -0
  174. package/dist/protocols/credentialing-port.d.ts.map +1 -0
  175. package/dist/protocols/credentialing-port.js +1 -0
  176. package/dist/protocols/fabric-port.d.ts +89 -0
  177. package/dist/protocols/fabric-port.d.ts.map +1 -0
  178. package/dist/protocols/fabric-port.js +9 -0
  179. package/dist/protocols/index.d.ts +14 -0
  180. package/dist/protocols/index.d.ts.map +1 -0
  181. package/dist/protocols/index.js +7 -0
  182. package/dist/protocols/p2mr-port.d.ts +159 -0
  183. package/dist/protocols/p2mr-port.d.ts.map +1 -0
  184. package/dist/protocols/p2mr-port.js +12 -0
  185. package/dist/protocols/privacy-port.d.ts +9 -0
  186. package/dist/protocols/privacy-port.d.ts.map +1 -0
  187. package/dist/protocols/privacy-port.js +1 -0
  188. package/dist/protocols/traceability-port.d.ts +12 -0
  189. package/dist/protocols/traceability-port.d.ts.map +1 -0
  190. package/dist/protocols/traceability-port.js +1 -0
  191. package/dist/shared/collection-store.d.ts +12 -0
  192. package/dist/shared/collection-store.d.ts.map +1 -0
  193. package/dist/shared/collection-store.js +26 -0
  194. package/dist/shared/commit.d.ts +24 -0
  195. package/dist/shared/commit.d.ts.map +1 -0
  196. package/dist/shared/commit.js +50 -0
  197. package/dist/shared/crypto.d.ts +2 -0
  198. package/dist/shared/crypto.d.ts.map +1 -0
  199. package/dist/shared/crypto.js +4 -0
  200. package/dist/shared/date.d.ts +2 -0
  201. package/dist/shared/date.d.ts.map +1 -0
  202. package/dist/shared/date.js +3 -0
  203. package/dist/shared/index.d.ts +9 -0
  204. package/dist/shared/index.d.ts.map +1 -0
  205. package/dist/shared/index.js +11 -0
  206. package/dist/shared/logger.d.ts +37 -0
  207. package/dist/shared/logger.d.ts.map +1 -0
  208. package/dist/shared/logger.js +45 -0
  209. package/dist/shared/store.d.ts +25 -0
  210. package/dist/shared/store.d.ts.map +1 -0
  211. package/dist/shared/store.js +18 -0
  212. package/dist/shared/telemetry-sdk.d.ts +26 -0
  213. package/dist/shared/telemetry-sdk.d.ts.map +1 -0
  214. package/dist/shared/telemetry-sdk.js +97 -0
  215. package/dist/shared/telemetry.d.ts +86 -0
  216. package/dist/shared/telemetry.d.ts.map +1 -0
  217. package/dist/shared/telemetry.js +137 -0
  218. package/dist/stark-settlement/application/aggregator-service.d.ts +112 -0
  219. package/dist/stark-settlement/application/aggregator-service.d.ts.map +1 -0
  220. package/dist/stark-settlement/application/aggregator-service.js +256 -0
  221. package/dist/stark-settlement/application/ledger-service.d.ts +114 -0
  222. package/dist/stark-settlement/application/ledger-service.d.ts.map +1 -0
  223. package/dist/stark-settlement/application/ledger-service.js +318 -0
  224. package/dist/stark-settlement/application/settlement-service.d.ts +104 -0
  225. package/dist/stark-settlement/application/settlement-service.d.ts.map +1 -0
  226. package/dist/stark-settlement/application/settlement-service.js +251 -0
  227. package/dist/stark-settlement/domain/entities.d.ts +365 -0
  228. package/dist/stark-settlement/domain/entities.d.ts.map +1 -0
  229. package/dist/stark-settlement/domain/entities.js +29 -0
  230. package/dist/stark-settlement/domain/ports.d.ts +485 -0
  231. package/dist/stark-settlement/domain/ports.d.ts.map +1 -0
  232. package/dist/stark-settlement/domain/ports.js +14 -0
  233. package/dist/stark-settlement/domain/value-objects.d.ts +268 -0
  234. package/dist/stark-settlement/domain/value-objects.d.ts.map +1 -0
  235. package/dist/stark-settlement/domain/value-objects.js +500 -0
  236. package/dist/stark-settlement/index.d.ts +172 -0
  237. package/dist/stark-settlement/index.d.ts.map +1 -0
  238. package/dist/stark-settlement/index.js +193 -0
  239. package/dist/stark-settlement/infrastructure/adapters/audit-adapter.d.ts +52 -0
  240. package/dist/stark-settlement/infrastructure/adapters/audit-adapter.d.ts.map +1 -0
  241. package/dist/stark-settlement/infrastructure/adapters/audit-adapter.js +154 -0
  242. package/dist/stark-settlement/infrastructure/adapters/bitcoin-adapter.d.ts +88 -0
  243. package/dist/stark-settlement/infrastructure/adapters/bitcoin-adapter.d.ts.map +1 -0
  244. package/dist/stark-settlement/infrastructure/adapters/bitcoin-adapter.js +187 -0
  245. package/dist/stark-settlement/infrastructure/adapters/clock-adapter.d.ts +59 -0
  246. package/dist/stark-settlement/infrastructure/adapters/clock-adapter.d.ts.map +1 -0
  247. package/dist/stark-settlement/infrastructure/adapters/clock-adapter.js +85 -0
  248. package/dist/stark-settlement/infrastructure/adapters/dilithium-adapter.d.ts +60 -0
  249. package/dist/stark-settlement/infrastructure/adapters/dilithium-adapter.d.ts.map +1 -0
  250. package/dist/stark-settlement/infrastructure/adapters/dilithium-adapter.js +104 -0
  251. package/dist/stark-settlement/infrastructure/adapters/event-emitter-adapter.d.ts +115 -0
  252. package/dist/stark-settlement/infrastructure/adapters/event-emitter-adapter.d.ts.map +1 -0
  253. package/dist/stark-settlement/infrastructure/adapters/event-emitter-adapter.js +191 -0
  254. package/dist/stark-settlement/infrastructure/adapters/fiat-adapter.d.ts +65 -0
  255. package/dist/stark-settlement/infrastructure/adapters/fiat-adapter.d.ts.map +1 -0
  256. package/dist/stark-settlement/infrastructure/adapters/fiat-adapter.js +207 -0
  257. package/dist/stark-settlement/infrastructure/adapters/mock-stark-adapter.d.ts +73 -0
  258. package/dist/stark-settlement/infrastructure/adapters/mock-stark-adapter.d.ts.map +1 -0
  259. package/dist/stark-settlement/infrastructure/adapters/mock-stark-adapter.js +287 -0
  260. package/dist/stark-settlement/infrastructure/adapters/solana-adapter.d.ts +78 -0
  261. package/dist/stark-settlement/infrastructure/adapters/solana-adapter.d.ts.map +1 -0
  262. package/dist/stark-settlement/infrastructure/adapters/solana-adapter.js +172 -0
  263. package/dist/stark-settlement/infrastructure/adapters/starknet-proof-adapter.d.ts +56 -0
  264. package/dist/stark-settlement/infrastructure/adapters/starknet-proof-adapter.d.ts.map +1 -0
  265. package/dist/stark-settlement/infrastructure/adapters/starknet-proof-adapter.js +261 -0
  266. package/dist/stark-settlement/infrastructure/adapters/stone-proof-adapter.d.ts +125 -0
  267. package/dist/stark-settlement/infrastructure/adapters/stone-proof-adapter.d.ts.map +1 -0
  268. package/dist/stark-settlement/infrastructure/adapters/stone-proof-adapter.js +416 -0
  269. package/dist/stark-settlement/infrastructure/persistence/ledger-store.d.ts +68 -0
  270. package/dist/stark-settlement/infrastructure/persistence/ledger-store.d.ts.map +1 -0
  271. package/dist/stark-settlement/infrastructure/persistence/ledger-store.js +238 -0
  272. package/dist/stark-settlement/infrastructure/persistence/offset-store.d.ts +30 -0
  273. package/dist/stark-settlement/infrastructure/persistence/offset-store.d.ts.map +1 -0
  274. package/dist/stark-settlement/infrastructure/persistence/offset-store.js +57 -0
  275. package/dist/stark-settlement/infrastructure/persistence/outbox-store.d.ts +45 -0
  276. package/dist/stark-settlement/infrastructure/persistence/outbox-store.d.ts.map +1 -0
  277. package/dist/stark-settlement/infrastructure/persistence/outbox-store.js +171 -0
  278. package/dist/traceability/application/recall-assessor.d.ts +13 -0
  279. package/dist/traceability/application/recall-assessor.d.ts.map +1 -0
  280. package/dist/traceability/application/recall-assessor.js +74 -0
  281. package/dist/traceability/domain/entities.d.ts +23 -0
  282. package/dist/traceability/domain/entities.d.ts.map +1 -0
  283. package/dist/traceability/domain/entities.js +1 -0
  284. package/dist/traceability/domain/ports.d.ts +23 -0
  285. package/dist/traceability/domain/ports.d.ts.map +1 -0
  286. package/dist/traceability/domain/ports.js +1 -0
  287. package/dist/traceability/domain/recall.d.ts +12 -0
  288. package/dist/traceability/domain/recall.d.ts.map +1 -0
  289. package/dist/traceability/domain/recall.js +1 -0
  290. package/dist/traceability/index.d.ts +22 -0
  291. package/dist/traceability/index.d.ts.map +1 -0
  292. package/dist/traceability/index.js +26 -0
  293. package/dist/traceability/infrastructure/in-memory-store.d.ts +13 -0
  294. package/dist/traceability/infrastructure/in-memory-store.d.ts.map +1 -0
  295. package/dist/traceability/infrastructure/in-memory-store.js +24 -0
  296. package/package.json +12 -9
@@ -0,0 +1,365 @@
1
+ /**
2
+ * Domain Entities for Aggregated STARK Settlement Layer
3
+ *
4
+ * Core types representing the business domain:
5
+ * - Mirror accounts (custodial balances per asset/chain)
6
+ * - Ledger transactions (signed state transitions)
7
+ * - STARK proofs (3-tier recursive aggregation)
8
+ * - Outbox entries (pending settlements)
9
+ * - Settlement results (per-chain outcomes)
10
+ *
11
+ * All entities are immutable (readonly properties) following DDD patterns.
12
+ * No external SDK imports - pure domain types.
13
+ *
14
+ * @see skills/post-quantum-crypto.md for ML-DSA-65 signature context
15
+ * @see docs/adr/ADR-0001-hexagonal-architecture.md for design rationale
16
+ */
17
+ /**
18
+ * Supported asset types for cross-chain settlement.
19
+ * Each asset type maps to a specific external chain or rail.
20
+ */
21
+ export type AssetType = "SOL" | "BTC" | "USD";
22
+ /**
23
+ * Asset configuration including decimal precision and chain-specific metadata.
24
+ */
25
+ export interface AssetConfig {
26
+ readonly type: AssetType;
27
+ /** Decimal places for human-readable conversion (SOL=9, BTC=8, USD=2) */
28
+ readonly decimals: number;
29
+ /** Human-readable name */
30
+ readonly name: string;
31
+ /** Chain identifier for external settlement */
32
+ readonly chainId: string;
33
+ }
34
+ /**
35
+ * Standard asset configurations.
36
+ */
37
+ export declare const ASSET_CONFIGS: Record<AssetType, AssetConfig>;
38
+ /**
39
+ * Custodial mirror account representing an external address's balance
40
+ * within the ZKP ledger.
41
+ *
42
+ * Mirror accounts track:
43
+ * - Current balance (in atomic units)
44
+ * - Link to external chain address
45
+ * - Last STARK proof covering this account
46
+ */
47
+ export interface MirrorAccount {
48
+ /** Unique account identifier (UUID v4) */
49
+ readonly id: string;
50
+ /** External chain address (Solana pubkey, BTC address, or fiat account) */
51
+ readonly externalAddress: string;
52
+ /** Asset type this account holds */
53
+ readonly assetType: AssetType;
54
+ /** Current balance in atomic units (lamports, satoshis, cents) */
55
+ readonly balance: bigint;
56
+ /** State root of the last STARK proof that included this account */
57
+ readonly lastProofRoot: string;
58
+ /** Account creation timestamp (Unix ms) */
59
+ readonly createdAt: number;
60
+ /** Last update timestamp (Unix ms) */
61
+ readonly updatedAt: number;
62
+ /** Whether this account is active (false = frozen) */
63
+ readonly isActive: boolean;
64
+ /** Optional metadata for compliance/audit */
65
+ readonly metadata: Readonly<Record<string, string>>;
66
+ }
67
+ /**
68
+ * Transaction types in the ZKP ledger.
69
+ */
70
+ export type TransactionType = "deposit" | "transfer" | "withdrawal";
71
+ /**
72
+ * Transaction status in the ledger lifecycle.
73
+ */
74
+ export type TransactionStatus = "pending" | "proved" | "aggregated" | "finalized" | "settled" | "failed";
75
+ /**
76
+ * A signed state transition in the ZKP ledger.
77
+ *
78
+ * Each transaction:
79
+ * - Is signed with ML-DSA-65 (post-quantum)
80
+ * - Has a unique idempotency key
81
+ * - Generates a base STARK proof upon acceptance
82
+ */
83
+ export interface LedgerTransaction {
84
+ /** Unique transaction identifier (UUID v4) */
85
+ readonly txId: string;
86
+ /** Transaction type */
87
+ readonly type: TransactionType;
88
+ /** Source account ID (null for deposits) */
89
+ readonly fromAccountId: string | null;
90
+ /** Destination account ID (null for withdrawals) */
91
+ readonly toAccountId: string | null;
92
+ /** Asset type being transferred */
93
+ readonly assetType: AssetType;
94
+ /** Amount in atomic units */
95
+ readonly amount: bigint;
96
+ /** Unique idempotency key for exactly-once processing */
97
+ readonly idempotencyKey: string;
98
+ /** ML-DSA-65 signature over the transaction payload */
99
+ readonly mlDsaSignature: Uint8Array;
100
+ /** SHA-256 hash of the signer's ML-DSA-65 public key */
101
+ readonly mlDsaPublicKeyHash: string;
102
+ /** Current transaction status */
103
+ readonly status: TransactionStatus;
104
+ /** Optional metadata (beneficiary info, reference, etc.) */
105
+ readonly metadata: Readonly<Record<string, string>>;
106
+ /** Transaction creation timestamp (Unix ms) */
107
+ readonly createdAt: number;
108
+ /** Last status update timestamp (Unix ms) */
109
+ readonly updatedAt: number;
110
+ }
111
+ /**
112
+ * Payload structure that is signed by ML-DSA-65.
113
+ * This is the canonical form for signature verification.
114
+ */
115
+ export interface TransactionPayload {
116
+ readonly txId: string;
117
+ readonly type: TransactionType;
118
+ readonly fromAccountId: string | null;
119
+ readonly toAccountId: string | null;
120
+ readonly assetType: AssetType;
121
+ readonly amount: string;
122
+ readonly idempotencyKey: string;
123
+ readonly createdAt: number;
124
+ }
125
+ /**
126
+ * Base proof for a single transaction.
127
+ *
128
+ * Generated by the STARK proof generator for each ledger transaction.
129
+ * Contains the proof that a valid state transition occurred.
130
+ */
131
+ export interface BaseProof {
132
+ /** Unique proof identifier (UUID v4) */
133
+ readonly proofId: string;
134
+ /** Transaction ID this proof covers */
135
+ readonly txId: string;
136
+ /** Raw STARK proof bytes */
137
+ readonly starkProof: Uint8Array;
138
+ /** Public inputs as field element hex strings */
139
+ readonly publicInputs: readonly string[];
140
+ /** Hash of the verification key used */
141
+ readonly verificationKeyHash: string;
142
+ /** Pre-state commitment (Merkle root before transition) */
143
+ readonly preStateRoot: string;
144
+ /** Post-state commitment (Merkle root after transition) */
145
+ readonly postStateRoot: string;
146
+ /** Proof generation timestamp (Unix ms) */
147
+ readonly createdAt: number;
148
+ }
149
+ /**
150
+ * Tier-1 aggregated proof combining 128 base proofs.
151
+ *
152
+ * Uses recursive STARK verification to prove that all 128 base proofs
153
+ * are valid within a single succinct proof.
154
+ */
155
+ export interface Tier1Proof {
156
+ /** Unique proof identifier (UUID v4) */
157
+ readonly proofId: string;
158
+ /** IDs of the 128 base proofs aggregated */
159
+ readonly baseProofIds: readonly string[];
160
+ /** Aggregated STARK proof bytes */
161
+ readonly aggregatedProof: Uint8Array;
162
+ /** Public inputs for the aggregated proof */
163
+ readonly publicInputs: readonly string[];
164
+ /** Idempotency keys propagated from all base transactions */
165
+ readonly idempotencyKeys: readonly string[];
166
+ /** Combined pre-state root (first transaction's pre-state) */
167
+ readonly preStateRoot: string;
168
+ /** Combined post-state root (last transaction's post-state) */
169
+ readonly postStateRoot: string;
170
+ /** Number of transactions covered (128) */
171
+ readonly txCount: number;
172
+ /** Proof generation timestamp (Unix ms) */
173
+ readonly createdAt: number;
174
+ }
175
+ /**
176
+ * Tier-2 block proof combining 64 Tier-1 proofs.
177
+ *
178
+ * Final proof representing up to 8,192 transactions (128 * 64).
179
+ * This is what gets settled to external chains.
180
+ */
181
+ export interface Tier2BlockProof {
182
+ /** Unique block proof identifier (UUID v4) */
183
+ readonly blockProofId: string;
184
+ /** IDs of the 64 Tier-1 proofs aggregated */
185
+ readonly tier1ProofIds: readonly string[];
186
+ /** Final STARK proof bytes */
187
+ readonly finalProof: Uint8Array;
188
+ /** Public inputs for the block proof */
189
+ readonly publicInputs: readonly string[];
190
+ /** Final state root after all transactions */
191
+ readonly stateRoot: string;
192
+ /** All idempotency keys (for exactly-once settlement) */
193
+ readonly idempotencyKeys: readonly string[];
194
+ /** Total transaction count (up to 8192) */
195
+ readonly txCount: number;
196
+ /** Block sequence number (monotonically increasing) */
197
+ readonly blockNumber: bigint;
198
+ /** Proof generation timestamp (Unix ms) */
199
+ readonly createdAt: number;
200
+ }
201
+ /**
202
+ * Status of an outbox entry in the settlement pipeline.
203
+ */
204
+ export type OutboxEntryStatus = "pending" | "processing" | "settled" | "failed";
205
+ /**
206
+ * An entry in the settlement outbox queue.
207
+ *
208
+ * Created after a Tier-2 block proof is generated.
209
+ * One entry per asset type per block proof.
210
+ */
211
+ export interface OutboxEntry {
212
+ /** Unique entry identifier (UUID v4) */
213
+ readonly entryId: string;
214
+ /** Block proof this entry settles */
215
+ readonly blockProofId: string;
216
+ /** Asset type for this settlement */
217
+ readonly assetType: AssetType;
218
+ /** Net transfers to execute (computed from block transactions) */
219
+ readonly netTransfers: readonly NetTransfer[];
220
+ /** Current settlement status */
221
+ readonly status: OutboxEntryStatus;
222
+ /** Number of retry attempts */
223
+ readonly retryCount: number;
224
+ /** Maximum retries before marking as failed */
225
+ readonly maxRetries: number;
226
+ /** Entry creation timestamp (Unix ms) */
227
+ readonly createdAt: number;
228
+ /** Settlement completion timestamp (Unix ms, null if not settled) */
229
+ readonly settledAt: number | null;
230
+ /** External settlement transaction ID (null if not settled) */
231
+ readonly settlementTxId: string | null;
232
+ /** Error message if failed */
233
+ readonly errorMessage: string | null;
234
+ /** Outbox offset for exactly-once consumption */
235
+ readonly offset: bigint;
236
+ }
237
+ /**
238
+ * A net transfer to an external address.
239
+ *
240
+ * Computed by netting all transactions in a block for a given address.
241
+ * Positive amount = credit, negative = debit.
242
+ */
243
+ export interface NetTransfer {
244
+ /** External address to transfer to/from */
245
+ readonly externalAddress: string;
246
+ /** Net amount (positive = credit, negative = debit) */
247
+ readonly netAmount: bigint;
248
+ }
249
+ /**
250
+ * Result of a Solana settlement transaction.
251
+ */
252
+ export interface SolanaSettlementResult {
253
+ /** Transaction signature (base58) */
254
+ readonly signature: string;
255
+ /** Slot number where transaction was confirmed */
256
+ readonly slot: number;
257
+ /** Address Lookup Table used for compression */
258
+ readonly lookupTableAddress: string;
259
+ /** Compute units consumed */
260
+ readonly computeUnits: number;
261
+ /** Fee paid (lamports) */
262
+ readonly fee: bigint;
263
+ /** Block proof commitment included in memo */
264
+ readonly proofCommitment: string;
265
+ }
266
+ /**
267
+ * Result of a Bitcoin settlement transaction.
268
+ */
269
+ export interface BitcoinSettlementResult {
270
+ /** Transaction ID (hex) */
271
+ readonly txid: string;
272
+ /** Signed PSBT (base64) for audit */
273
+ readonly psbtBase64: string;
274
+ /** UTXOs spent in this transaction */
275
+ readonly utxosSpent: readonly string[];
276
+ /** Total fee paid (satoshis) */
277
+ readonly fee: bigint;
278
+ /** OP_RETURN data with proof commitment */
279
+ readonly opReturnData: string;
280
+ /** Number of confirmations (at query time) */
281
+ readonly confirmations: number;
282
+ }
283
+ /**
284
+ * Result of a fiat settlement (mock ISO 20022).
285
+ */
286
+ export interface FiatSettlementResult {
287
+ /** ISO 20022 message ID */
288
+ readonly iso20022MessageId: string;
289
+ /** pain.001 credit transfer XML */
290
+ readonly pain001Xml: string;
291
+ /** Settlement date (ISO 8601) */
292
+ readonly settlementDate: string;
293
+ /** Total amount (cents) */
294
+ readonly totalAmount: bigint;
295
+ /** Number of transactions in batch */
296
+ readonly transactionCount: number;
297
+ }
298
+ /**
299
+ * An inbound deposit detected on an external chain.
300
+ */
301
+ export interface DepositEvent {
302
+ /** Unique event identifier */
303
+ readonly eventId: string;
304
+ /** Asset type */
305
+ readonly assetType: AssetType;
306
+ /** External address that received the deposit */
307
+ readonly externalAddress: string;
308
+ /** Amount deposited (atomic units) */
309
+ readonly amount: bigint;
310
+ /** External transaction ID */
311
+ readonly externalTxId: string;
312
+ /** Number of confirmations */
313
+ readonly confirmations: number;
314
+ /** Event detection timestamp (Unix ms) */
315
+ readonly detectedAt: number;
316
+ /** Whether this deposit has been mirrored to the ledger */
317
+ readonly mirrored: boolean;
318
+ }
319
+ /**
320
+ * Raft node state for HA cluster.
321
+ */
322
+ export type RaftState = "follower" | "candidate" | "leader";
323
+ /**
324
+ * Raft cluster node information.
325
+ */
326
+ export interface RaftNode {
327
+ /** Node identifier */
328
+ readonly nodeId: string;
329
+ /** Node state */
330
+ readonly state: RaftState;
331
+ /** Current term */
332
+ readonly term: bigint;
333
+ /** Voted for in current term (null if not voted) */
334
+ readonly votedFor: string | null;
335
+ /** Last log index */
336
+ readonly lastLogIndex: bigint;
337
+ /** Commit index */
338
+ readonly commitIndex: bigint;
339
+ /** Last heartbeat timestamp (Unix ms) */
340
+ readonly lastHeartbeat: number;
341
+ }
342
+ /**
343
+ * Audit record for compliance reporting.
344
+ */
345
+ export interface AuditRecord {
346
+ /** Unique record identifier */
347
+ readonly recordId: string;
348
+ /** Event type */
349
+ readonly eventType: "transaction_submitted" | "proof_generated" | "proof_aggregated" | "settlement_initiated" | "settlement_confirmed" | "settlement_failed";
350
+ /** Related entity ID (txId, proofId, entryId) */
351
+ readonly entityId: string;
352
+ /** Entity type */
353
+ readonly entityType: "transaction" | "base_proof" | "tier1_proof" | "tier2_proof" | "outbox_entry";
354
+ /** Actor who triggered the event (public key hash) */
355
+ readonly actor: string;
356
+ /** Event timestamp (Unix ms) */
357
+ readonly timestamp: number;
358
+ /** Additional event data */
359
+ readonly data: Readonly<Record<string, unknown>>;
360
+ /** SHA-256 hash of the previous audit record (chain integrity) */
361
+ readonly previousHash: string;
362
+ /** SHA-256 hash of this record */
363
+ readonly recordHash: string;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C;IACxB,iBAAiB;IACjB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,mBAAmB;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,qBAAqB;IACrB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mBAAmB;IACnB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAMD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iBAAiB;IACjB,QAAQ,CAAC,SAAS,EACd,uBAAuB,GACvB,iBAAiB,GACjB,kBAAkB,GAClB,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,CAAC;IACxB,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kBAAkB;IAClB,QAAQ,CAAC,UAAU,EACf,aAAa,GACb,YAAY,GACZ,aAAa,GACb,aAAa,GACb,cAAc,CAAC;IACnB,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,kEAAkE;IAClE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Domain Entities for Aggregated STARK Settlement Layer
3
+ *
4
+ * Core types representing the business domain:
5
+ * - Mirror accounts (custodial balances per asset/chain)
6
+ * - Ledger transactions (signed state transitions)
7
+ * - STARK proofs (3-tier recursive aggregation)
8
+ * - Outbox entries (pending settlements)
9
+ * - Settlement results (per-chain outcomes)
10
+ *
11
+ * All entities are immutable (readonly properties) following DDD patterns.
12
+ * No external SDK imports - pure domain types.
13
+ *
14
+ * @see skills/post-quantum-crypto.md for ML-DSA-65 signature context
15
+ * @see docs/adr/ADR-0001-hexagonal-architecture.md for design rationale
16
+ */
17
+ /**
18
+ * Standard asset configurations.
19
+ */
20
+ export const ASSET_CONFIGS = {
21
+ SOL: { type: "SOL", decimals: 9, name: "Solana", chainId: "solana-devnet" },
22
+ BTC: {
23
+ type: "BTC",
24
+ decimals: 8,
25
+ name: "Bitcoin",
26
+ chainId: "bitcoin-testnet",
27
+ },
28
+ USD: { type: "USD", decimals: 2, name: "US Dollar", chainId: "fiat-mock" },
29
+ };