tenzro-wallet 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -13,6 +13,8 @@ The official wallet for [Tenzro Network](https://tenzro.com) — a browser-clean
13
13
  - **EVM primitives, first-class** — EIP-7702 (Pectra Type-4) delegation, Permit2 SignatureTransfer with optional ERC-7683-witness binding, Secure-Mint registry (1:1 reserve invariant for tokenized RWAs), ERC-7683 cross-chain intents.
14
14
  - **Eight-vendor bridge router** — LI.FI, Chainlink CCIP, LayerZero V2, Wormhole, deBridge, Canton HTLC, Hyperlane V3 (sovereign Tenzro-ISM), Axelar GMP (Cosmos / Move / Stellar / XRPL). The kernel never picks a vendor for you; it surfaces all available quotes.
15
15
  - **Chain-agnostic discovery (CAIP)** — CAIP-2 / CAIP-10 / CAIP-19 per the submitted `tenzro` CASA namespace (`ChainAgnostic/namespaces#184`), so every dApp connect + agent handshake returns unambiguous chain + account + asset labels.
16
+ - **Babylon BTC-secured staking, surfaced.** Read-side surface for staking dashboards (list finality providers, sum BTC delegations, list delegations) plus validator-operator write paths so a validator host can use the wallet kernel as the EOTS signing surface.
17
+ - **Tenzro Train protocol port (Phase 4 Confidential-tier).** Read + write surface for the distributed-training protocol layer — inspect runs and sealed receipts, sign training task posts, enroll the wallet's identity as a trainer DID (with `ConfidentialEnrollment` carrying the TEE attestation that binds to the sealed-shard manifest), submit outer gradients, install sealed-shard manifests. Read-only mode is available for monitoring agents that should never mutate state.
16
18
 
17
19
  ## Install
18
20
 
@@ -89,6 +91,8 @@ Six independent surfaces (Tenzro native, EVM-on-Tenzro, SVM-on-Tenzro, Canton in
89
91
  | Capital + workflow ports | `CapitalIntentAdapter` (`open` / `quote` / `assign` / `execute` / `verify` / `compensate` / `settle` / `getIntent` + `submitReserveAttestation` / `getReserve` / `attestedMint`), `WorkflowAdapter` (`open` / `stepExecute` / `stepVerify` / `stepCompensate` / `finalize` / `getWorkflow` / `getSaga` / `getLifecycle` / `getReceipt` / `getOperationalMetrics` / `mirrorToCanton` / `verifyDidEnvelope` + listers). |
90
92
  | EVM-primitive ports | `Eip7702Adapter` (signing hash + designator helpers), `Permit2Adapter` (`domainSeparator` / `digest` / `verifyAndConsume` / `nonceUsed` with optional ERC-7683-witness binding), `SecureMintAdapter` (per-token 1:1 reserve invariant for tokenized RWAs), `Erc7683Adapter` (origin-side reads + destination-side fill commits). |
91
93
  | Discovery port | `CaipAdapter` — `caip2()` / `caip10(address)` / `caip19({ kind, token_id?, collection_id?, nft_token_id? })` per the submitted `tenzro` CASA namespace. |
94
+ | Shared-security port | `BabylonAdapter` — read surface for staking dashboards (`listFinalityProviders` / `totalStakeForProvider` / `listDelegations`) + validator-operator write paths (`registerFinalityProvider` / `submitFinalitySignature`) so a validator host can use the wallet kernel as the signing surface. |
95
+ | Distributed-training port | `TrainingAdapter(read[, write])` — read + write surface for the Tenzro Train protocol layer. Read methods inspect active runs, sealed receipts, and Confidential-tier sealed-shard manifests. Write methods (gated on a `TrainingClient`) post tasks, enroll trainers (with `ConfidentialEnrollment` for Phase 4 TEE-attested enrollment), submit outer gradients, finalize rounds, install sealed-shard manifests. |
92
96
  | Surfaces | `tenzroNativeSurface`, `evmOnTenzroSurface`, `svmOnTenzroSurface`, `cantonInternalSurface`, `cantonExternalSurface`, `cantonOnboardingSurface`. |
93
97
  | Router | `routeIntent()` — chooses the right surface (or bridge) for an intent and returns a typed plan. |
94
98
  | Balance aggregator | `BalanceAggregator` — single-pass cross-surface balance read. |
@@ -123,8 +127,9 @@ Testnet-functional today against the live Tenzro testnet at `rpc.tenzro.network`
123
127
  | M8 | Bridge router (six vendors) | Ports + six adapters shipped, SDK-pending |
124
128
  | M9 | TDIP integration (delegate sets, recovery flows) | Kernel orchestrators shipped |
125
129
  | M10 | Capital markets + workflows + EVM primitives + extended cross-chain reach + CAIP discovery | Ports + nine adapters shipped against `tenzro-sdk@^0.4.0` |
130
+ | M11 | Babylon Bitcoin staking + Tenzro Train protocol port (Phase 4 Confidential-tier) | Babylon port (read + validator-write surface) + Training port (`TrainingAdapter(read)` for monitoring, `TrainingAdapter(read, write)` for full custodial enrollment + sealed-shard manifest install) against `tenzro-sdk@^0.4.1` |
126
131
 
127
- **404 unit tests** pass; 5 env-gated integration smokes exercise the live testnet end-to-end.
132
+ **407 unit tests** pass; 5 env-gated integration smokes exercise the live testnet end-to-end.
128
133
 
129
134
  ## Repository
130
135
 
@@ -0,0 +1,17 @@
1
+ /**
2
+ * BabylonAdapter — `BabylonPort` backed by `tenzro-sdk` `BabylonClient`.
3
+ */
4
+ import type { BabylonClient } from 'tenzro-sdk';
5
+ import type { BabylonPort, BabylonTotalStake, BtcDelegation, FinalityProvider, RegisterFinalityProviderRequest, SubmitFinalitySignatureRequest } from './babylon.js';
6
+ export type BabylonClientLike = Pick<BabylonClient, 'registerFinalityProvider' | 'getFinalityProvider' | 'listFinalityProviders' | 'totalStakeForProvider' | 'submitFinalitySignature' | 'listDelegations'>;
7
+ export declare class BabylonAdapter implements BabylonPort {
8
+ private readonly client;
9
+ constructor(client: BabylonClientLike);
10
+ registerFinalityProvider(req: RegisterFinalityProviderRequest): Promise<FinalityProvider>;
11
+ getFinalityProvider(validator: string): Promise<FinalityProvider | null>;
12
+ listFinalityProviders(): Promise<FinalityProvider[]>;
13
+ totalStakeForProvider(validator: string): Promise<BabylonTotalStake>;
14
+ submitFinalitySignature(req: SubmitFinalitySignatureRequest): Promise<unknown>;
15
+ listDelegations(validator: string): Promise<BtcDelegation[]>;
16
+ }
17
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/ports/babylon/adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,aAAa,EACX,0BAA0B,GAC1B,qBAAqB,GACrB,uBAAuB,GACvB,uBAAuB,GACvB,yBAAyB,GACzB,iBAAiB,CACpB,CAAC;AAEF,qBAAa,cAAe,YAAW,WAAW;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,iBAAiB;IAEtD,wBAAwB,CACtB,GAAG,EAAE,+BAA+B,GACnC,OAAO,CAAC,gBAAgB,CAAC;IAG5B,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAGxE,qBAAqB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAGpD,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAGpE,uBAAuB,CAAC,GAAG,EAAE,8BAA8B,GAAG,OAAO,CAAC,OAAO,CAAC;IAG9E,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAG7D"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * BabylonAdapter — `BabylonPort` backed by `tenzro-sdk` `BabylonClient`.
3
+ */
4
+ export class BabylonAdapter {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ registerFinalityProvider(req) {
10
+ return this.client.registerFinalityProvider(req);
11
+ }
12
+ getFinalityProvider(validator) {
13
+ return this.client.getFinalityProvider(validator);
14
+ }
15
+ listFinalityProviders() {
16
+ return this.client.listFinalityProviders();
17
+ }
18
+ totalStakeForProvider(validator) {
19
+ return this.client.totalStakeForProvider(validator);
20
+ }
21
+ submitFinalitySignature(req) {
22
+ return this.client.submitFinalitySignature(req);
23
+ }
24
+ listDelegations(validator) {
25
+ return this.client.listDelegations(validator);
26
+ }
27
+ }
28
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/ports/babylon/adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAsBH,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IAE1D,wBAAwB,CACtB,GAAoC;QAEpC,OAAO,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,GAAY,CAA8B,CAAC;IACzF,CAAC;IACD,mBAAmB,CAAC,SAAiB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAqC,CAAC;IACxF,CAAC;IACD,qBAAqB;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAiC,CAAC;IAC5E,CAAC;IACD,qBAAqB,CAAC,SAAiB;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,SAAS,CAA+B,CAAC;IACpF,CAAC;IACD,uBAAuB,CAAC,GAAmC;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,GAAY,CAAC,CAAC;IAC3D,CAAC;IACD,eAAe,CAAC,SAAiB;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAA6B,CAAC;IAC5E,CAAC;CACF"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * BabylonPort — Babylon Bitcoin staking finality-providers protocol.
3
+ *
4
+ * Tenzro validators can opt into being economically secured by native
5
+ * BTC delegations through Babylon. Bitcoin holders delegate to a
6
+ * Tenzro validator (registered as a Babylon finality provider), and
7
+ * the validator must submit Extractable One-Time Signatures (EOTS)
8
+ * over Tenzro block hashes to avoid slashing of the delegated BTC.
9
+ *
10
+ * Wallet usage: read-side surface for staking dashboards (list
11
+ * providers, sum BTC delegations, list delegations for a provider).
12
+ * Write paths (`registerFinalityProvider`, `submitFinalitySignature`)
13
+ * are validator-operational and not user-facing in a typical wallet,
14
+ * but the port exposes them so a validator-operator host can use the
15
+ * wallet kernel as the signing surface.
16
+ */
17
+ export interface RegisterFinalityProviderRequest {
18
+ readonly validator: string;
19
+ /** 33-byte BTC public key (0x-prefixed hex). */
20
+ readonly btc_pk: string;
21
+ readonly commission_bps: number;
22
+ }
23
+ export interface FinalityProvider {
24
+ readonly validator: string;
25
+ readonly btc_pk: string;
26
+ readonly commission_bps: number;
27
+ readonly active: boolean;
28
+ }
29
+ export interface BabylonTotalStake {
30
+ readonly validator: string;
31
+ readonly total_satoshis: number;
32
+ readonly delegation_count: number;
33
+ }
34
+ export interface SubmitFinalitySignatureRequest {
35
+ readonly validator: string;
36
+ readonly block_hash: string;
37
+ /** EOTS signature over the block hash (0x-prefixed hex). */
38
+ readonly eots_signature: string;
39
+ }
40
+ export interface BtcDelegation {
41
+ readonly delegator_btc_pk: string;
42
+ readonly validator: string;
43
+ readonly satoshis: number;
44
+ readonly start_height: number;
45
+ readonly end_height?: number | null;
46
+ }
47
+ export interface BabylonPort {
48
+ registerFinalityProvider(req: RegisterFinalityProviderRequest): Promise<FinalityProvider>;
49
+ getFinalityProvider(validator: string): Promise<FinalityProvider | null>;
50
+ listFinalityProviders(): Promise<FinalityProvider[]>;
51
+ totalStakeForProvider(validator: string): Promise<BabylonTotalStake>;
52
+ submitFinalitySignature(req: SubmitFinalitySignatureRequest): Promise<unknown>;
53
+ listDelegations(validator: string): Promise<BtcDelegation[]>;
54
+ }
55
+ //# sourceMappingURL=babylon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"babylon.d.ts","sourceRoot":"","sources":["../../../src/ports/babylon/babylon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,MAA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O,CAAC,CAAC;IAC/E,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CAC9D"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * BabylonPort — Babylon Bitcoin staking finality-providers protocol.
3
+ *
4
+ * Tenzro validators can opt into being economically secured by native
5
+ * BTC delegations through Babylon. Bitcoin holders delegate to a
6
+ * Tenzro validator (registered as a Babylon finality provider), and
7
+ * the validator must submit Extractable One-Time Signatures (EOTS)
8
+ * over Tenzro block hashes to avoid slashing of the delegated BTC.
9
+ *
10
+ * Wallet usage: read-side surface for staking dashboards (list
11
+ * providers, sum BTC delegations, list delegations for a provider).
12
+ * Write paths (`registerFinalityProvider`, `submitFinalitySignature`)
13
+ * are validator-operational and not user-facing in a typical wallet,
14
+ * but the port exposes them so a validator-operator host can use the
15
+ * wallet kernel as the signing surface.
16
+ */
17
+ export {};
18
+ //# sourceMappingURL=babylon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"babylon.js","sourceRoot":"","sources":["../../../src/ports/babylon/babylon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
@@ -0,0 +1,4 @@
1
+ export type { BabylonPort, RegisterFinalityProviderRequest, FinalityProvider, BabylonTotalStake, SubmitFinalitySignatureRequest, BtcDelegation, } from './babylon.js';
2
+ export { BabylonAdapter } from './adapter.js';
3
+ export type { BabylonClientLike } from './adapter.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ports/babylon/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,+BAA+B,EAC/B,gBAAgB,EAChB,iBAAiB,EACjB,8BAA8B,EAC9B,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { BabylonAdapter } from "./adapter.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ports/babylon/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
@@ -24,4 +24,6 @@ export * from './hyperlane/index.js';
24
24
  export * from './axelar/index.js';
25
25
  export * from './erc7683/index.js';
26
26
  export * from './caip/index.js';
27
+ export * from './babylon/index.js';
28
+ export * from './training/index.js';
27
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,YAAY,GACb,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,G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,CAAC;AAGvB,YAAY,EACV,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAChG,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,YAAY,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAG1B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,mBAAmB,CAAC;AAKlC,cAAc,oBAAoB,CAAC;AAKnC,cAAc,qBAAqB,CAAC;AAKpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AAKvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAKnC,cAAc,iBAAiB,CAAC;AAMhC,cAAc,oBAAoB,CAAC;AAOnC,cAAc,qBAAqB,CAAC"}
@@ -32,4 +32,15 @@ export * from "./erc7683/index.js";
32
32
  // CAIP-2 / CAIP-10 / CAIP-19 per the submitted `tenzro` CASA namespace
33
33
  // (ChainAgnostic/namespaces#184).
34
34
  export * from "./caip/index.js";
35
+ // ── Babylon Bitcoin staking ports + adapter ──
36
+ // Read-side surface for staking dashboards; write paths exposed for
37
+ // validator-operator hosts that use the wallet kernel as the signing
38
+ // surface.
39
+ export * from "./babylon/index.js";
40
+ // ── Tenzro Train protocol ports + adapter ──
41
+ // Read + write surface for Tenzro Train Phase 4 (Confidential-tier
42
+ // sealed-shard pipelines). Constructed with `(read)` for monitoring
43
+ // agents, or `(read, write)` for full custodial enrollment +
44
+ // gradient submission flows.
45
+ export * from "./training/index.js";
35
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAG9E,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,YAAY,GACb,MAAM,eAAe,CAAC;AAyBvB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,8EAA8E;AAC9E,cAAc,kBAAkB,CAAC;AAEjC,qEAAqE;AACrE,cAAc,mBAAmB,CAAC;AAElC,yCAAyC;AACzC,uEAAuE;AACvE,yCAAyC;AACzC,cAAc,oBAAoB,CAAC;AAEnC,8CAA8C;AAC9C,iEAAiE;AACjE,wCAAwC;AACxC,cAAc,qBAAqB,CAAC;AAEpC,uCAAuC;AACvC,kEAAkE;AAClE,mEAAmE;AACnE,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AAEvC,oDAAoD;AACpD,mEAAmE;AACnE,mEAAmE;AACnE,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC,iDAAi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c,qBAAqB,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * TrainingAdapter — `TrainingPort` backed by `tenzro-sdk` clients.
3
+ *
4
+ * The SDK splits read and write into two classes for security
5
+ * (`TrainingInspectionClient` is safe to expose to monitoring agents
6
+ * that should never mutate state, while `TrainingClient` is the write
7
+ * surface). The wallet's port unifies them — the host can construct
8
+ * the adapter with either both, or just the read client when the
9
+ * wallet is in read-only / dashboard mode.
10
+ */
11
+ import type { TrainingClient, TrainingInspectionClient } from 'tenzro-sdk';
12
+ import type { ConfidentialEnrollment, SealedDatasetManifest, TrainingPort, TrainingReceipt, TrainingRun } from './training.js';
13
+ export type TrainingInspectionClientLike = Pick<TrainingInspectionClient, 'listRuns' | 'getRun' | 'getReceipt' | 'getSealedManifest'>;
14
+ export type TrainingWriteClientLike = Pick<TrainingClient, 'postTask' | 'enrollTrainer' | 'submitOuterGradient' | 'finalizeRound' | 'installSealedManifest'>;
15
+ /**
16
+ * Thrown when a write-side method is called on an adapter that was
17
+ * constructed without a write client. Lets read-only hosts use the
18
+ * same port type without paying for write-side wiring.
19
+ */
20
+ export declare class TrainingReadOnlyError extends Error {
21
+ constructor(method: string);
22
+ }
23
+ export declare class TrainingAdapter implements TrainingPort {
24
+ private readonly read;
25
+ private readonly write?;
26
+ constructor(read: TrainingInspectionClientLike, write?: TrainingWriteClientLike | undefined);
27
+ listRuns(): Promise<{
28
+ runs: readonly TrainingRun[];
29
+ }>;
30
+ getRun(taskId: string): Promise<TrainingRun>;
31
+ getReceipt(taskId: string): Promise<TrainingReceipt | null>;
32
+ getSealedManifest(taskId: string): Promise<SealedDatasetManifest | null>;
33
+ postTask(taskSpec: unknown): Promise<{
34
+ task_id: string;
35
+ }>;
36
+ enrollTrainer(taskId: string, trainerDid: string, confidential?: ConfidentialEnrollment): Promise<unknown>;
37
+ submitOuterGradient(taskId: string, gradient: unknown): Promise<unknown>;
38
+ finalizeRound(taskId: string, syncRound: unknown): Promise<unknown>;
39
+ installSealedManifest(taskId: string, manifest: SealedDatasetManifest): Promise<unknown>;
40
+ }
41
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/ports/training/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,wBAAwB,EACxB,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,mBAAmB,CAC3D,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,cAAc,EACZ,UAAU,GACV,eAAe,GACf,qBAAqB,GACrB,eAAe,GACf,uBAAuB,CAC1B,CAAC;AAEF;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,MAAM,EAAE,MAAM;CAI3B;AAED,qBAAa,eAAgB,YAAW,YAAY;IAEhD,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;gBADN,IAAI,EAAE,4BAA4B,EAClC,KAAK,CAAC,EAAE,uBAAuB,YAAA;IAKlD,QAAQ,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,SAAS,WAAW,EAAE,CAAA;KAAE,CAAC;IAGrD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAG5C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAG3D,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAMxE,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAIzD,aAAa,CACX,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,sBAAsB,GACpC,OAAO,CAAC,OAAO,CAAC;IAInB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAInE,qBAAqB,CACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC,OAAO,CAAC;CAIpB"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * TrainingAdapter — `TrainingPort` backed by `tenzro-sdk` clients.
3
+ *
4
+ * The SDK splits read and write into two classes for security
5
+ * (`TrainingInspectionClient` is safe to expose to monitoring agents
6
+ * that should never mutate state, while `TrainingClient` is the write
7
+ * surface). The wallet's port unifies them — the host can construct
8
+ * the adapter with either both, or just the read client when the
9
+ * wallet is in read-only / dashboard mode.
10
+ */
11
+ /**
12
+ * Thrown when a write-side method is called on an adapter that was
13
+ * constructed without a write client. Lets read-only hosts use the
14
+ * same port type without paying for write-side wiring.
15
+ */
16
+ export class TrainingReadOnlyError extends Error {
17
+ constructor(method) {
18
+ super(`TrainingAdapter is read-only: ${method} requires a TrainingClient`);
19
+ this.name = 'TrainingReadOnlyError';
20
+ }
21
+ }
22
+ export class TrainingAdapter {
23
+ read;
24
+ write;
25
+ constructor(read, write) {
26
+ this.read = read;
27
+ this.write = write;
28
+ }
29
+ // ── Read side ──
30
+ listRuns() {
31
+ return this.read.listRuns();
32
+ }
33
+ getRun(taskId) {
34
+ return this.read.getRun(taskId);
35
+ }
36
+ getReceipt(taskId) {
37
+ return this.read.getReceipt(taskId);
38
+ }
39
+ getSealedManifest(taskId) {
40
+ return this.read.getSealedManifest(taskId);
41
+ }
42
+ // ── Write side ──
43
+ postTask(taskSpec) {
44
+ if (!this.write)
45
+ throw new TrainingReadOnlyError('postTask');
46
+ return this.write.postTask(taskSpec);
47
+ }
48
+ enrollTrainer(taskId, trainerDid, confidential) {
49
+ if (!this.write)
50
+ throw new TrainingReadOnlyError('enrollTrainer');
51
+ return this.write.enrollTrainer(taskId, trainerDid, confidential);
52
+ }
53
+ submitOuterGradient(taskId, gradient) {
54
+ if (!this.write)
55
+ throw new TrainingReadOnlyError('submitOuterGradient');
56
+ return this.write.submitOuterGradient(taskId, gradient);
57
+ }
58
+ finalizeRound(taskId, syncRound) {
59
+ if (!this.write)
60
+ throw new TrainingReadOnlyError('finalizeRound');
61
+ return this.write.finalizeRound(taskId, syncRound);
62
+ }
63
+ installSealedManifest(taskId, manifest) {
64
+ if (!this.write)
65
+ throw new TrainingReadOnlyError('installSealedManifest');
66
+ return this.write.installSealedManifest(taskId, manifest);
67
+ }
68
+ }
69
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/ports/training/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyBH;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,MAAc;QACxB,KAAK,CAAC,iCAAiC,MAAM,4BAA4B,CAAC,CAAC;QAC3E,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED,MAAM,OAAO,eAAe;IAEP;IACA;IAFnB,YACmB,IAAkC,EAClC,KAA+B;QAD/B,SAAI,GAAJ,IAAI,CAA8B;QAClC,UAAK,GAAL,KAAK,CAA0B;IAC/C,CAAC;IAEJ,kBAAkB;IAElB,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAA+C,CAAC;IAC3E,CAAC;IACD,MAAM,CAAC,MAAc;QACnB,OAAO,IAAI,CAAC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E,MAAM,IAAI,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;QAC1E,OAAO,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAiB,CAAC,CAAC;IACrE,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export type { TrainingPort, TrainingRun, TrainingRunStatus, TrainingReceipt, SealedShardEnvelope, SealedDatasetManifest, ConfidentialEnrollment, } from './training.js';
2
+ export { TrainingAdapter, TrainingReadOnlyError } from './adapter.js';
3
+ export type { TrainingInspectionClientLike, TrainingWriteClientLike, } from './adapter.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ports/training/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EACV,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { TrainingAdapter, TrainingReadOnlyError } from "./adapter.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ports/training/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * TrainingPort — Tenzro Train protocol surface.
3
+ *
4
+ * Tenzro Train splits cleanly into two layers — a Rust protocol layer
5
+ * (syncers, aggregation, witness committees, receipts) and a Python
6
+ * reference trainer for the inner training loop. The wallet port
7
+ * exposes the protocol layer's read + write RPCs so a wallet can:
8
+ *
9
+ * - Inspect active runs and sealed receipts for runs the user
10
+ * sponsors or participates in.
11
+ * - Sign training task posts ("I authorize spending X TNZO to
12
+ * sponsor this run with this aggregator config") as a regular
13
+ * payment-class action.
14
+ * - Enroll the wallet's identity as a trainer DID into a run,
15
+ * including Confidential-tier enrollments that bind a TEE
16
+ * attestation to the sealed-shard manifest.
17
+ * - Surface sealed-shard manifests for inspection (Confidential
18
+ * tier) — the wallet never sees the plaintext shards, only the
19
+ * HPKE-wrapped envelopes and enclave measurements.
20
+ *
21
+ * Phase 4 (Confidential-tier sealed-shard pipelines) is fully wired
22
+ * through this port; see `ConfidentialEnrollment` for the
23
+ * attestation-binding shape.
24
+ */
25
+ export type TrainingRunStatus = 'Pending' | 'Active' | 'Completed' | 'Failed' | 'Cancelled';
26
+ export interface TrainingRun {
27
+ readonly task_id: string;
28
+ readonly task_spec: unknown;
29
+ readonly status: TrainingRunStatus;
30
+ readonly current_round: number;
31
+ readonly state_root: string;
32
+ readonly enrolled_trainers: readonly string[];
33
+ readonly created_at_ms: number;
34
+ readonly updated_at_ms: number;
35
+ readonly receipt?: unknown;
36
+ readonly metadata?: Record<string, unknown>;
37
+ }
38
+ export interface TrainingReceipt {
39
+ readonly task_id: string;
40
+ readonly final_state_root: string;
41
+ readonly rounds_completed: number;
42
+ readonly witness_committees: readonly unknown[];
43
+ readonly manifest_hash?: string;
44
+ readonly sealed_at_ms: number;
45
+ }
46
+ export interface SealedShardEnvelope {
47
+ readonly trainer_did: string;
48
+ readonly shard_index: number;
49
+ readonly shard_ciphertext_hash: string;
50
+ readonly shard_ciphertext_bytes: number;
51
+ readonly wrapped_data_key: string;
52
+ /** Always `"hpke-x25519-hkdf-sha256-aes-256-gcm"`. */
53
+ readonly wrap_alg: string;
54
+ readonly enclave_pubkey: string;
55
+ readonly enclave_measurements_hex: string;
56
+ readonly created_at_ms: number;
57
+ }
58
+ export interface SealedDatasetManifest {
59
+ readonly task_id: string;
60
+ readonly manifest_hash: string;
61
+ readonly envelopes: readonly SealedShardEnvelope[];
62
+ readonly created_at_ms: number;
63
+ }
64
+ /**
65
+ * Confidential-tier enrollment payload — required when enrolling
66
+ * into a task that has a sealed-shard manifest installed. The
67
+ * attestation proves the trainer is running inside a TEE enclave
68
+ * whose pubkey + measurements were sealed into the manifest.
69
+ */
70
+ export interface ConfidentialEnrollment {
71
+ readonly attestation: string;
72
+ readonly enclave_pubkey: string;
73
+ readonly measurements_hex: string;
74
+ }
75
+ export interface TrainingPort {
76
+ listRuns(): Promise<{
77
+ runs: readonly TrainingRun[];
78
+ }>;
79
+ getRun(taskId: string): Promise<TrainingRun>;
80
+ getReceipt(taskId: string): Promise<TrainingReceipt | null>;
81
+ getSealedManifest(taskId: string): Promise<SealedDatasetManifest | null>;
82
+ postTask(taskSpec: unknown): Promise<{
83
+ task_id: string;
84
+ }>;
85
+ enrollTrainer(taskId: string, trainerDid: string, confidential?: ConfidentialEnrollment): Promise<unknown>;
86
+ submitOuterGradient(taskId: string, gradient: unknown): Promise<unknown>;
87
+ finalizeRound(taskId: string, syncRound: unknown): Promise<unknown>;
88
+ installSealedManifest(taskId: string, manifest: SealedDatasetManifest): Promise<unknown>;
89
+ }
90
+ //# sourceMappingURL=training.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"training.d.ts","sourceRoot":"","sources":["../../../src/ports/training/training.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,WAAW,CAAC;AAEhB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,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;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,YAAY;IAE3B,QAAQ,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,SAAS,WAAW,EAAE,CAAA;KAAE,CAAC,CAAC;IACtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAC5D,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;IAGzE,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,aAAa,CACX,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,sBAAsB,GACpC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpE,qBAAqB,CACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAAC;CACrB"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * TrainingPort — Tenzro Train protocol surface.
3
+ *
4
+ * Tenzro Train splits cleanly into two layers — a Rust protocol layer
5
+ * (syncers, aggregation, witness committees, receipts) and a Python
6
+ * reference trainer for the inner training loop. The wallet port
7
+ * exposes the protocol layer's read + write RPCs so a wallet can:
8
+ *
9
+ * - Inspect active runs and sealed receipts for runs the user
10
+ * sponsors or participates in.
11
+ * - Sign training task posts ("I authorize spending X TNZO to
12
+ * sponsor this run with this aggregator config") as a regular
13
+ * payment-class action.
14
+ * - Enroll the wallet's identity as a trainer DID into a run,
15
+ * including Confidential-tier enrollments that bind a TEE
16
+ * attestation to the sealed-shard manifest.
17
+ * - Surface sealed-shard manifests for inspection (Confidential
18
+ * tier) — the wallet never sees the plaintext shards, only the
19
+ * HPKE-wrapped envelopes and enclave measurements.
20
+ *
21
+ * Phase 4 (Confidential-tier sealed-shard pipelines) is fully wired
22
+ * through this port; see `ConfidentialEnrollment` for the
23
+ * attestation-binding shape.
24
+ */
25
+ export {};
26
+ //# sourceMappingURL=training.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"training.js","sourceRoot":"","sources":["../../../src/ports/training/training.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tenzro-wallet",
3
- "version": "0.2.0",
4
- "description": "Tenzro Wallet kernel — one identity, four VM surfaces (Tenzro native, EVM, SVM, Canton). Passkey-quorum custody, post-quantum signing, agent-payment ports, capital intents + multi-party workflows, EVM primitives (EIP-7702 / Permit2 / Secure-Mint / ERC-7683), eight-vendor bridge router, CAIP discovery.",
3
+ "version": "0.2.1",
4
+ "description": "Tenzro Wallet kernel — one identity, four VM surfaces (Tenzro native, EVM, SVM, Canton). Passkey-quorum custody, post-quantum signing, agent-payment ports, capital intents + multi-party workflows, EVM primitives (EIP-7702 / Permit2 / Secure-Mint / ERC-7683), eight-vendor bridge router, CAIP discovery, Babylon Bitcoin staking, Tenzro Train protocol port (Phase 4 Confidential-tier).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "prepublishOnly": "pnpm build"
32
32
  },
33
33
  "dependencies": {
34
- "tenzro-sdk": "^0.4.0"
34
+ "tenzro-sdk": "^0.4.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "22.10.5",
@@ -79,7 +79,11 @@
79
79
  "debridge",
80
80
  "lifi",
81
81
  "hyperlane",
82
- "axelar"
82
+ "axelar",
83
+ "babylon",
84
+ "bitcoin-staking",
85
+ "tenzro-train",
86
+ "confidential-compute"
83
87
  ],
84
88
  "author": "Tenzro <eng@tenzro.com>",
85
89
  "license": "Apache-2.0",