@stellar-agent-services/dev-mcp 0.0.0-stage → 0.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.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/docs.d.ts +35 -0
- package/dist/docs.d.ts.map +1 -0
- package/dist/docs.js +92 -0
- package/dist/docs.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +125 -0
- package/dist/server.js.map +1 -0
- package/package.json +40 -4
- package/repository/AGENTS.md +162 -0
- package/repository/CONTRIBUTING.md +95 -0
- package/repository/IMPLEMENTATION_PLAN.md +560 -0
- package/repository/README.md +80 -0
- package/repository/SECURITY.md +22 -0
- package/repository/apps/wallet/README.md +78 -0
- package/repository/docs/client-integration/README-AI.md +495 -0
- package/repository/docs/client-integration/README.md +138 -0
- package/repository/docs/dx-improvements.md +670 -0
- package/repository/docs/erc-compatibility.md +163 -0
- package/repository/docs/job-recovery.md +201 -0
- package/repository/docs/payment-client.md +290 -0
- package/repository/docs/provider-setup-guide.md +348 -0
- package/repository/docs/provider-standard.md +728 -0
- package/repository/docs/recovery/README-AI.md +288 -0
- package/repository/docs/recovery/README.md +119 -0
- package/repository/docs/sow-closeout.md +67 -0
- package/repository/docs/standard/README-AI.md +614 -0
- package/repository/docs/standard/README.md +108 -0
- package/repository/docs/verification.md +504 -0
- package/repository/examples/paid-service/README.md +33 -0
- package/repository/examples/python-upstream/README.md +44 -0
- package/repository/llms.txt +65 -0
- package/repository/packages/create-stellar-service/README.md +143 -0
- package/repository/packages/dev-mcp/README.md +51 -0
- package/repository/packages/payment-client/README.md +98 -0
- package/repository/packages/protocol/README.md +15 -0
- package/repository/packages/protocol/schemas/manifest.schema.json +272 -0
- package/repository/packages/protocol/test-vectors/README.md +45 -0
- package/repository/packages/provider-kit/README.md +509 -0
- package/repository/packages/provider-kit/schemas/gateway-config.schema.json +140 -0
- package/repository/packages/verifier/README.md +131 -0
- package/repository/plugins/stellar-agent-services/README.md +31 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
# Stellar Agent Services: Implementation Plan
|
|
2
|
+
|
|
3
|
+
Phase 2 of [Stellar Agent Search](https://github.com/berkingurcan/stellar-agent-search). It covers the Provider
|
|
4
|
+
Standard, Provider Kit, safe Payment Client, verification receipts, Stellar 8004 Validation Registry records and
|
|
5
|
+
Job Recovery, delivered and piloted within one 30-day Instaward sprint.
|
|
6
|
+
|
|
7
|
+
- **Source of truth:** Instawards SOW "Stellar Agent MCP" (submitted 29.09.2026, $4,000, 30 days).
|
|
8
|
+
- **Background:** `stellar-agent-search/docs/provider-network-phase-2.md` and `issues/P3-23-provider-network-phase-2.md`.
|
|
9
|
+
- **Network:** Stellar **testnet** for the whole build. Mainnet is a later, separate decision (see [Open decisions](#10-open-decisions)).
|
|
10
|
+
- **Status (2026-11-06):** the core packages are released at 0.1.0. The kit, client, recovery and C1–C7 verifier
|
|
11
|
+
are implemented. This checkout adds fail-closed enforcement of configured verification restrictions [V1].
|
|
12
|
+
Sample approval/payment and recovery demos are recorded with screenshots and on-chain proofs in `evidence/`.
|
|
13
|
+
[The recordings and proofs are public](https://algorialabs.github.io/stellar-agent-services/); live verification
|
|
14
|
+
runs and badges are documented in [receipt evidence](evidence/receipts/README.md). Permanent sample
|
|
15
|
+
registration, an anchored Validation Registry response and the independent pilot remain.
|
|
16
|
+
Newer implementation notes report testnet discovery implemented in `stellar-agent-search`;
|
|
17
|
+
the pilot must confirm the full discovery-to-result path. See [SOW closeout](docs/sow-closeout.md) for the
|
|
18
|
+
handoff and [readiness evidence](evidence/readiness.md) for checks and public release/CI references.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. What the SOW commits us to
|
|
23
|
+
|
|
24
|
+
| SOW deliverable | Contents | Evidence promised |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| **D1:** Provider Standard + Safe Payment Client | Provider Standard v1 (purpose, input, output, price, network, job status, result). Payment client that shows payment details, applies spending controls and requires approval. | Public spec, short demo video, screenshots, payment tx link |
|
|
27
|
+
| **D2:** Provider Kit, Verification, Job Recovery | Open-source kit, setup guide, sample service. Provider checks, verification receipts and badges, Stellar 8004 Validation Registry publishing. Job Recovery (create-job, check-status, get-result) without paying twice. | Public repo, setup guide, verification receipt, Validation Registry record, recovery demo |
|
|
28
|
+
| **D3:** Independent Provider Pilot + Public Evidence | Independent providers each complete at least one paid call. Users run the full flow. Job Recovery demo. Pilot report. Incentives included. | Provider links, payment references, screenshots, pilot report, public evidence page |
|
|
29
|
+
|
|
30
|
+
**Out of scope (SOW):**
|
|
31
|
+
- a new registry or protocol
|
|
32
|
+
- the full ERC-8126 specification
|
|
33
|
+
- zero-knowledge proofs
|
|
34
|
+
- a formal audit
|
|
35
|
+
- a consumer marketplace
|
|
36
|
+
- custody
|
|
37
|
+
- guaranteed adoption or availability
|
|
38
|
+
|
|
39
|
+
### 1.1 Inconsistencies in the SOW, and the reading we plan against
|
|
40
|
+
|
|
41
|
+
The SOW gives conflicting numbers. The working interpretation below still needs Chapter Lead agreement; it
|
|
42
|
+
does not literally satisfy D3's phrase "three independent providers".
|
|
43
|
+
|
|
44
|
+
| Topic | What the SOW says | We plan for |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| Providers | "two independent providers" (objective, W4, evidence). "three independent providers" (D3). "not more than two" (out of scope). "three working provider integrations" (W4 output). | **3 integrations = our sample provider + 2 independent providers** |
|
|
47
|
+
| Users | "five users" (D3, W4 output). "two users" (objective, W4 work, evidence). "not more than five" (out of scope). | **5 distinct users**, each completing the flow |
|
|
48
|
+
| Where it lives | "add … to Stellar Agent Search" | Phase 2 of Stellar Agent Search, built in this repo. Discovery stays in `stellar-agent-search`. |
|
|
49
|
+
|
|
50
|
+
> Action: confirm this reading with the Ambassador Chapter Lead before the sprint starts.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 2. Principles
|
|
55
|
+
|
|
56
|
+
1. **Discovery holds no keys.** `stellar-agent-search` stays read-only and keyless. Nothing in this repo is
|
|
57
|
+
imported into it except read-only types or schemas.
|
|
58
|
+
2. **The provider runtime holds no keys.** A provider server only knows its `payTo` public address. The
|
|
59
|
+
facilitator verifies and settles. The owner's transactions (USDC trustline, registration, validation requests)
|
|
60
|
+
are signed only in the owner's own wallet, on a local approval page the CLI opens, or with `--source` through
|
|
61
|
+
the Stellar CLI keychain. The CLI never holds a key.
|
|
62
|
+
3. **Signing happens only in the payment client.** The approved payment is signed exactly once, and only after
|
|
63
|
+
the user approves the exact price, recipient, asset and network, or when the payment fits a budget the user
|
|
64
|
+
explicitly granted.
|
|
65
|
+
4. **Never pay twice for one job.** The job identity is fixed before payment. The provider binds it to one
|
|
66
|
+
request and one payment, and recovery never re-sends a payment credential.
|
|
67
|
+
5. **Fail closed.** A failed spending-limit check, an unknown settlement, a mismatched challenge or an
|
|
68
|
+
unreadable journal stops the flow. None of them is ever treated as a pass.
|
|
69
|
+
6. **One network per flow.** A demo, test or pilot run uses testnet from discovery to feedback, never a mix.
|
|
70
|
+
7. **Independent codebase.** No code, schemas or names are taken from Algoria. The foundations are the public
|
|
71
|
+
x402 v2 spec, the `@x402/*` packages, `@stellar/stellar-sdk`, `@trionlabs/stellar8004` and Stellar Agent
|
|
72
|
+
Search's own Phase 1 reference (`examples/x402-demo.ts`).
|
|
73
|
+
8. **Stay compatible with ERC-8126 and ERC-8196.** We don't implement them, because a parallel project does. Our
|
|
74
|
+
identity, Validation Registry, policy and journal formats must not block their Stellar versions. See
|
|
75
|
+
[docs/erc-compatibility.md](docs/erc-compatibility.md).
|
|
76
|
+
9. **Universal standard.** Any service in any language can implement Provider Standard v1. The spec is
|
|
77
|
+
language-neutral and reuses existing standards (x402, JSON Schema, MCP tool fields, IETF Idempotency-Key,
|
|
78
|
+
RFC 9457). The TypeScript kit and its gateway mode make adoption easier but are never required.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 3. Architecture
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
┌──────────────────────────┐ read-only ┌──────────────────────────────┐
|
|
86
|
+
│ stellar-agent-search │ ─────────────▶ │ Stellar 8004 registries │
|
|
87
|
+
│ (discovery, no keys) │ │ Identity · Reputation · │
|
|
88
|
+
└────────────┬─────────────┘ │ Validation (Soroban) │
|
|
89
|
+
│ finds provider + manifest URL└──────────────▲───────────────┘
|
|
90
|
+
▼ │ validation_request (provider owner)
|
|
91
|
+
┌──────────────────────────┐ create-job (402 → pay) │ validation_response (verifier)
|
|
92
|
+
│ payment-client (keys) │ ───────────────────────────┐ │
|
|
93
|
+
│ approval · limits · │ check-status / get-result │ │
|
|
94
|
+
│ journal · recovery │ ◀──────────────────────────┤ │
|
|
95
|
+
└──────────────────────────┘ ▼ │
|
|
96
|
+
┌──────────────────────────┐
|
|
97
|
+
┌──────────────────────────┐ test calls │ provider (provider-kit) │
|
|
98
|
+
│ verifier (verifier key) │ ────────────▶ │ manifest · x402 server · │
|
|
99
|
+
│ checks · receipt · badge │ │ job store · services │
|
|
100
|
+
└──────────────────────────┘ └────────────┬─────────────┘
|
|
101
|
+
│ verify / settle
|
|
102
|
+
▼
|
|
103
|
+
┌──────────────────────────┐
|
|
104
|
+
│ x402 facilitator │
|
|
105
|
+
│ (fee-sponsored USDC SAC) │
|
|
106
|
+
└──────────────────────────┘
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 3.1 Who holds which key
|
|
110
|
+
|
|
111
|
+
| Actor | Holds | Must never hold |
|
|
112
|
+
| --- | --- | --- |
|
|
113
|
+
| `stellar-agent-search` (discovery) | nothing | any secret |
|
|
114
|
+
| Provider server (`provider-kit` runtime, library or gateway mode) | `payTo` **public** address, facilitator URL; in gateway mode, the upstream API's own credential if it has one | any Stellar secret key |
|
|
115
|
+
| Provider operator (`provider-kit` CLI) | no key: the owner's own wallet signs the USDC trustline, registration and `validation_request` on the local approval page; `--source` uses a Stellar CLI keychain key instead | payer or verifier keys |
|
|
116
|
+
| `payment-client` | the payer's key or wallet connection (§5.6) | provider or verifier keys |
|
|
117
|
+
| `verifier` | verifier key (`validation_response`), plus a dedicated testnet test-payer key for the paid-call check | provider owner keys |
|
|
118
|
+
|
|
119
|
+
### 3.2 Repository layout
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
packages/
|
|
123
|
+
protocol/ Provider Standard v1 as code: types, schemas, header names, job states, receipts,
|
|
124
|
+
canonical JSON, network constants. Shared by every other package.
|
|
125
|
+
provider-kit/ Server toolkit: defineService, createProvider (Fetch-API handler), gateway mode
|
|
126
|
+
(any existing HTTP API), x402 resource server, job store + runner,
|
|
127
|
+
manifest + 8004 registration, operator CLI.
|
|
128
|
+
payment-client/ Buyer side: policy, journal, payment, recovery (§5.6).
|
|
129
|
+
verifier/ Provider checks → verification receipt → badges → Validation Registry response.
|
|
130
|
+
create-stellar-service/
|
|
131
|
+
npm create stellar-service: a new provider project (gateway, library or Python), ready to
|
|
132
|
+
run, try and deploy.
|
|
133
|
+
apps/
|
|
134
|
+
wallet/ Web approval page: static, no backend, the payment-client core in the browser (§5.6).
|
|
135
|
+
examples/
|
|
136
|
+
paid-service/ Sample provider built only with provider-kit (one on-success + one upfront service).
|
|
137
|
+
python-upstream/ An existing Python API made a paid service by gateway mode, with only a config file.
|
|
138
|
+
docs/ Provider Standard v1, setup guide, job recovery, verification, payment client, pilot.
|
|
139
|
+
evidence/ Receipts, payment references, validation records, pilot report (filled during the sprint).
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Tooling:**
|
|
143
|
+
- npm workspaces, matching `stellar-agent-search`, with TypeScript project references (`tsc -b`) and vitest.
|
|
144
|
+
- Node `>=22.13`; `.node-version` pins 24. Node 22.13 is needed for the built-in `node:sqlite` with no native
|
|
145
|
+
dependency and for `@x402/stellar`.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 4. Network and dependencies (testnet)
|
|
150
|
+
|
|
151
|
+
| Item | Value or source |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| CAIP-2 | `stellar:testnet` (`STELLAR_TESTNET_CAIP2` from `@x402/stellar`) |
|
|
154
|
+
| Asset | USDC Stellar Asset Contract: import `USDC_TESTNET_ADDRESS` from `@x402/stellar`, never retype it |
|
|
155
|
+
| USDC issuer (trustline check) | `GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5` |
|
|
156
|
+
| Soroban RPC / Horizon | `https://soroban-testnet.stellar.org` / `https://horizon-testnet.stellar.org` |
|
|
157
|
+
| 8004 contracts | `TESTNET_CONFIG` from `@trionlabs/stellar8004`. Validation: `CC5USZRO26MOIAVNYTTJDS63C2OBBLREOAOET4CPF2EZWO3YFKLMO3SL` |
|
|
158
|
+
| Facilitator | `https://x402.org/facilitator`. Confirmed: it supports `stellar:testnet` + `exact` with sponsored fees, and sets no authorization window of its own (the window follows `maxTimeoutSeconds`). |
|
|
159
|
+
| Decimals | 7 (`0.01 USDC = 100000` base units) |
|
|
160
|
+
|
|
161
|
+
| Package | Version | Note |
|
|
162
|
+
| --- | --- | --- |
|
|
163
|
+
| `@x402/core`, `@x402/fetch`, `@x402/stellar` | 2.28.0 | `@x402/stellar` needs `@stellar/stellar-sdk ^16.3.0` |
|
|
164
|
+
| `@stellar/stellar-sdk` | 16.4.1 | Root `overrides` put `@trionlabs/stellar8004` (declares `^15`) on the same copy, and only it: `@creit.tech/stellar-wallets-kit` (approval page, dev only) keeps its `^17`. 16.4.1 is the first 16.x that pins a fixed axios (1.20.0); 16.3.1 pinned a vulnerable 1.18.0. |
|
|
165
|
+
| `@trionlabs/stellar8004` | 0.0.11 | Identity, Reputation and Validation clients; `generateRequestNonce`; metadata helpers |
|
|
166
|
+
| `hono`, `@hono/node-server` | 4.x / 2.x | Example service only. The kit itself is framework-agnostic (Fetch `Request`/`Response`). |
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 5. Components
|
|
171
|
+
|
|
172
|
+
### 5.1 Provider Standard v1 (`docs/provider-standard.md`, `packages/protocol`)
|
|
173
|
+
|
|
174
|
+
The draft spec is in [docs/provider-standard.md](docs/provider-standard.md). It is a thin layer over existing
|
|
175
|
+
standards, so the SOW's "no new protocol" holds, and any language can implement it.
|
|
176
|
+
|
|
177
|
+
| Concern | Standard reused |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| Payment | x402 v2 `exact` on Stellar; the manifest's payment option uses x402 `PaymentRequirements` field names |
|
|
180
|
+
| Service description | JSON Schema 2020-12 with MCP tool field names (`name`, `title`, `description`, `inputSchema`, `outputSchema`) |
|
|
181
|
+
| Discovery inside the 402 | x402 Bazaar extension |
|
|
182
|
+
| Idempotency | IETF Idempotency-Key draft-07 (422 for a reused key, 409 while in progress) |
|
|
183
|
+
| Long jobs | `202 Accepted` + `Location` + `Retry-After` |
|
|
184
|
+
| Errors | RFC 9457 problem details with a stable `code` |
|
|
185
|
+
| Identity | Stellar 8004 registration `services[]` entry pointing at the manifest |
|
|
186
|
+
|
|
187
|
+
**What the spec adds:** the manifest, the `Job-Token` header, and the rules that bind one job to one request and
|
|
188
|
+
one payment.
|
|
189
|
+
|
|
190
|
+
**Main rules:**
|
|
191
|
+
- The manifest is at `/.well-known/stellar-agent-services.json` by default, or any HTTPS URL the 8004
|
|
192
|
+
registration names. Job endpoints are fixed paths under one `baseUrl` on the same origin.
|
|
193
|
+
- Small required core: `standard`, provider `name`, `baseUrl`, one payment option, and per service `name`,
|
|
194
|
+
`description`, `price.amount`, `inputSchema`, `outputSchema`. Clients ignore unknown fields.
|
|
195
|
+
- No sync/async flag. Each service declares `charge: "on-success" | "upfront"` and `expectedDurationSeconds`.
|
|
196
|
+
- The 402 challenge equals the manifest payment option plus the service price, field by field.
|
|
197
|
+
- Input is validated and capacity checked *before* the 402.
|
|
198
|
+
- Conformance levels: Described (C1, C6), Payable (+ C3, C4), Recoverable (+ C5), plus Registered (C2).
|
|
199
|
+
|
|
200
|
+
**Ways to implement:** gateway mode (any existing HTTP API), the TypeScript library, or natively from the spec,
|
|
201
|
+
checked with `verifier check`. The manifest JSON Schema and language-neutral test vectors are in
|
|
202
|
+
`packages/protocol` (`schemas/`, `test-vectors/`).
|
|
203
|
+
|
|
204
|
+
### 5.2 Job Recovery protocol (`docs/job-recovery.md`)
|
|
205
|
+
|
|
206
|
+
The SOW names three operations.
|
|
207
|
+
|
|
208
|
+
| Operation | HTTP | Notes |
|
|
209
|
+
| --- | --- | --- |
|
|
210
|
+
| **create-job** | `POST {baseUrl}/services/{name}/jobs` | x402-protected. Headers: `Idempotency-Key: <uuid>` (becomes the job id) and `Job-Token: <32 random bytes, base64url>` |
|
|
211
|
+
| **check-status** | `GET {baseUrl}/jobs/{jobId}` | `Job-Token` required. Returns the job view: status, `charged`, receipt and timestamps |
|
|
212
|
+
| **get-result** | `GET {baseUrl}/jobs/{jobId}/result` | `Job-Token` required. Returns the job view with the output |
|
|
213
|
+
|
|
214
|
+
All three return the same job view: `200` when the job has finished, otherwise `202` with `Retry-After`. A client
|
|
215
|
+
that sends neither header (any plain x402 client) gets a provider-generated job id and token in the create-job
|
|
216
|
+
response, without the guarantee for lost responses.
|
|
217
|
+
|
|
218
|
+
**Job states:** `queued → running → succeeded | failed`, plus `payment_uncertain`.
|
|
219
|
+
|
|
220
|
+
**How double-charging is prevented:**
|
|
221
|
+
1. **The client fixes the identity before paying.** It generates `jobId` and the token, then persists both
|
|
222
|
+
together with the binding hash *before* the first request. Because the status URL is a fixed path under
|
|
223
|
+
`baseUrl`, a lost response never loses the handle.
|
|
224
|
+
2. **The provider binds the job.** `jobId → (sha256(JCS({ service, input })), sha256(token))`.
|
|
225
|
+
- Repeating create-job with the same binding returns the existing job, with no new 402 and no new charge.
|
|
226
|
+
- A different binding or token gets `422`; a request while the job is still being claimed or settled gets
|
|
227
|
+
`409` (IETF Idempotency-Key draft-07).
|
|
228
|
+
- A wrong token gets `404`, so the response does not reveal whether the job exists.
|
|
229
|
+
3. **The provider binds the payment.** A unique payment fingerprint (network, payer, signed auth entry)
|
|
230
|
+
means one signed payment can buy at most one job.
|
|
231
|
+
4. **Uncertain means don't pay.** If settlement times out or fails transiently, the job becomes
|
|
232
|
+
`payment_uncertain` and is never re-charged. The provider resolves it from on-chain data after every sweep,
|
|
233
|
+
and operators with `provider-kit reconcile`: the tx hash the facilitator named, or the payer's USDC
|
|
234
|
+
`transfer` events, matched to the job by the payer's signed auth entry and its nonce. "Not settled" needs the
|
|
235
|
+
expiration ledger closed and every ledger the payment could have landed in searched (docs/job-recovery.md).
|
|
236
|
+
5. **Recovery never re-sends `PAYMENT-SIGNATURE`.** It only calls check-status and get-result.
|
|
237
|
+
|
|
238
|
+
**When the user is charged** is set per service with `charge`:
|
|
239
|
+
- `on-success`: verify → run → settle. Work that fails is never charged. The signed payment expires about
|
|
240
|
+
`maxTimeoutSeconds` after signing, so this only suits work well inside that window.
|
|
241
|
+
- `upfront` (default): verify → settle → run. Expensive or long work starts only once it is paid.
|
|
242
|
+
|
|
243
|
+
The **response-loss drill** is test-only, needs an explicit flag, and is off by default. The provider settles and
|
|
244
|
+
persists the result, then drops the response. This is how the SOW recovery demo is produced.
|
|
245
|
+
|
|
246
|
+
### 5.3 Provider Kit (`packages/provider-kit`)
|
|
247
|
+
|
|
248
|
+
| Module | Responsibility |
|
|
249
|
+
| --- | --- |
|
|
250
|
+
| `define-service.ts` | `defineService({ name, title, description, price, charge, expectedDurationSeconds, capacity, inputSchema, outputSchema, examples, handler })`, with schema validation of input (before the 402) and output (before settling) |
|
|
251
|
+
| `provider.ts` | `createProvider(config)` → `{ fetch(request): Promise<Response> }`, which wires every part together |
|
|
252
|
+
| `http/router.ts` | Manifest, create-job, check-status and get-result routes, in the spec's processing order. RFC 9457 errors, body size caps, no redirects. |
|
|
253
|
+
| `gateway/config.ts`, `gateway/upstream.ts` | Gateway mode: a config file describes services whose handler forwards the input to an existing HTTP API in any language |
|
|
254
|
+
| `gateway/openapi.ts` | The gateway config from an existing API's OpenAPI 3 document (`provider-kit init --openapi`): its callable POST endpoints as services, schemas in JSON Schema 2020-12 |
|
|
255
|
+
| `payments/x402-server.ts` | The challenge, built from the manifest, with the Bazaar extension while the header stays under 8 KiB; reading the paid request |
|
|
256
|
+
| `payments/payload-checks.ts` | Local checks run before calling the facilitator: exactly one SAC `transfer(payer → payTo, amount)` on the manifest's asset, authorized by the payer's own signed auth entry and nothing else. The fingerprint is `sha256(JCS({ network, payer, nonce }))`, so re-wrapping one signed auth entry can't buy a second job. Signature validity stays with the facilitator's simulation. |
|
|
257
|
+
| `payments/facilitator.ts` | The kit's own facilitator client: HTTPS-only, no redirects, deadlines (settle: `maxTimeoutSeconds` + 30 s), bounded answers, only the fields the facilitator needs; `checkFacilitator()` at startup (network, `exact`, sponsored fees) |
|
|
258
|
+
| `payments/settlement.ts` | Classifies settlement as `settled` (hash, checked payer and network), `failed` (no hash and a reason from the never-submitted allowlist) or `uncertain` (everything else) |
|
|
259
|
+
| `jobs/store.ts` | `JobStore` contract: atomic claim, compare-and-set transitions that never leave a final state, fingerprint uniqueness, and the queue (admission counts, FIFO starts, worker leases, sweeps); `test/job-store.test.ts` is the contract test |
|
|
260
|
+
| `jobs/memory-store.ts`, `jobs/sqlite-store.ts` | Reference stores. SQLite (`node:sqlite`, WAL, fsync on commit, `BEGIN IMMEDIATE`) is shared safely by several processes on one machine. Providers may add Postgres. |
|
|
261
|
+
| `jobs/runner.ts` | Both charge policies; the output and `settlingSince` are stored before settling; leased upfront workers with renewals and at most 3 starts |
|
|
262
|
+
| `jobs/scheduler.ts` | Capacity (spec §5.8) on the store's queue: admission before the 402 from store counts plus local reservations, the claim under the same lock, FIFO turns for on-success jobs, lease-based workers for upfront jobs, queue positions |
|
|
263
|
+
| `jobs/recovery.ts` | Sweeps at startup and every 30 s: a settlement that never answered becomes `payment_uncertain`; an on-success job whose payment expired (by ledger, or by time) fails uncharged; retention |
|
|
264
|
+
| `jobs/reconcile.ts`, `payments/onchain.ts` | Decides `payment_uncertain` jobs after every sweep [J13]: finds the transaction carrying the payer's auth entry with the job's nonce (the facilitator's hash, else the payer's `transfer` events up to the expiration ledger); settled → queued or succeeded, provably not settled → failed uncharged, anything else waits |
|
|
265
|
+
| `payments/chain.ts` | Soroban RPC reads (`rpc`, default the public testnet RPC) and the ledger clock: on-success deadlines from the payment's expiration ledger, and a create-job check that a signature does not expire too far out |
|
|
266
|
+
| `http/rate-limit.ts` | Optional per-caller limit on create-job: `429` with `Retry-After` |
|
|
267
|
+
| `http/node-server.ts` | `listen()`: Node's HTTP server for a provider, with `/healthz` and graceful close |
|
|
268
|
+
| `manifest.ts` | Builds the manifest and checks it at startup with the JSON Schema and `checkManifestRules()` |
|
|
269
|
+
| `registration.ts` | The 8004 registration file from the manifest [I1], and `checkRegistration()` (I1–I3, read-only), with `inspectRegistration()` also returning the file it read |
|
|
270
|
+
| `validation-request.ts` | The validation request, checked before anything is signed (I1–I3, a signer the registry accepts, a validator that is not the provider itself) and sent as canonical JSON in a `data:` URI |
|
|
271
|
+
| `testing.ts` | `signTestPayment()`: real x402 payments signed offline, for provider and client tests |
|
|
272
|
+
| `cli/` | `serve --config` (gateway mode), `init` (a starter config, or `--openapi` from an OpenAPI document), `check` (self-check, then how agents see the provider: `cli/discovery.ts`), `try` (one paid testnet call from a throwaway payer), `trustline`, `register`, `request-validation`, `reconcile` |
|
|
273
|
+
| `Dockerfile`, `schemas/gateway-config.schema.json` | The gateway image; the config file's JSON Schema |
|
|
274
|
+
|
|
275
|
+
**Developer experience targets (W2 exit criteria):**
|
|
276
|
+
- Library: starting from a clean machine, `npm i`, defining one service and running the server produces a
|
|
277
|
+
working paid testnet request, using only the setup guide.
|
|
278
|
+
- Gateway: an existing non-TypeScript API (a small Python service) becomes a paid service with only a config
|
|
279
|
+
file and `provider-kit serve`, also from the Docker image.
|
|
280
|
+
|
|
281
|
+
### 5.4 Verification, receipts, badges and Validation Registry (`packages/verifier`)
|
|
282
|
+
|
|
283
|
+
**Checks** (each one records evidence):
|
|
284
|
+
|
|
285
|
+
| # | Check | Pass condition |
|
|
286
|
+
| --- | --- | --- |
|
|
287
|
+
| C1 | Manifest | Fetched over HTTPS without redirects, schema-valid v1, size limits respected, no remote `$ref`, examples valid |
|
|
288
|
+
| C2 | Identity | `agentId` exists in the 8004 Identity registry, its registration points to this manifest, and the manifest `payTo` equals the on-chain `agent_wallet` |
|
|
289
|
+
| C3 | Challenge | Invalid input returns `400` before any `402`. Valid unpaid create-job returns `402` whose single `accepts` entry equals the manifest payment option plus the price. `payTo` has a USDC trustline. |
|
|
290
|
+
| C4 | Paid call | Test payer pays → result matches the `output` schema; on-chain USDC `transfer` to `payTo` for the exact amount |
|
|
291
|
+
| C5 | Recovery | Repeating create-job returns the same job with no second transfer; the same key with other input returns `422`; check-status and get-result work with the token and return `404` without it |
|
|
292
|
+
| C6 | Hygiene | No redirects, no secrets in responses, bounded bodies |
|
|
293
|
+
| C7 | Load | A burst of unpaid create-job requests is answered with `402`, `429` or `503` plus `Retry-After`, never another error or a timeout. With `--pay`, `concurrency + 1` paid jobs are each accepted or refused before settlement. |
|
|
294
|
+
|
|
295
|
+
**Conformance levels** (each maps to one badge): Described = C1 + C6, Payable = + C3 + C4,
|
|
296
|
+
Recoverable = + C5, Registered = C2 plus a Validation Registry record, and Load-safe = C7. `verifier check` runs the no-payment
|
|
297
|
+
checks against any URL. With `--dev` it also accepts a local `http://` server (spec [M6]), so providers can test
|
|
298
|
+
themselves before going live.
|
|
299
|
+
|
|
300
|
+
**Verification receipt:**
|
|
301
|
+
- Canonical JSON containing: standard version, provider `agentId`, manifest sha256, network, a status and
|
|
302
|
+
evidence for each check, payment tx hash, verifier address and timestamps.
|
|
303
|
+
- It is stored under `evidence/receipts/` and published through the evidence page (GitHub Pages).
|
|
304
|
+
|
|
305
|
+
**Badges:** SVGs derived **only** from a receipt.
|
|
306
|
+
- Badge set: one per level, `Standard v1`, `Payment verified`, `Recovery verified`; plus `Load-safe` (C7) and
|
|
307
|
+
`8004 validated` (C2 and a Validation Registry record of the receipt, confirmed on chain).
|
|
308
|
+
- Each badge shows the network.
|
|
309
|
+
|
|
310
|
+
**Validation Registry flow** (contract read from `stellar-8004/contracts/validation-registry`):
|
|
311
|
+
|
|
312
|
+
1. **Provider owner** runs `provider-kit request-validation`, which calls
|
|
313
|
+
`validation_request(caller = owner, validator_address = verifier G…, agent_id, request_uri, request_hash)`.
|
|
314
|
+
- `request_uri` is the verification request document.
|
|
315
|
+
- `request_hash = sha256(document)`, the spec-compliant `contentHash` mode of `generateRequestNonce`.
|
|
316
|
+
2. **Verifier** runs the checks and calls
|
|
317
|
+
`validation_response(caller = verifier, request_hash, response = score 0–100, response_uri = receipt URL, response_hash = sha256(receipt), tag = "provider-standard-v1")`.
|
|
318
|
+
3. Anyone can read the result with `get_validation_status(request_hash)` or `get_agent_validations_paginated`.
|
|
319
|
+
|
|
320
|
+
`response` is higher-is-better (ERC-8004: 0 = failed, 100 = passed). Documents are hashed as
|
|
321
|
+
`sha256(RFC 8785 JCS)`. Both rules are shared with the planned Stellar ERC-8126 records, so the two kinds of
|
|
322
|
+
record never get mixed up in `get_summary` (docs/erc-compatibility.md, T2).
|
|
323
|
+
|
|
324
|
+
Mainnet currently reports `totalValidations: 0`, so these will be among the first real Validation Registry
|
|
325
|
+
records. Stellar Agent Search's deferred P3-10 (validation trust axis) can then read them.
|
|
326
|
+
|
|
327
|
+
### 5.5 Example paid service (`examples/paid-service`)
|
|
328
|
+
|
|
329
|
+
The example is built only with the public `provider-kit` API, so it doubles as the template for pilot providers.
|
|
330
|
+
|
|
331
|
+
| Service | Charge | Price | Behavior |
|
|
332
|
+
| --- | --- | --- | --- |
|
|
333
|
+
| `text-stats` | on-success | 0.01 USDC | Deterministic. Answers `200` at once; failed work is never charged. |
|
|
334
|
+
| `delayed-report` | upfront | 0.02 USDC | Configurable delay. Answers `202`. Used for the Job Recovery demo. |
|
|
335
|
+
|
|
336
|
+
It runs on Hono with `@hono/node-server`. The `.env` holds only the `payTo` public address and the facilitator URL.
|
|
337
|
+
|
|
338
|
+
### 5.6 Payment Client: decided
|
|
339
|
+
|
|
340
|
+
**Decided 2026-10-21.** The design is in [docs/payment-client.md](docs/payment-client.md):
|
|
341
|
+
- One core (`packages/payment-client`) that keeps every safety rule.
|
|
342
|
+
- Two strategies behind it (Strategy pattern, built 2026-10-22 with the built-ins only):
|
|
343
|
+
- signers: a local key, browser wallets through Stellar Wallets Kit, then a passkey smart account
|
|
344
|
+
- payment methods: x402 `exact` on Stellar, the only one v1 allows
|
|
345
|
+
- adapters for other projects (such as Eunomia or an ERC-8196 wallet) come later as separate packages that
|
|
346
|
+
must pass the conformance checks
|
|
347
|
+
- Two surfaces: a static web app for everyone and a keyed MCP server for agents.
|
|
348
|
+
- Policy and journal use ERC-8196 field names. Out of the box, every payment needs approval.
|
|
349
|
+
|
|
350
|
+
The core, the local-key signer, the `stellar-pay` CLI and a minimal web approval page (`apps/wallet`) work end to
|
|
351
|
+
end on testnet. Settlement proof checks the `transfer` event against the approved payment ([J16]).
|
|
352
|
+
|
|
353
|
+
### 5.7 Discovery integration (changes in `stellar-agent-search`, not this repo)
|
|
354
|
+
|
|
355
|
+
- **Testnet discovery gap:** the default explorer (`stellar8004.com`) indexes **mainnet only**, and testnet mode
|
|
356
|
+
refuses to start without `EXPLORER_BASE_URL` (P1-07). The full "find → approve → pay → receive" flow on
|
|
357
|
+
testnet therefore needs one of:
|
|
358
|
+
- **(a, recommended)** a keyless direct-registry mode for testnet: resolve allowlisted agent IDs through
|
|
359
|
+
Soroban reads, then fetch their manifest.
|
|
360
|
+
- (b) running a testnet indexer.
|
|
361
|
+
- (c) doing the pilot on mainnet.
|
|
362
|
+
- **Manifest awareness:** when an agent's service points to a Provider Standard manifest, show its price,
|
|
363
|
+
network, recovery support and badges, with the badges taken from Validation Registry reads.
|
|
364
|
+
- These changes stay read-only and keyless, each in its own small PR to that repo.
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## 6. Four-week schedule
|
|
369
|
+
|
|
370
|
+
The sprint start date is still TBD; day 1 is the date the SOW is signed.
|
|
371
|
+
|
|
372
|
+
### Week 1: Standard, payment client, first paid flow (D1)
|
|
373
|
+
|
|
374
|
+
- [x] Day 1:
|
|
375
|
+
- Testnet accounts: provider `payTo` and test payer. The verifier account waits for the verifier (Week 3).
|
|
376
|
+
- USDC trustlines and testnet USDC.
|
|
377
|
+
- Facilitator `getSupported()` probe: `stellar:testnet` + `exact` is supported, and the facilitator adds no
|
|
378
|
+
limit of its own on the payment authorization window, so the spec's 30–300 range stands.
|
|
379
|
+
- [x] Day 1–2: **Payment client design decision** (§5.6).
|
|
380
|
+
- [x] `docs/provider-standard.md` v1 draft.
|
|
381
|
+
- [x] Manifest JSON Schema, test vectors and reference checks in `packages/protocol` (canonical JSON, binding
|
|
382
|
+
hash, manifest rules, challenge check).
|
|
383
|
+
- [x] Remaining protocol types (job view, job states, errors, receipts), with test vectors.
|
|
384
|
+
- [x] Freeze v1 (2026-10-21, open decision 6).
|
|
385
|
+
- [x] Verification receipt format defined (spec only).
|
|
386
|
+
- [x] Thin provider slice: manifest, create-job with an on-success service, x402 resource server, memory store.
|
|
387
|
+
- [x] Payment client, first working version: approval screen, caps, signing, journal.
|
|
388
|
+
- [x] Core, local-key signer and `stellar-pay` CLI (approval prompt, caps, journal, on-chain check).
|
|
389
|
+
- [x] Minimal web approval page (`apps/wallet`), for the D1 video.
|
|
390
|
+
- [x] One successful testnet payment flow, recorded ([video, screenshots and RPC proof](evidence/d1/README.md)).
|
|
391
|
+
- [x] Testnet tx links.
|
|
392
|
+
- [x] Screenshots and the short video, captured 2026-11-06; public publication remains outstanding.
|
|
393
|
+
- [ ] Start pilot outreach: shortlist 4–5 candidate providers and 6–7 users.
|
|
394
|
+
|
|
395
|
+
**Exit:** spec published, approval-before-payment video, testnet tx link.
|
|
396
|
+
|
|
397
|
+
### Week 2: Provider Kit (D2, part 1)
|
|
398
|
+
|
|
399
|
+
- [x] Full `provider-kit`:
|
|
400
|
+
- `defineService` with schemas, checked at definition time (name, S2, S9) and in the manifest at startup
|
|
401
|
+
- strict payload checks
|
|
402
|
+
- settlement classification
|
|
403
|
+
- SQLite store
|
|
404
|
+
- background runner: leased workers, recovery sweeps, retention
|
|
405
|
+
- both charge policies
|
|
406
|
+
- [x] Gateway mode: `provider-kit serve --config`, a Docker image, tested with a small Python API as upstream.
|
|
407
|
+
- `serve --config`, tested end to end with [examples/python-upstream](examples/python-upstream).
|
|
408
|
+
- Docker image (`packages/provider-kit/Dockerfile`, 295 MB): built and run against the Python API. Real testnet
|
|
409
|
+
facilitator check at startup, a paid call settled once, health check, non-root user, and the job recovered
|
|
410
|
+
from the `/data` volume after a container restart.
|
|
411
|
+
- [ ] Manifest builder and 8004 registration (`provider-kit register`) on testnet.
|
|
412
|
+
- [x] Manifest builder with startup checks; `register` and `check` (reads I1–I3 from the testnet registry).
|
|
413
|
+
- [ ] Run `provider-kit register` for the sample provider on testnet, approved in the owner's wallet.
|
|
414
|
+
- [x] Approving in a wallet: `trustline`, `register` and `request-validation` open a local page (Stellar Wallets
|
|
415
|
+
Kit) where the owner's own wallet signs; `--source` keeps the Stellar CLI keychain for CI. `register` saves the
|
|
416
|
+
new `agentId` to the config. Tested on testnet end to end with `trustline`.
|
|
417
|
+
- [x] `examples/paid-service` with both services, on the SQLite store.
|
|
418
|
+
- [ ] Setup guide (`docs/provider-setup-guide.md`), tested on a clean machine.
|
|
419
|
+
- [x] Written for both paths.
|
|
420
|
+
- [ ] Followed on a clean machine.
|
|
421
|
+
- [x] Payment-safety test suite (§7), provider side.
|
|
422
|
+
- [x] Capacity (spec §5.8): per-service lanes, `429`/`503` before payment and queue positions, on a shared queue
|
|
423
|
+
with worker leases in the store, so queued `upfront` jobs survive a restart [Q4] and workers scale apart from
|
|
424
|
+
the HTTP servers (`runQueuedJobs: false` / `serve --no-workers`).
|
|
425
|
+
|
|
426
|
+
**Exit:** a developer installs the kit from scratch, starts the sample provider and completes a paid request. An
|
|
427
|
+
existing Python API becomes a paid service through gateway mode.
|
|
428
|
+
|
|
429
|
+
### Week 3: Verification and Job Recovery (D2, part 2)
|
|
430
|
+
|
|
431
|
+
- [x] Complete Job Recovery (docs/job-recovery.md):
|
|
432
|
+
- create-job, check-status and get-result
|
|
433
|
+
- `payment_uncertain`
|
|
434
|
+
- reconciliation: automatic after every sweep, and `provider-kit reconcile` (`--dry-run`, `--rpc`)
|
|
435
|
+
- the response-loss drill
|
|
436
|
+
- [x] Record the recovery demo on testnet: one interrupted job, recovered, with exactly one on-chain transfer
|
|
437
|
+
([video, screenshots and bounded event scan](evidence/d2/README.md), 2026-11-06).
|
|
438
|
+
- [x] Payment client recovery: resume from the journal, never re-sign.
|
|
439
|
+
- [x] Payment client: treat `409 request_in_progress` on create-job and while polling as "ask again later".
|
|
440
|
+
- [x] A ledger clock, shared by reconciliation and the kit: an on-success job's deadline from its payment's
|
|
441
|
+
expiration ledger rather than from its claim, so a payment resent late [Q8] isn't worked on after it expired.
|
|
442
|
+
It reads Soroban RPC (latest ledger, close time, average ledger duration) rather than Horizon, so one endpoint
|
|
443
|
+
serves the clock and reconciliation.
|
|
444
|
+
- [x] `verifier`: checks C1–C7, conformance levels, receipt, badges, and the no-payment `check` command
|
|
445
|
+
(docs/verification.md). Paid checks prove payments on chain by the signed nonce, and that refused payments never
|
|
446
|
+
landed; receipts are stored under their own SHA-256, the on-chain `response_hash`.
|
|
447
|
+
- [x] Capture live testnet verification receipts and earned badges; retain failed and skipped checks honestly
|
|
448
|
+
([results](evidence/receipts/README.md)). Bounded polling now lets the same uncertain job reconcile [J13].
|
|
449
|
+
- [x] Validation Registry publishing: `request-validation` (provider) and `validation_response` (verifier) on testnet.
|
|
450
|
+
- [x] `verifier publish`: `validation_response` through the Stellar CLI keychain, after checking the request, the
|
|
451
|
+
receipt and the `response_uri`; the request document is defined in docs/verification.md.
|
|
452
|
+
- [x] `provider-kit request-validation`: the request document as a protocol type, JSON Schema and test vectors;
|
|
453
|
+
the command checks the registration, the signer and the validator, then the owner's wallet signs it (or the
|
|
454
|
+
Stellar CLI keychain, with `--source`).
|
|
455
|
+
- [x] Run both on testnet for registered Oracle sample agent 163; C1–C7 passed, score 100, receipt anchored
|
|
456
|
+
([confirmed registration, request and response](evidence/validation/README.md), 2026-11-06).
|
|
457
|
+
- [x] Testnet direct-registry discovery and manifest service matching reported implemented in `stellar-agent-search`
|
|
458
|
+
([DX phase 4](docs/dx-improvements.md#phase-4-from-nothing-to-live-dev-launch-status)).
|
|
459
|
+
- [ ] Confirm the released discovery path, price/network information and validation-derived badges during the pilot.
|
|
460
|
+
- [ ] Pilot providers start integrating: send them the guide and template.
|
|
461
|
+
|
|
462
|
+
**Exit:**
|
|
463
|
+
- The sample provider has a verification receipt and a Validation Registry record (tx).
|
|
464
|
+
- One interrupted job has been recovered, with exactly one on-chain transfer.
|
|
465
|
+
|
|
466
|
+
### Week 4: Pilot and evidence (D3)
|
|
467
|
+
|
|
468
|
+
- [ ] Two independent providers live: each verified, each with at least one paid call.
|
|
469
|
+
- [ ] Five distinct users complete find → approve → pay → receive, and at least one runs a recovery.
|
|
470
|
+
- [ ] Fix pilot-blocking issues and record them in the pilot report.
|
|
471
|
+
- [x] Sample approval/payment and recovery videos, screenshots and payment references captured.
|
|
472
|
+
- [x] Publish the evidence page, videos, payment references, anchored receipt and registry records.
|
|
473
|
+
- [ ] Add the completed independent pilot report after real participant sessions.
|
|
474
|
+
|
|
475
|
+
**Exit:** every row of the SOW §6.1 evidence table is linked from `evidence/README.md`.
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## 7. Testing strategy
|
|
480
|
+
|
|
481
|
+
**Unit:**
|
|
482
|
+
- canonical JSON (key order and whitespace don't change the hash)
|
|
483
|
+
- manifest schema and test vectors
|
|
484
|
+
- challenge ↔ manifest matching
|
|
485
|
+
- settlement classification
|
|
486
|
+
- job state transitions
|
|
487
|
+
|
|
488
|
+
**Payment safety:** these tests must exist before the pilot.
|
|
489
|
+
- [x] A repeated create-job with the same key and input → same job, no facilitator call, no second charge.
|
|
490
|
+
- [x] The same key with different input or token → `422`. A request while still claiming or settling → `409`.
|
|
491
|
+
A wrong token → `404`.
|
|
492
|
+
- [x] Invalid input → `400` before any `402`.
|
|
493
|
+
- [x] One signed payment presented for two jobs → rejected (fingerprint), also re-signed with the same nonce.
|
|
494
|
+
- [x] A facilitator timeout or 5xx → `payment_uncertain`, never `failed`, never re-charged.
|
|
495
|
+
- [x] An `on-success` handler failure or invalid output → no settlement.
|
|
496
|
+
- [x] `on-success` work that outlasts the payment authorization → job failed, nothing charged.
|
|
497
|
+
- [x] A client without `Idempotency-Key` and `Job-Token` → provider-generated id and token, one charge.
|
|
498
|
+
- [x] A challenge whose amount, payTo, asset or network differs from the manifest → the client refuses to sign.
|
|
499
|
+
- [x] A failed spending-limit check → the payment is blocked (fail closed).
|
|
500
|
+
- [x] A lost response → recovery returns the stored result, with one on-chain transfer. Provider/client behavior
|
|
501
|
+
is tested offline, and [the recorded testnet demo](evidence/d2/README.md) includes a complete bounded transfer scan.
|
|
502
|
+
- [x] An uncertain settlement is decided from the transaction carrying the job's nonce: another job's equal
|
|
503
|
+
transfer never counts, and "not settled" comes only after the expiration ledger closed and the whole window
|
|
504
|
+
was searched. An RPC outage, a window older than the RPC's history, or a ledger still to come leave the job
|
|
505
|
+
waiting.
|
|
506
|
+
- [x] A `409` while the provider settles → the client follows the job and never signs again.
|
|
507
|
+
|
|
508
|
+
**Integration (testnet, manual or CI-gated):** sample provider + verifier + payment client, end to end.
|
|
509
|
+
|
|
510
|
+
**Test hygiene:** use fixed transaction timebounds in fixtures. This is the lesson from the Phase 1 timebounds
|
|
511
|
+
flake.
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
## 8. Evidence plan (maps to SOW §6.1)
|
|
516
|
+
|
|
517
|
+
| Deliverable | Evidence | Location |
|
|
518
|
+
| --- | --- | --- |
|
|
519
|
+
| D1 | Provider Standard v1 | `docs/provider-standard.md` |
|
|
520
|
+
| D1 | Video (price, recipient, spending control, approval → payment), screenshots, testnet tx link | `evidence/d1/` |
|
|
521
|
+
| D2 | Public repo, setup guide | this repo, `docs/provider-setup-guide.md` |
|
|
522
|
+
| D2 | Verification receipt + badges | `evidence/receipts/` |
|
|
523
|
+
| D2 | Validation Registry record (request + response tx) | `evidence/validation/` |
|
|
524
|
+
| D2 | Recovery demo (video + single-transfer proof) | `evidence/d2/` |
|
|
525
|
+
| D3 | Provider links, per-provider paid-call references, screenshots | `evidence/pilot/` |
|
|
526
|
+
| D3 | Pilot report (what worked, failed, was fixed) | `evidence/pilot/report.md` |
|
|
527
|
+
| D3 | Public evidence page | GitHub Pages from `evidence/` |
|
|
528
|
+
|
|
529
|
+
Every transaction is listed with network, hash, ledger and explorer link. Testnet evidence is labeled as testnet
|
|
530
|
+
everywhere.
|
|
531
|
+
|
|
532
|
+
---
|
|
533
|
+
|
|
534
|
+
## 9. Risks
|
|
535
|
+
|
|
536
|
+
| Risk | Impact | Mitigation |
|
|
537
|
+
| --- | --- | --- |
|
|
538
|
+
| Payment client design not settled by W1 day 2 | Misses the D1 Week 1 output | Build the design-independent core first: policy, validation, journal |
|
|
539
|
+
| No testnet 8004 indexer | Discovery step of the pilot flow doesn't work on testnet | Direct-registry testnet mode in `stellar-agent-search` (§5.7) |
|
|
540
|
+
| Testnet facilitator unavailable or unsupported | No settlement | Probe on day 1. If needed, look for another facilitator or self-host a settlement path. |
|
|
541
|
+
| Independent providers late or unresponsive | D3 missed | Start outreach in W1, use the template repo, offer incentives (SOW), keep a backup provider |
|
|
542
|
+
| `validation_request` must be signed by the provider owner | Friction for independent providers | One-command `provider-kit request-validation`, approved in the owner's own wallet |
|
|
543
|
+
| A CLI key for `payTo`, then importing it into a browser wallet to use the income | Friction and a secret key on disk | The owner's existing wallet is `payTo` and signs every owner step on a local approval page (`trustline`, `register`, `request-validation`) |
|
|
544
|
+
| `stellar8004` declares stellar-sdk `^15`; x402 needs `^16.3` | Duplicate SDK copies: 18 MB and a vulnerable axios, and an XDR type mismatch if SDK objects ever cross between them | Root `overrides`, which `create-stellar-service` writes into each project. `scaffold:check` fails a project with two copies; the rehearsal warns about a plain install. |
|
|
545
|
+
| Reviewers expect mainnet evidence (Phase 1 was mainnet) | Evidence questioned | Agree on testnet with the Ambassador Chapter Lead up front; mainnet is optional follow-up |
|
|
546
|
+
| Users need testnet USDC | Pilot friction | Pre-fund pilot wallets from the team test account |
|
|
547
|
+
|
|
548
|
+
---
|
|
549
|
+
|
|
550
|
+
## 10. Open decisions
|
|
551
|
+
|
|
552
|
+
| # | Decision | Owner | Needed by |
|
|
553
|
+
| --- | --- | --- | --- |
|
|
554
|
+
| 1 | ~~Payment client design (§5.6)~~ **Decided 2026-10-21:** docs/payment-client.md | Berkin | W1 day 2 |
|
|
555
|
+
| 2 | SOW provider/user counts reading (§1.1) | Berkin + Ambassador Chapter Lead | Before sprint start |
|
|
556
|
+
| 3 | **Implemented per DX phase 4:** direct Identity Registry scan on testnet; confirm the released flow in the pilot | Berkin | Pilot |
|
|
557
|
+
| 4 | Testnet-only evidence accepted, or a final mainnet run | Berkin + Ambassador Chapter Lead | W2 |
|
|
558
|
+
| 5 | **Released 2026-11-02:** `@stellar-agent-services/*` and `create-stellar-service`, version 0.1.0 | Berkin | Done |
|
|
559
|
+
| 6 | ~~Provider Standard v1 freeze~~ **Decided 2026-10-21, frozen as drafted, except the URL:** `Job-Token` header, manifest path, `maxTimeoutSeconds` range, the URL for the schema `$id` and problem `type` values (`algorialabs.github.io/stellar-agent-services`), plus CORS as SHOULD [J17] | Berkin | W1 |
|
|
560
|
+
| 7 | Shared ERC-8126/8196 conventions: score direction, tags, hashing, policy extensions (docs/erc-compatibility.md) | Berkin + ERC-8126/8196 Stellar team | W1 for hashing, W3 for validation records |
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Stellar Agent Services
|
|
2
|
+
|
|
3
|
+
Phase 2 of [Stellar Agent Search](https://github.com/berkingurcan/stellar-agent-search). It makes it easy for
|
|
4
|
+
developers to offer paid AI services on Stellar, and easy for users to find, hire and pay them safely.
|
|
5
|
+
|
|
6
|
+
Stellar Agent Search finds and evaluates agents (read-only, keyless). This repository adds the provider and
|
|
7
|
+
payment side:
|
|
8
|
+
|
|
9
|
+
| Package | Purpose |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [`packages/protocol`](packages/protocol) | Provider Standard v1 as code (manifest, jobs, receipts) |
|
|
12
|
+
| [`packages/provider-kit`](packages/provider-kit) | Turn a function, or an existing API in any language (gateway mode), into a paid service: pricing, x402 USDC payments, Job Recovery, capacity and queuing |
|
|
13
|
+
| [`packages/payment-client`](packages/payment-client) | Buyer side: approval, spending controls, payment, recovery (proof of concept) |
|
|
14
|
+
| [`packages/verifier`](packages/verifier) | Checks a provider against the standard (C1–C7), issues verification receipts and badges, publishes to the Stellar 8004 Validation Registry. `verifier watch` answers validation requests by itself. |
|
|
15
|
+
| [`packages/dev-mcp`](packages/dev-mcp) | MCP server for coding agents: spec rules, docs, manifest validation, unpaid provider checks. It never pays. |
|
|
16
|
+
| [`packages/create-stellar-service`](packages/create-stellar-service) | `npm create stellar-service`: a new project (an existing API, a TypeScript or a Python service), ready to run, try and deploy |
|
|
17
|
+
| [`apps/wallet`](apps/wallet) | Web page where a person approves and pays a service (testnet) |
|
|
18
|
+
| [`examples/paid-service`](examples/paid-service) | Sample provider and template for pilot providers |
|
|
19
|
+
| [`examples/python-upstream`](examples/python-upstream) | An existing Python API made a paid service with gateway mode |
|
|
20
|
+
|
|
21
|
+
**Status (2026-11-06):** the core packages are released at 0.1.0. The kit, payment client, recovery and verifier
|
|
22
|
+
are implemented. [Sample payment/recovery evidence is public](https://algorialabs.github.io/stellar-agent-services/),
|
|
23
|
+
and live verification receipts and badges are captured in [evidence/](evidence/README.md). Permanent sample
|
|
24
|
+
registration, an anchored validation response and the independent pilot remain. This checkout
|
|
25
|
+
also enforces configured verification policies through an application-trusted source [V1]. The
|
|
26
|
+
[SOW closeout guide](docs/sow-closeout.md) lists the remaining acceptance work, and
|
|
27
|
+
[readiness evidence](evidence/readiness.md) records checks and release references. The full build history is in
|
|
28
|
+
[IMPLEMENTATION_PLAN.md](IMPLEMENTATION_PLAN.md). Development and pilot evidence use Stellar **testnet**.
|
|
29
|
+
|
|
30
|
+
To offer a service, start with [`npm create stellar-service`](packages/create-stellar-service), then:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm create stellar-service my-service
|
|
34
|
+
cd my-service
|
|
35
|
+
npm run dev # runs it, paid to a throwaway testnet account: no wallet needed yet
|
|
36
|
+
npm run try # pays for one call with test money
|
|
37
|
+
npm run launch # goes live: one approval in your wallet registers and verifies it, then Fly.io
|
|
38
|
+
npm run status # where it stands, and what to run next
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The [provider setup guide](docs/provider-setup-guide.md) explains each step.
|
|
42
|
+
|
|
43
|
+
**The standard in short:** [for people](docs/standard/README.md) and [for AI coding agents](docs/standard/README-AI.md).
|
|
44
|
+
The full text is [docs/provider-standard.md](docs/provider-standard.md).
|
|
45
|
+
|
|
46
|
+
## For AI coding agents
|
|
47
|
+
|
|
48
|
+
- [AGENTS.md](AGENTS.md) picks a path (new service, existing API, another language, paying client, verification,
|
|
49
|
+
contributing) and names its reference, rules and definition of done. `CLAUDE.md` points to it.
|
|
50
|
+
- [llms.txt](llms.txt) indexes every document, and [llms-full.txt](llms-full.txt) holds them all in one file.
|
|
51
|
+
- The [Claude Code plugin](plugins/stellar-agent-services) adds a skill for each path:
|
|
52
|
+
`/plugin marketplace add AlgoriaLabs/stellar-agent-services`.
|
|
53
|
+
- The [MCP server](packages/dev-mcp) answers spec questions and checks manifests and providers.
|
|
54
|
+
|
|
55
|
+
## Compatibility
|
|
56
|
+
|
|
57
|
+
We stay compatible with ERC-8126 (agent verification) and ERC-8196 (agent authenticated wallet). See
|
|
58
|
+
[docs/erc-compatibility.md](docs/erc-compatibility.md). Copies of both specs are in [docs/references/](docs/references).
|
|
59
|
+
|
|
60
|
+
## Development
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install
|
|
64
|
+
npm run typecheck
|
|
65
|
+
npm test
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Requires Node 22.13 or later (`.node-version` pins 24).
|
|
69
|
+
|
|
70
|
+
## Security
|
|
71
|
+
|
|
72
|
+
See [SECURITY.md](SECURITY.md). In short:
|
|
73
|
+
|
|
74
|
+
- discovery and provider servers hold no keys
|
|
75
|
+
- only the payment client signs, once, after explicit approval
|
|
76
|
+
- nobody pays twice for one job
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT
|