sealbridge 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +43 -0
- package/README.ja.md +397 -0
- package/README.md +567 -1
- package/dist/cli/dist/acp.d.ts +2 -0
- package/dist/cli/dist/acp.js +6 -0
- package/dist/cli/dist/acp.js.map +1 -0
- package/dist/cli/dist/approval-summary.d.ts +2 -0
- package/dist/cli/dist/approval-summary.js +32 -0
- package/dist/cli/dist/approval-summary.js.map +1 -0
- package/dist/cli/dist/board.d.ts +47 -0
- package/dist/cli/dist/board.js +255 -0
- package/dist/cli/dist/board.js.map +1 -0
- package/dist/cli/dist/contacts.d.ts +18 -0
- package/dist/cli/dist/contacts.js +154 -0
- package/dist/cli/dist/contacts.js.map +1 -0
- package/dist/cli/dist/doctor.d.ts +13 -0
- package/dist/cli/dist/doctor.js +30 -0
- package/dist/cli/dist/doctor.js.map +1 -0
- package/dist/cli/dist/error-messages.d.ts +2 -0
- package/dist/cli/dist/error-messages.js +24 -0
- package/dist/cli/dist/error-messages.js.map +1 -0
- package/dist/cli/dist/index.d.ts +2 -0
- package/dist/cli/dist/index.js +194 -0
- package/dist/cli/dist/index.js.map +1 -0
- package/dist/cli/dist/invite-share.d.ts +16 -0
- package/dist/cli/dist/invite-share.js +163 -0
- package/dist/cli/dist/invite-share.js.map +1 -0
- package/dist/cli/dist/mcp.d.ts +17 -0
- package/dist/cli/dist/mcp.js +105 -0
- package/dist/cli/dist/mcp.js.map +1 -0
- package/dist/cli/dist/network.d.ts +1 -0
- package/dist/cli/dist/network.js +396 -0
- package/dist/cli/dist/network.js.map +1 -0
- package/dist/cli/dist/public-settings.d.ts +27 -0
- package/dist/cli/dist/public-settings.js +33 -0
- package/dist/cli/dist/public-settings.js.map +1 -0
- package/dist/cli/dist/receipt.d.ts +39 -0
- package/dist/cli/dist/receipt.js +90 -0
- package/dist/cli/dist/receipt.js.map +1 -0
- package/dist/cli/dist/receive-hook.d.ts +2 -0
- package/dist/cli/dist/receive-hook.js +35 -0
- package/dist/cli/dist/receive-hook.js.map +1 -0
- package/dist/cli/dist/task-input.d.ts +2 -0
- package/dist/cli/dist/task-input.js +19 -0
- package/dist/cli/dist/task-input.js.map +1 -0
- package/dist/cli/dist/wake-hook.d.ts +3 -0
- package/dist/cli/dist/wake-hook.js +32 -0
- package/dist/cli/dist/wake-hook.js.map +1 -0
- package/dist/examples/two-owner-demo/alice-policy.json +4 -0
- package/dist/examples/two-owner-demo/bob-policy.json +4 -0
- package/dist/examples/two-owner-demo/dist/run-demo.d.ts +71 -0
- package/dist/examples/two-owner-demo/dist/run-demo.js +383 -0
- package/dist/examples/two-owner-demo/dist/run-demo.js.map +1 -0
- package/dist/package.json +1 -0
- package/dist/packages/adapters/dist/command.d.ts +122 -0
- package/dist/packages/adapters/dist/command.js +378 -0
- package/dist/packages/adapters/dist/command.js.map +1 -0
- package/dist/packages/adapters/dist/credential-proxy.d.ts +37 -0
- package/dist/packages/adapters/dist/credential-proxy.js +363 -0
- package/dist/packages/adapters/dist/credential-proxy.js.map +1 -0
- package/dist/packages/adapters/dist/index.d.ts +6 -0
- package/dist/packages/adapters/dist/index.js +6 -0
- package/dist/packages/adapters/dist/index.js.map +1 -0
- package/dist/packages/adapters/dist/mcp.d.ts +32 -0
- package/dist/packages/adapters/dist/mcp.js +87 -0
- package/dist/packages/adapters/dist/mcp.js.map +1 -0
- package/dist/packages/adapters/dist/openai.d.ts +23 -0
- package/dist/packages/adapters/dist/openai.js +81 -0
- package/dist/packages/adapters/dist/openai.js.map +1 -0
- package/dist/packages/adapters/dist/sandbox.d.ts +45 -0
- package/dist/packages/adapters/dist/sandbox.js +60 -0
- package/dist/packages/adapters/dist/sandbox.js.map +1 -0
- package/dist/packages/core/dist/capability.d.ts +36 -0
- package/dist/packages/core/dist/capability.js +203 -0
- package/dist/packages/core/dist/capability.js.map +1 -0
- package/dist/packages/core/dist/contract.d.ts +33 -0
- package/dist/packages/core/dist/contract.js +97 -0
- package/dist/packages/core/dist/contract.js.map +1 -0
- package/dist/packages/core/dist/crypto.d.ts +34 -0
- package/dist/packages/core/dist/crypto.js +329 -0
- package/dist/packages/core/dist/crypto.js.map +1 -0
- package/dist/packages/core/dist/discovery.d.ts +129 -0
- package/dist/packages/core/dist/discovery.js +527 -0
- package/dist/packages/core/dist/discovery.js.map +1 -0
- package/dist/packages/core/dist/edge.d.ts +4 -0
- package/dist/packages/core/dist/edge.js +6 -0
- package/dist/packages/core/dist/edge.js.map +1 -0
- package/dist/packages/core/dist/index.d.ts +9 -0
- package/dist/packages/core/dist/index.js +10 -0
- package/dist/packages/core/dist/index.js.map +1 -0
- package/dist/packages/core/dist/receipts.d.ts +9 -0
- package/dist/packages/core/dist/receipts.js +67 -0
- package/dist/packages/core/dist/receipts.js.map +1 -0
- package/dist/packages/core/dist/relay-auth.d.ts +40 -0
- package/dist/packages/core/dist/relay-auth.js +106 -0
- package/dist/packages/core/dist/relay-auth.js.map +1 -0
- package/dist/packages/core/dist/revocation.d.ts +58 -0
- package/dist/packages/core/dist/revocation.js +112 -0
- package/dist/packages/core/dist/revocation.js.map +1 -0
- package/dist/packages/core/dist/schema.d.ts +11 -0
- package/dist/packages/core/dist/schema.js +48 -0
- package/dist/packages/core/dist/schema.js.map +1 -0
- package/dist/packages/core/dist/types.d.ts +172 -0
- package/dist/packages/core/dist/types.js +2 -0
- package/dist/packages/core/dist/types.js.map +1 -0
- package/dist/packages/ledger/dist/index.d.ts +84 -0
- package/dist/packages/ledger/dist/index.js +269 -0
- package/dist/packages/ledger/dist/index.js.map +1 -0
- package/dist/packages/relay/dist/fetch.d.ts +250 -0
- package/dist/packages/relay/dist/fetch.js +1401 -0
- package/dist/packages/relay/dist/fetch.js.map +1 -0
- package/dist/packages/relay/dist/index.d.ts +103 -0
- package/dist/packages/relay/dist/index.js +855 -0
- package/dist/packages/relay/dist/index.js.map +1 -0
- package/dist/packages/relay/dist/journal.d.ts +77 -0
- package/dist/packages/relay/dist/journal.js +339 -0
- package/dist/packages/relay/dist/journal.js.map +1 -0
- package/dist/packages/relay/dist/notifications.d.ts +63 -0
- package/dist/packages/relay/dist/notifications.js +55 -0
- package/dist/packages/relay/dist/notifications.js.map +1 -0
- package/dist/packages/relay/dist/retry.d.ts +12 -0
- package/dist/packages/relay/dist/retry.js +59 -0
- package/dist/packages/relay/dist/retry.js.map +1 -0
- package/dist/packages/relay/dist/ssrf.d.ts +32 -0
- package/dist/packages/relay/dist/ssrf.js +213 -0
- package/dist/packages/relay/dist/ssrf.js.map +1 -0
- package/dist/packages/relay/dist/worker.d.ts +92 -0
- package/dist/packages/relay/dist/worker.js +460 -0
- package/dist/packages/relay/dist/worker.js.map +1 -0
- package/dist/packages/runtime/dist/a2a.d.ts +8 -0
- package/dist/packages/runtime/dist/a2a.js +69 -0
- package/dist/packages/runtime/dist/a2a.js.map +1 -0
- package/dist/packages/runtime/dist/adapter.d.ts +51 -0
- package/dist/packages/runtime/dist/adapter.js +2 -0
- package/dist/packages/runtime/dist/adapter.js.map +1 -0
- package/dist/packages/runtime/dist/approval-providers.d.ts +99 -0
- package/dist/packages/runtime/dist/approval-providers.js +269 -0
- package/dist/packages/runtime/dist/approval-providers.js.map +1 -0
- package/dist/packages/runtime/dist/daily-limit.d.ts +2 -0
- package/dist/packages/runtime/dist/daily-limit.js +54 -0
- package/dist/packages/runtime/dist/daily-limit.js.map +1 -0
- package/dist/packages/runtime/dist/gateway.d.ts +35 -0
- package/dist/packages/runtime/dist/gateway.js +92 -0
- package/dist/packages/runtime/dist/gateway.js.map +1 -0
- package/dist/packages/runtime/dist/inbox.d.ts +10 -0
- package/dist/packages/runtime/dist/inbox.js +24 -0
- package/dist/packages/runtime/dist/inbox.js.map +1 -0
- package/dist/packages/runtime/dist/index.d.ts +13 -0
- package/dist/packages/runtime/dist/index.js +14 -0
- package/dist/packages/runtime/dist/index.js.map +1 -0
- package/dist/packages/runtime/dist/mcp-server.d.ts +90 -0
- package/dist/packages/runtime/dist/mcp-server.js +647 -0
- package/dist/packages/runtime/dist/mcp-server.js.map +1 -0
- package/dist/packages/runtime/dist/mcp-tool-catalog.d.ts +3 -0
- package/dist/packages/runtime/dist/mcp-tool-catalog.js +507 -0
- package/dist/packages/runtime/dist/mcp-tool-catalog.js.map +1 -0
- package/dist/packages/runtime/dist/mcp.d.ts +73 -0
- package/dist/packages/runtime/dist/mcp.js +67 -0
- package/dist/packages/runtime/dist/mcp.js.map +1 -0
- package/dist/packages/runtime/dist/policy.d.ts +19 -0
- package/dist/packages/runtime/dist/policy.js +41 -0
- package/dist/packages/runtime/dist/policy.js.map +1 -0
- package/dist/packages/runtime/dist/quota.d.ts +39 -0
- package/dist/packages/runtime/dist/quota.js +147 -0
- package/dist/packages/runtime/dist/quota.js.map +1 -0
- package/dist/packages/runtime/dist/session-audit.d.ts +107 -0
- package/dist/packages/runtime/dist/session-audit.js +520 -0
- package/dist/packages/runtime/dist/session-audit.js.map +1 -0
- package/dist/packages/runtime/dist/session-timeouts.d.ts +33 -0
- package/dist/packages/runtime/dist/session-timeouts.js +62 -0
- package/dist/packages/runtime/dist/session-timeouts.js.map +1 -0
- package/dist/packages/runtime/dist/session.d.ts +323 -0
- package/dist/packages/runtime/dist/session.js +2252 -0
- package/dist/packages/runtime/dist/session.js.map +1 -0
- package/dist/packages/runtime/dist/task-journal.d.ts +36 -0
- package/dist/packages/runtime/dist/task-journal.js +104 -0
- package/dist/packages/runtime/dist/task-journal.js.map +1 -0
- package/dist/packages/runtime/dist/verifier.d.ts +64 -0
- package/dist/packages/runtime/dist/verifier.js +109 -0
- package/dist/packages/runtime/dist/verifier.js.map +1 -0
- package/dist/packages/sandbox/dist/container.d.ts +33 -0
- package/dist/packages/sandbox/dist/container.js +189 -0
- package/dist/packages/sandbox/dist/container.js.map +1 -0
- package/dist/packages/sandbox/dist/index.d.ts +34 -0
- package/dist/packages/sandbox/dist/index.js +179 -0
- package/dist/packages/sandbox/dist/index.js.map +1 -0
- package/dist/packages/sandbox/dist/permission.d.ts +58 -0
- package/dist/packages/sandbox/dist/permission.js +90 -0
- package/dist/packages/sandbox/dist/permission.js.map +1 -0
- package/dist/spec/README.ja.md +76 -0
- package/dist/spec/README.md +135 -0
- package/dist/spec/ack-receipt.schema.json +77 -0
- package/dist/spec/agent-card.schema.json +83 -0
- package/dist/spec/approval-receipt.schema.json +94 -0
- package/dist/spec/audit-entry.schema.json +101 -0
- package/dist/spec/capability-token.schema.json +133 -0
- package/dist/spec/envelope.schema.json +197 -0
- package/dist/spec/examples/sample-ack-receipt.json +16 -0
- package/dist/spec/examples/sample-agent-card.json +35 -0
- package/dist/spec/examples/sample-approval-receipt.json +18 -0
- package/dist/spec/examples/sample-audit-entry.json +37 -0
- package/dist/spec/examples/sample-capability-token.json +39 -0
- package/dist/spec/examples/sample-envelope.json +21 -0
- package/dist/spec/examples/sample-task-manifest.json +141 -0
- package/dist/spec/examples/sample-usage-receipt.json +19 -0
- package/dist/spec/task-manifest.schema.json +422 -0
- package/dist/spec/usage-receipt.schema.json +91 -0
- package/package.json +61 -5
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Sealbridge Protocol Specification (`spec/`)
|
|
2
|
+
|
|
3
|
+
[English (README.md)](./README.md) | **日本語**
|
|
4
|
+
|
|
5
|
+
**結論**: 本ディレクトリはプログラミング言語に依存しないプロトコル仕様と JSON Schema (Draft 2020-12) の正本(Single Source of Truth)を定義する。すべてのプロトコルオブジェクトは **RFC 8785 (JCS: JSON Canonicalization Scheme)** で正規化されたバイト列に対して **SHA-256 ダイジェスト** と **Ed25519 署名** を計算する。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. 共通暗号・シリアライズ規則
|
|
10
|
+
|
|
11
|
+
1. **エンコーディング**: UTF-8 JSON(I-JSON サブセット準拠、浮動小数点の誤差を避けるため金額・トークン数・秒数はすべて整数 `integer` で表現する)。
|
|
12
|
+
2. **正規化(Canonicalization)**: 署名およびハッシュ計算の対象となるJSONオブジェクトは、[RFC 8785 (JCS)](https://www.rfc-editor.org/info/rfc8785/) に従ってキーを辞書順ソートし空白を除去した決定論的バイト列に変換する。
|
|
13
|
+
3. **識別子(Principal ID)**: オーナーおよびエージェントの識別子は W3C `did:key` 形式(Ed25519公開鍵のMultibase base58btcエンコード、例: `did:key:z6Mk...`)を使用する。
|
|
14
|
+
4. **ダイジェスト表記**: `"sha256:<64文字の16進小文字>"`(例: `"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"`)。
|
|
15
|
+
5. **署名表記**: `"ed25519:<base64urlまたは128文字の16進小文字>"`。署名計算時は対象オブジェクトから `signature` / `signatures` フィールドを除いた状態でJCS正規化を行う。
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 2. コアスキーマ一覧
|
|
20
|
+
|
|
21
|
+
| ファイル名 | ステータス | 役割 |
|
|
22
|
+
| :--------------------------------------------------------- | :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
23
|
+
| [`task-manifest.schema.json`](./task-manifest.schema.json) | **Draft v0.1 (検証済)** | 依頼側(Requester)が提示するタスク仕様・入出力JSON Schema・受入基準・検証方法・予算上限・付与Capability・隔離要件の定義 |
|
|
24
|
+
| `capability-token.schema.json` | Planned (M0) | UCAN/Biscuit風の減衰可能スコープトークン定義(`issuer`, `audience`, `taskId`, `resources`, `allowedTools`, `argConstraints`, `maxInvocations`, `maxDelegationDepth`, `proofs`) |
|
|
25
|
+
| `envelope.schema.json` | Planned (M0) | Relay通過用の署名付きメッセージエンベロープ(`envelopeId`, `taskId`, `seq`, `eventType`, `senderDid`, `recipientDid`, `payload`, `signature`)および受領確認 `AckReceipt` |
|
|
26
|
+
| `audit-entry.schema.json` | Planned (M0) | 双方向署名ハッシュチェーン台帳エントリおよび `UsageReceipt` / `ApprovalReceipt` |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 3. スキーマ検証コマンド
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx --yes -p ajv-cli@5 -p ajv-formats@3 ajv validate \
|
|
34
|
+
--spec=draft2020 \
|
|
35
|
+
-c ajv-formats \
|
|
36
|
+
-s spec/task-manifest.schema.json \
|
|
37
|
+
-d spec/examples/sample-task-manifest.json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## M0–M1 実行可能なワイヤプロファイル
|
|
41
|
+
|
|
42
|
+
新しい `capability-token`、`usage-receipt`、`approval-receipt`、`ack-receipt`、`envelope`、`audit-entry` のスキーマは実装済みです。`pnpm validate:schemas` を実行すると、Ajv Draft 2020-12 で全スキーマをコンパイルし、すべてのサンプルを検証します。元の TaskManifest スキーマとサンプルは変更していません。
|
|
43
|
+
|
|
44
|
+
署名付きプロトコルオブジェクトは `{ "payload": <object>, "signature": <block> }` です。`D = "sha256:" + hex(SHA256(UTF8(JCS(payload))))` とします。ブロックには `signerDid`、`canonicalization: "RFC8785-JCS"`、`payloadDigest: D`、`signedAt`、パディング無しの `signature: "ed25519:" + base64url(64-byte-signature)` が入ります。Ed25519 署名の正確なプレイメージは次のとおりです。
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
UTF8(JCS({payload, signerDid, canonicalization, payloadDigest, signedAt}))
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
これはペイロードと署名メタデータを覆い、署名バイトそのものは署名しません。上の草案にある一般規則を、この形に精密化しています。JCS の入力は、有効な Unicode を持つ有限の JSON データでなければなりません。`undefined`、循環、疎な配列、非有限数、独自のオブジェクトインスタンス、孤立サロゲートは拒否します。JSON 成果物のコンテンツアドレスは `SHA256(UTF8(JCS(data)))` です。バイナリそのものには `digestBytes` を使います。did:key は Ed25519 公開鍵を、マルチコーデックのバイト `ed 01` と base58btc マルチベース `z` で符号化します。
|
|
51
|
+
|
|
52
|
+
Capability の証明は、根から葉へ並んだ署名付きトークンの配列です。各子は、完全に署名された親の SHA-256 ダイジェストへ `parentHash` を束縛し、発行者を親の audience に変え、タスク束縛を保ち、リソース・ツール・引数スキーマを狭め、maxCalls と期限を上げず、notBefore を過去へ戻さず、maxDepth を少なくとも 1 減らします。深さが 0 なら、さらに子を作れません。ワイヤ上の `maxCalls` / `maxDepth` は、マニフェストの付与である `maxInvocations` / `maxDelegationDepth` に対応します。引数スキーマはツール名をキーにします。同一スキーマか、直接の `allOf` 継承だけを受理します。対応するスコープとスキーマ構文はセキュリティモデルを見てください。
|
|
53
|
+
|
|
54
|
+
承認レシートのゲート名は、マニフェストのゲート名へ次のように対応します。
|
|
55
|
+
|
|
56
|
+
| レシートのゲート | マニフェストのゲート |
|
|
57
|
+
| -------------------- | ------------------------- |
|
|
58
|
+
| contract_acceptance | GATE_CONTRACT_ACCEPT |
|
|
59
|
+
| external_side_effect | GATE_EXTERNAL_SIDE_EFFECT |
|
|
60
|
+
| budget_increase | GATE_BUDGET_OVERRUN |
|
|
61
|
+
| redelegation | GATE_SUB_DELEGATION |
|
|
62
|
+
| final_verification | GATE_DELIVERY_ACCEPT |
|
|
63
|
+
|
|
64
|
+
オーナー署名の承認レシートは、タスク、ゲート、対象ダイジェストそのもの、APPROVED / REJECTED の決定を束縛します。ゲートのインスタンスはレシートの再生を拒否します。署名付き遷移は、契約ダイジェスト、タスク、直前の状態、0 始まりのシーケンスを束縛します。M1 の遷移プロファイルは PROPOSED、ACCEPTED、IN_PROGRESS、DELIVERED、VERIFY_ACCEPT、VERIFY_REJECT、SETTLED、CANCELLED、DISPUTED です。網羅表は `conformance/state-transitions.json` にあります。PROPOSE が PROPOSED を確立します。アーキテクチャにある交渉、再試行、タイムアウト専用の状態は、後の拡張です。
|
|
65
|
+
|
|
66
|
+
監査本体のフィールドは `taskId`、0 始まりの `seq`、`prevEntryHash`(起源では null)、`actorDid`、`receiverDid`、`eventType`、`payload` です。`entryHash = digest(body)` です。`actorSignature` は本体に署名し、`counterSignature` はそのハッシュ、タスク、双方を束縛する署名付き AckReceipt です。最終の署名付きチェックポイントは件数、head、行為者を固定し、相手がもう一度署名します。JSONL は `{"entry": ...}` レコードのあとに、1件の `{"checkpoint": ...}` レコードが続きます。バンドルは `{entries, checkpoint}` です。オフライン検証にはチェックポイントが必要です。より古い有効なバンドルへの巻き戻しを検出するには、独立して入手した最新の head が必要です。
|
|
67
|
+
|
|
68
|
+
妥当な `reportProgress` は途中の `metrics` を含められます。その使用量は、進捗フレームをキューへ入れる前にセッションのクォータへ計上されます。不正な `reportProgress` ペイロード(`INVALID_PROGRESS`)は、その `metrics` を適用しません。返された Promise は直ちに拒否され、セッションは粘着的な失敗を記録するため、その後の成果物で `SETTLED` にはなりません。アダプタが Promise 拒否を catch しても、依頼者は `PEER_REJECTED: {"code":"INVALID"}` を観測し、ワーカーは `INVALID_PROGRESS` で失敗します。
|
|
69
|
+
|
|
70
|
+
A2A の AgentCard、Task、Message、Artifact は SDK のワイヤ形を保ち、署名付き Sealbridge エンベロープの中に載ります。ブリッジは、インストール済みの A2A SDK 0.3 のワイヤプロファイルを使います。Sealbridge の契約とレシートは、A2A を書き換えるのではなく、オーバーレイのペイロードです。MCP の `tools/call` の要求と結果は公式 SDK を使い、サンドボックスの外で物理的にプロキシされます。未知のツールと、メタデータの無い迂回は拒否します。
|
|
71
|
+
|
|
72
|
+
## M2/M3 追加のディスカバリとセッションプロファイル
|
|
73
|
+
|
|
74
|
+
M0/M1 の JSON スキーマとサンプルは変更していません。署名付き AgentCard と招待は、同じ `Signed<T>` のプレイメージを使います。`AgentCard` には ownerDid、agentDid、relayEndpoint、skills(任意の JSON 入出力スキーマを含む)、costModes、name、description、version が入ります。カードに署名するのはオーナーです。`AgentInvite` は、完全に署名されたカードを、同じ ownerDid / agentDid と relayUrl、および issuedAt / expiresAt に束縛します。パーサは、無効な署名、一致しない識別子や経路、未来の発行時刻、期限切れを拒否します。URI の符号化は `acp-invite:<base64url(JSON(Signed<AgentInvite>))>` または `acp://invite?token=<same-base64url>` です。
|
|
75
|
+
|
|
76
|
+
セッションのエンベロープは、送信者ごとに単調なシーケンス番号を持ちます。各アプリケーションイベントのあとに、署名付き監査本体を運ぶ `AUDIT_ENTRY` エンベロープが続き、受信者は署名付き AckReceipt を運ぶ `AUDIT_ACK` を返します。双方が同一の AuditEntry を追記します。`CHECKPOINT` と `CHECKPOINT_ACK` は、最終の署名付きチェックポイントと副署を交換します。DELIVER には成果物、利用量、実行証明、およびその署名付き遷移が含まれます。証明は `effectiveIsolationLevel` と `sandboxBoundary`(`nodePermissionFlag`、`permissionModelActive`、`kernelNetworkIsolated`)を追加できます。`node:vm` はセキュリティ機構ではないです。Node の `--permission` / `--experimental-permission` は `fetch`、`node:net`、`node:http`、`node:https`、`node:dns`、`node:dgram` を止めません。`kernelNetworkIsolated` が真になるのは `oci_container`(`isolationLevel: 'oci_container'`)だけで、その経路はカーネルのネットワーク境界です(`--network none`、`--read-only`、`--cap-drop ALL`、`no-new-privileges`)。`subprocess_restricted` は権限フラグと `--allow-fs-read`、`--allow-fs-write` を組にすることがあります。元の M1 証明も有効なままです。
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Sealbridge Protocol Specification (`spec/`)
|
|
2
|
+
|
|
3
|
+
**English** | [日本語 (README.ja.md)](./README.ja.md)
|
|
4
|
+
|
|
5
|
+
**Conclusion**: This directory is the language-independent source of truth for the protocol specification and the JSON Schema (Draft 2020-12). Every protocol object computes a **SHA-256 digest** and an **Ed25519 signature** over bytes canonicalized with **RFC 8785 (JCS: JSON Canonicalization Scheme)**.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Shared cryptographic and serialization rules
|
|
10
|
+
|
|
11
|
+
1. **Encoding**: UTF-8 JSON (the I-JSON subset). Amounts, token counts, and durations are integers, so floating-point error does not enter the signed bytes.
|
|
12
|
+
2. **Canonicalization**: A JSON object that will be signed or hashed is converted to a deterministic byte string with keys sorted lexicographically and whitespace removed, following [RFC 8785 (JCS)](https://www.rfc-editor.org/info/rfc8785/).
|
|
13
|
+
3. **Principal ID**: Owner and agent identifiers use W3C `did:key` (the Ed25519 public key in multibase base58btc, for example `did:key:z6Mk...`).
|
|
14
|
+
4. **Digest form**: `"sha256:<64 lowercase hex characters>"` (for example `"sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"`).
|
|
15
|
+
5. **Signature form**: `"ed25519:<base64url or 128 lowercase hex characters>"`. Before signing, remove the `signature` / `signatures` fields from the object and then apply JCS.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 2. Core schemas
|
|
20
|
+
|
|
21
|
+
| File | Status | Role |
|
|
22
|
+
| :--------------------------------------------------------- | :------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| [`task-manifest.schema.json`](./task-manifest.schema.json) | **Draft v0.1 (validated)** | The task specification the requester presents: input and output JSON Schema, acceptance criteria, verification method, budget cap, granted Capabilities, and isolation requirements |
|
|
24
|
+
| `capability-token.schema.json` | Planned (M0) | A UCAN/Biscuit-style attenuating scope token (`issuer`, `audience`, `taskId`, `resources`, `allowedTools`, `argConstraints`, `maxInvocations`, `maxDelegationDepth`, `proofs`) |
|
|
25
|
+
| `envelope.schema.json` | Planned (M0) | The signed message envelope that crosses the Relay (`envelopeId`, `taskId`, `seq`, `eventType`, `senderDid`, `recipientDid`, `payload`, `signature`) and the acknowledgement `AckReceipt` |
|
|
26
|
+
| `audit-entry.schema.json` | Planned (M0) | A bilateral signed hash-chain ledger entry, plus `UsageReceipt` / `ApprovalReceipt` |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 3. Schema validation command
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx --yes -p ajv-cli@5 -p ajv-formats@3 ajv validate \
|
|
34
|
+
--spec=draft2020 \
|
|
35
|
+
-c ajv-formats \
|
|
36
|
+
-s spec/task-manifest.schema.json \
|
|
37
|
+
-d spec/examples/sample-task-manifest.json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## M0–M1 executable wire profile
|
|
41
|
+
|
|
42
|
+
The new `capability-token`, `usage-receipt`, `approval-receipt`, `ack-receipt`,
|
|
43
|
+
`envelope` and `audit-entry` schemas are implemented. Run `pnpm validate:schemas`
|
|
44
|
+
to compile all schemas and validate every example using Ajv Draft 2020-12.
|
|
45
|
+
The original TaskManifest schema and example remain unchanged.
|
|
46
|
+
|
|
47
|
+
Signed protocol objects use `{ "payload": <object>, "signature": <block> }`.
|
|
48
|
+
Let `D = "sha256:" + hex(SHA256(UTF8(JCS(payload))))`. The block contains
|
|
49
|
+
`signerDid`, `canonicalization: "RFC8785-JCS"`, `payloadDigest: D`, `signedAt`, and
|
|
50
|
+
`signature: "ed25519:" + base64url(64-byte-signature)` without padding.
|
|
51
|
+
The exact Ed25519 signature preimage is:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
UTF8(JCS({payload, signerDid, canonicalization, payloadDigest, signedAt}))
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This covers the payload and signature metadata, and does not sign the signature
|
|
58
|
+
bytes themselves. It refines the draft's general rule above. JCS inputs must be
|
|
59
|
+
finite JSON data with valid Unicode; undefined, cycles, sparse arrays, nonfinite
|
|
60
|
+
numbers, custom object instances and lone surrogates are rejected. Content
|
|
61
|
+
addresses for JSON artifacts use `SHA256(UTF8(JCS(data)))`; `digestBytes` is
|
|
62
|
+
available for exact binary content. did:key encodes the Ed25519 public key with
|
|
63
|
+
multicodec bytes `ed 01` and base58btc multibase `z`.
|
|
64
|
+
|
|
65
|
+
Capability proofs are an ordered root-to-leaf array of signed tokens. Each child
|
|
66
|
+
binds `parentHash` to the SHA-256 digest of its complete signed parent, changes
|
|
67
|
+
issuer to the parent's audience, retains task binding, narrows the resource,
|
|
68
|
+
tools and argument schemas, never raises maxCalls or expiry, never backdates
|
|
69
|
+
notBefore, and decreases maxDepth by at least one. A zero depth forbids another
|
|
70
|
+
child. Wire token `maxCalls`/`maxDepth` correspond to manifest grant
|
|
71
|
+
`maxInvocations`/`maxDelegationDepth`. Argument schemas are indexed by tool name.
|
|
72
|
+
Only identical schemas or direct `allOf` inheritance are accepted. See the
|
|
73
|
+
security model for supported scope and schema syntax.
|
|
74
|
+
|
|
75
|
+
Approval receipt gate names map to the manifest's names:
|
|
76
|
+
|
|
77
|
+
| Receipt gate | Manifest gate |
|
|
78
|
+
| -------------------- | ------------------------- |
|
|
79
|
+
| contract_acceptance | GATE_CONTRACT_ACCEPT |
|
|
80
|
+
| external_side_effect | GATE_EXTERNAL_SIDE_EFFECT |
|
|
81
|
+
| budget_increase | GATE_BUDGET_OVERRUN |
|
|
82
|
+
| redelegation | GATE_SUB_DELEGATION |
|
|
83
|
+
| final_verification | GATE_DELIVERY_ACCEPT |
|
|
84
|
+
|
|
85
|
+
Owner-signed approval receipts bind the task, gate, exact target digest and
|
|
86
|
+
APPROVED/REJECTED decision. Gate instances reject receipt replay. Signed
|
|
87
|
+
transitions bind contract digest, task, prior state and zero-based sequence. The
|
|
88
|
+
M1 transition profile uses PROPOSED, ACCEPTED, IN_PROGRESS, DELIVERED,
|
|
89
|
+
VERIFY_ACCEPT, VERIFY_REJECT, SETTLED, CANCELLED and DISPUTED; the exhaustive table
|
|
90
|
+
is in `conformance/state-transitions.json`. PROPOSE establishes PROPOSED. Negotiation,
|
|
91
|
+
retry and timeout-specific states in the architecture remain later extensions.
|
|
92
|
+
|
|
93
|
+
Audit body fields are `taskId`, zero-based `seq`, `prevEntryHash` (null at genesis),
|
|
94
|
+
`actorDid`, `receiverDid`, `eventType`, `payload`. `entryHash = digest(body)`;
|
|
95
|
+
`actorSignature` signs the body and `counterSignature` is a signed AckReceipt
|
|
96
|
+
binding that hash, task and both parties. The final signed checkpoint fixes the
|
|
97
|
+
count, head and actors and is signed again by the other party. JSONL contains
|
|
98
|
+
`{"entry": ...}` records followed by one `{"checkpoint": ...}` record. Bundles
|
|
99
|
+
contain `{entries, checkpoint}`. The checkpoint is required for offline verification.
|
|
100
|
+
An independent latest head is required to detect rollback to an older valid bundle.
|
|
101
|
+
|
|
102
|
+
A valid `reportProgress` may include intermediate `metrics`, and those metrics are charged to the session quota before the progress frame is queued. An invalid `reportProgress` payload (`INVALID_PROGRESS`) does not apply its `metrics`. The returned promise rejects immediately, and the session records a sticky failure, so a later deliverable cannot settle. The requester observes `PEER_REJECTED: {"code":"INVALID"}` and the worker fails with `INVALID_PROGRESS`, even if the adapter catches the promise.
|
|
103
|
+
|
|
104
|
+
A2A AgentCard, Task, Message and Artifact retain SDK wire shapes, carried inside
|
|
105
|
+
signed Sealbridge envelopes. The bridge uses the installed A2A SDK 0.3 wire profile;
|
|
106
|
+
Sealbridge contract/receipt objects are overlay payloads rather than changes to A2A.
|
|
107
|
+
MCP `tools/call` requests and results use the official SDK and are physically
|
|
108
|
+
proxied outside the sandbox. Unknown tools and metadata-free bypasses are denied.
|
|
109
|
+
|
|
110
|
+
## M2/M3 additive discovery and session profile
|
|
111
|
+
|
|
112
|
+
The M0/M1 JSON schemas and examples remain unchanged. Signed AgentCards and
|
|
113
|
+
invites use the same `Signed<T>` preimage. `AgentCard` contains ownerDid,
|
|
114
|
+
agentDid, relayEndpoint, skills (including optional JSON input/output schemas),
|
|
115
|
+
costModes, name, description and version. The owner signs the card.
|
|
116
|
+
`AgentInvite` binds the complete signed card to the same ownerDid/agentDid and
|
|
117
|
+
relayUrl, plus issuedAt/expiresAt. Parsers reject invalid signatures, mismatched
|
|
118
|
+
identities/routes, future issuance and expiry. URI encoding is either
|
|
119
|
+
`acp-invite:<base64url(JSON(Signed<AgentInvite>))>` or
|
|
120
|
+
`acp://invite?token=<same-base64url>`.
|
|
121
|
+
|
|
122
|
+
Session envelopes have monotonic sequence numbers per sender. Each application
|
|
123
|
+
event is followed by an `AUDIT_ENTRY` envelope carrying a signed audit body;
|
|
124
|
+
the receiver returns `AUDIT_ACK` carrying its signed AckReceipt. Both sides
|
|
125
|
+
append the identical AuditEntry. `CHECKPOINT` and `CHECKPOINT_ACK` exchange the
|
|
126
|
+
final signed checkpoint and countersignature. DELIVER includes artifact, usage,
|
|
127
|
+
attestation and its signed transition. Attestations may add
|
|
128
|
+
`effectiveIsolationLevel` and `sandboxBoundary` (`nodePermissionFlag`,
|
|
129
|
+
`permissionModelActive`, `kernelNetworkIsolated`). `node:vm` is not a security mechanism,
|
|
130
|
+
and Node's `--permission` / `--experimental-permission` model does not block
|
|
131
|
+
`fetch`, `node:net`, `node:http`, `node:https`, `node:dns`, or `node:dgram`.
|
|
132
|
+
`kernelNetworkIsolated` is true only for `oci_container` (`isolationLevel: 'oci_container'`),
|
|
133
|
+
which is the kernel network boundary: `--network none`, `--read-only`, `--cap-drop ALL`, and `no-new-privileges`.
|
|
134
|
+
`subprocess_restricted` may add `--allow-fs-read` and `--allow-fs-write` with the
|
|
135
|
+
permission flag. Original M1 attestations remain valid.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://acp-spec.local/schemas/v0.1/ack-receipt.schema.json",
|
|
4
|
+
"title": "ack-receipt",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"payload",
|
|
9
|
+
"signature"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"payload": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": [
|
|
16
|
+
"type",
|
|
17
|
+
"taskId",
|
|
18
|
+
"entryHash",
|
|
19
|
+
"actorDid",
|
|
20
|
+
"receiverDid"
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"type": {
|
|
24
|
+
"const": "AckReceipt"
|
|
25
|
+
},
|
|
26
|
+
"taskId": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1
|
|
29
|
+
},
|
|
30
|
+
"entryHash": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
33
|
+
},
|
|
34
|
+
"actorDid": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
37
|
+
},
|
|
38
|
+
"receiverDid": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"signature": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": [
|
|
48
|
+
"signerDid",
|
|
49
|
+
"canonicalization",
|
|
50
|
+
"payloadDigest",
|
|
51
|
+
"signedAt",
|
|
52
|
+
"signature"
|
|
53
|
+
],
|
|
54
|
+
"properties": {
|
|
55
|
+
"signerDid": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
58
|
+
},
|
|
59
|
+
"canonicalization": {
|
|
60
|
+
"const": "RFC8785-JCS"
|
|
61
|
+
},
|
|
62
|
+
"payloadDigest": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
65
|
+
},
|
|
66
|
+
"signedAt": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"format": "date-time"
|
|
69
|
+
},
|
|
70
|
+
"signature": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"pattern": "^ed25519:[A-Za-z0-9_-]{86}$"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://acp-spec.local/schemas/v0.1/agent-card.schema.json",
|
|
4
|
+
"title": "agent-card",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["payload", "signature"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"payload": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"required": [
|
|
13
|
+
"type",
|
|
14
|
+
"name",
|
|
15
|
+
"description",
|
|
16
|
+
"ownerDid",
|
|
17
|
+
"agentDid",
|
|
18
|
+
"relayEndpoint",
|
|
19
|
+
"skills",
|
|
20
|
+
"costModes",
|
|
21
|
+
"version",
|
|
22
|
+
"expiresAt"
|
|
23
|
+
],
|
|
24
|
+
"properties": {
|
|
25
|
+
"type": { "const": "AgentCard" },
|
|
26
|
+
"name": { "type": "string", "minLength": 1 },
|
|
27
|
+
"description": { "type": "string" },
|
|
28
|
+
"ownerDid": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
31
|
+
},
|
|
32
|
+
"agentDid": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
35
|
+
},
|
|
36
|
+
"relayEndpoint": { "type": "string", "minLength": 1 },
|
|
37
|
+
"skills": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"required": ["id", "name"],
|
|
43
|
+
"properties": {
|
|
44
|
+
"id": { "type": "string", "minLength": 1 },
|
|
45
|
+
"name": { "type": "string" },
|
|
46
|
+
"description": { "type": "string" },
|
|
47
|
+
"inputSchema": {},
|
|
48
|
+
"outputSchema": {}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"costModes": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"minItems": 1,
|
|
55
|
+
"items": {
|
|
56
|
+
"enum": ["worker_byok", "bilateral_quota", "external_settlement_plugin"]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"version": { "type": "string", "minLength": 1 },
|
|
60
|
+
"expiresAt": { "type": "string", "format": "date-time" },
|
|
61
|
+
"agentDelegation": { "$ref": "#/$defs/signature" }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"signature": { "$ref": "#/$defs/signature" }
|
|
65
|
+
},
|
|
66
|
+
"$defs": {
|
|
67
|
+
"signature": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": ["signerDid", "canonicalization", "payloadDigest", "signedAt", "signature"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"signerDid": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
75
|
+
},
|
|
76
|
+
"canonicalization": { "const": "RFC8785-JCS" },
|
|
77
|
+
"payloadDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
78
|
+
"signedAt": { "type": "string", "format": "date-time" },
|
|
79
|
+
"signature": { "type": "string", "pattern": "^ed25519:[A-Za-z0-9_-]{86}$" }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://acp-spec.local/schemas/v0.1/approval-receipt.schema.json",
|
|
4
|
+
"title": "approval-receipt",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"payload",
|
|
9
|
+
"signature"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"payload": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": [
|
|
16
|
+
"type",
|
|
17
|
+
"receiptId",
|
|
18
|
+
"taskId",
|
|
19
|
+
"gate",
|
|
20
|
+
"targetDigest",
|
|
21
|
+
"decision",
|
|
22
|
+
"approvedAt"
|
|
23
|
+
],
|
|
24
|
+
"properties": {
|
|
25
|
+
"type": {
|
|
26
|
+
"const": "ApprovalReceipt"
|
|
27
|
+
},
|
|
28
|
+
"receiptId": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"minLength": 1
|
|
31
|
+
},
|
|
32
|
+
"taskId": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1
|
|
35
|
+
},
|
|
36
|
+
"gate": {
|
|
37
|
+
"enum": [
|
|
38
|
+
"contract_acceptance",
|
|
39
|
+
"external_side_effect",
|
|
40
|
+
"budget_increase",
|
|
41
|
+
"redelegation",
|
|
42
|
+
"final_verification"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"targetDigest": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
48
|
+
},
|
|
49
|
+
"decision": {
|
|
50
|
+
"enum": [
|
|
51
|
+
"APPROVED",
|
|
52
|
+
"REJECTED"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"approvedAt": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"format": "date-time"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"signature": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": [
|
|
65
|
+
"signerDid",
|
|
66
|
+
"canonicalization",
|
|
67
|
+
"payloadDigest",
|
|
68
|
+
"signedAt",
|
|
69
|
+
"signature"
|
|
70
|
+
],
|
|
71
|
+
"properties": {
|
|
72
|
+
"signerDid": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
75
|
+
},
|
|
76
|
+
"canonicalization": {
|
|
77
|
+
"const": "RFC8785-JCS"
|
|
78
|
+
},
|
|
79
|
+
"payloadDigest": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
82
|
+
},
|
|
83
|
+
"signedAt": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"format": "date-time"
|
|
86
|
+
},
|
|
87
|
+
"signature": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"pattern": "^ed25519:[A-Za-z0-9_-]{86}$"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://acp-spec.local/schemas/v0.1/audit-entry.schema.json",
|
|
4
|
+
"title": "audit-entry",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"body",
|
|
9
|
+
"entryHash",
|
|
10
|
+
"actorSignature",
|
|
11
|
+
"counterSignature"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"body": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"required": [
|
|
18
|
+
"taskId",
|
|
19
|
+
"seq",
|
|
20
|
+
"prevEntryHash",
|
|
21
|
+
"actorDid",
|
|
22
|
+
"receiverDid",
|
|
23
|
+
"eventType",
|
|
24
|
+
"payload"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"taskId": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 1
|
|
30
|
+
},
|
|
31
|
+
"seq": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"minimum": 0
|
|
34
|
+
},
|
|
35
|
+
"prevEntryHash": {
|
|
36
|
+
"anyOf": [
|
|
37
|
+
{
|
|
38
|
+
"type": "string",
|
|
39
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "null"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"actorDid": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
49
|
+
},
|
|
50
|
+
"receiverDid": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
53
|
+
},
|
|
54
|
+
"eventType": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"minLength": 1
|
|
57
|
+
},
|
|
58
|
+
"payload": {}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"entryHash": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
64
|
+
},
|
|
65
|
+
"actorSignature": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"additionalProperties": false,
|
|
68
|
+
"required": [
|
|
69
|
+
"signerDid",
|
|
70
|
+
"canonicalization",
|
|
71
|
+
"payloadDigest",
|
|
72
|
+
"signedAt",
|
|
73
|
+
"signature"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"signerDid": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"pattern": "^did:key:z[1-9A-HJ-NP-Za-km-z]{32,128}$"
|
|
79
|
+
},
|
|
80
|
+
"canonicalization": {
|
|
81
|
+
"const": "RFC8785-JCS"
|
|
82
|
+
},
|
|
83
|
+
"payloadDigest": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
86
|
+
},
|
|
87
|
+
"signedAt": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"format": "date-time"
|
|
90
|
+
},
|
|
91
|
+
"signature": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"pattern": "^ed25519:[A-Za-z0-9_-]{86}$"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"counterSignature": {
|
|
98
|
+
"$ref": "https://acp-spec.local/schemas/v0.1/ack-receipt.schema.json"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|