Skip to content

Commit 72d1f52

Browse files
authored
Merge pull request #45 from mpcp-protocol/docs/trust-bundle-roadmap
docs(roadmap): add PR29 — Trust Bundle
2 parents 894fdbe + 13de3f3 commit 72d1f52

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

ROADMAP.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,67 @@ Implements: protocol verification engine, artifact schemas, cryptographic signin
9090
| PR26 | Human-to-Agent Delegation Profile (`revocationEndpoint`, `allowedPurposes`, TRIP scope, `checkRevocation()`) ||
9191
| PR27 | On-Chain Policy Anchoring (`anchorRef`, `resolveXrplDid`, `hederaHcsAnchorPolicyDocument`, `checkXrplNftRevocation`) ||
9292
| PR28 | Encrypted Policy Anchoring (`submitMode`, AES-256-GCM via `crypto.subtle`, `PolicyDocumentCustody`, XRPL IPFS prep) ||
93+
| PR29 | Trust Bundle — types, signing, verification, and key resolution integration | pending |
94+
95+
---
96+
97+
## PR29 — Trust Bundle
98+
99+
Implement the [Trust Bundle](https://mpcp-protocol.github.io/spec/protocol/trust-bundles/) specification as defined in the MPCP spec.
100+
101+
Trust Bundles are pre-distributed signed documents that package trusted issuer public keys for MPCP verifiers operating without network access at verification time.
102+
103+
### New types (`src/protocol/trustBundle.ts`)
104+
105+
```typescript
106+
export interface TrustBundleIssuerEntry {
107+
issuer: string;
108+
keys: JsonWebKey[];
109+
}
110+
111+
export interface TrustBundle {
112+
version: "1.0";
113+
bundleId: string;
114+
bundleIssuer: string;
115+
bundleKeyId: string;
116+
category: string;
117+
geography?: { region?: string; countryCodes?: string[] };
118+
approvedIssuers: string[];
119+
issuers: TrustBundleIssuerEntry[];
120+
expiresAt: string;
121+
signature: string;
122+
}
123+
```
124+
125+
### New functions
126+
127+
- `signTrustBundle(bundleWithoutSig, privateKeyPem)` — constructs canonical payload (`"MPCP:TrustBundle:1.0:" + canonicalJson(bundle)`), signs with Ed25519 or ECDSA P-256, returns signed bundle
128+
- `verifyTrustBundle(bundle, rootPublicKeyPem)` — verifies the bundle's own signature and expiry before use; returns `{ valid: true }` or `{ valid: false; reason: string }`
129+
- `resolveFromTrustBundle(issuer, issuerKeyId, bundles)` — step-1 key resolution; searches non-expired loaded bundles in descending `expiresAt` order; returns matching JWK or `null`
130+
131+
### Key resolution integration
132+
133+
`verifySignedBudgetAuthorization`, `verifyPolicyGrant`, and related verifiers gain an optional `trustBundles?: TrustBundle[]` parameter. When provided, key resolution checks bundles before falling back to HTTPS well-known and DID resolution (per the 3-step algorithm in the spec).
134+
135+
### Exports
136+
137+
All three functions flat-exported from `src/sdk/index.ts`, consistent with existing SDK exports (`checkRevocation`, `resolveXrplDid`, etc.).
138+
139+
### Tests
140+
141+
- `signTrustBundle` + `verifyTrustBundle` roundtrip
142+
- Expired bundle rejected by `verifyTrustBundle`
143+
- Tampered bundle signature rejected
144+
- `resolveFromTrustBundle` returns correct key from matching non-expired bundle
145+
- `resolveFromTrustBundle` skips expired bundles; falls through to `null`
146+
- `resolveFromTrustBundle` prefers bundle with latest `expiresAt` when multiple match
147+
- `verifySignedBudgetAuthorization` resolves signing key from Trust Bundle when `trustBundles` provided (no env var needed)
148+
149+
### Deliverables
150+
151+
- `src/protocol/trustBundle.ts`
152+
- `src/sdk/index.ts` updated
153+
- `test/protocol/trustBundle.test.ts`
93154

94155
---
95156

0 commit comments

Comments
 (0)