agentic-wallet-mcp 0.2.0 → 0.3.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/README.md +21 -24
- package/package.json +6 -5
- package/dist/server-bundle.cjs +0 -22101
package/README.md
CHANGED
|
@@ -8,14 +8,12 @@ through Wallet BE's HSM.
|
|
|
8
8
|
|
|
9
9
|
- **x401** proof → [`x401-zetrix-client`](https://www.npmjs.com/package/x401-zetrix-client) (npm)
|
|
10
10
|
- **x402** payment → [`x402-zetrix-client`](https://www.npmjs.com/package/x402-zetrix-client) (npm)
|
|
11
|
-
- **VC presentation** (BBS+ VP derivation) → MBI RS (`/v1/vp/ext/create` + `/v1/vp/ext/submit`, `includeVp: true`
|
|
11
|
+
- **VC presentation** (BBS+ VP derivation) → MBI RS (`/v1/vp/ext/create` + `/v1/vp/ext/submit`, `includeVp: true`)
|
|
12
12
|
- **issuer key resolution** (for the OID4VP submit body) → the Zetrix ZID resolver (`https://zid-resolver[-sandbox].zetrix.com`)
|
|
13
13
|
- **holder key custody + signing** → Wallet BE softHSM (`/wallet/hsm/*`)
|
|
14
14
|
- **VC issuance** → MBI RS (`/v1/vc/pay/*`)
|
|
15
15
|
|
|
16
|
-
[`docs/
|
|
17
|
-
endpoint/contract map, [`docs/DEVELOPMENT_CHECKLIST.md`](docs/DEVELOPMENT_CHECKLIST.md) has status,
|
|
18
|
-
and [`docs/USAGE_FLOW.md`](docs/USAGE_FLOW.md) has a full end-to-end prompt script (onboarding →
|
|
16
|
+
[`docs/USAGE_FLOW.md`](docs/USAGE_FLOW.md) has a full end-to-end prompt script (onboarding →
|
|
19
17
|
VC issuance → identity proof → pay-per-use).
|
|
20
18
|
|
|
21
19
|
## Tools
|
|
@@ -51,8 +49,7 @@ VC issuance → identity proof → pay-per-use).
|
|
|
51
49
|
> resolves the issuer's DID document via the Zetrix ZID resolver, and matches the BBS+
|
|
52
50
|
> (`publicKeyMultibase`) and Ed25519 (`publicKeyHex`) verification methods referenced by the VC's
|
|
53
51
|
> own proofs. `issuerKeys` is still accepted as a manual escape hatch if the resolver is ever
|
|
54
|
-
> unreachable.
|
|
55
|
-
> source that led to this.
|
|
52
|
+
> unreachable.
|
|
56
53
|
|
|
57
54
|
## Install
|
|
58
55
|
|
|
@@ -81,10 +78,10 @@ Node ≥ 18 required (built-in `fetch`).
|
|
|
81
78
|
| `HOLDER_DID` | no | Holder DID. Omit and the MCP derives it automatically — see "Onboarding" below |
|
|
82
79
|
| `WALLET_BE_URL` | no | Wallet BE base URL override (HSM `/wallet/hsm/sign-blob`) — auto-derived from `ZETRIX_NETWORK` when not set |
|
|
83
80
|
| `MBI_BASE_URL` | no | MBI RS base URL override (`/v1/vc/pay/apply`) — auto-derived from `ZETRIX_NETWORK` when not set |
|
|
84
|
-
| `OID4VP_BASE_URL` | no | OID4VP verifier base URL override — auto-derived from `ZETRIX_NETWORK` by the x401 SDK when not set
|
|
81
|
+
| `OID4VP_BASE_URL` | no | OID4VP verifier base URL override — auto-derived from `ZETRIX_NETWORK` by the x401 SDK when not set |
|
|
85
82
|
| `ZETRIX_NODE_HOST` / `ZETRIX_NODE_PORT` | no | RPC node override (auto-derived from network) |
|
|
86
83
|
| `ZID_RESOLVER_BASE_URL` | no | ZID resolver override (auto-derived from network: sandbox for testnet, prod for mainnet) |
|
|
87
|
-
| `MAX_PAYMENT_AMOUNT` | no** | Per-asset x402 auto-pay cap — JSON `{ "<asset>": "<maxRawUnits>", "*": "<fallback>" }
|
|
84
|
+
| `MAX_PAYMENT_AMOUNT` | no** | Per-asset x402 auto-pay cap — JSON `{ "<asset>": "<maxRawUnits>", "*": "<fallback>" }`. `pay_and_fetch`/`subscribe_and_issue` are asset-agnostic: the resource server's 402 challenge may quote the native ZETRIX token (asset code `ZTX`) **or** a ZTP20 token (e.g. `JMYR`) — cap whichever assets you expect, e.g. `{"ZTX":"1000000000","JMYR":"5000000","*":"0"}`. Unset = no cap enforced. |
|
|
88
85
|
|
|
89
86
|
\* sensitive — never logged.
|
|
90
87
|
|
|
@@ -129,11 +126,12 @@ network:
|
|
|
129
126
|
|
|
130
127
|
Only set any of the four explicitly if you run your own instance of that service instead of the
|
|
131
128
|
default one — an explicit value always wins over the network default. The `*.myegdev.com`
|
|
132
|
-
(testnet) hosts are
|
|
133
|
-
|
|
129
|
+
(testnet) hosts are public endpoints — no VPN needed; if you're on a corporate VPN and one of
|
|
130
|
+
them times out, disconnecting it is more likely to fix that than connecting it. See "Network
|
|
131
|
+
reachability & troubleshooting" below.
|
|
134
132
|
|
|
135
133
|
That's the complete list — no VC-MCP subprocess, no BaaS gateway key, no manually-configured
|
|
136
|
-
BBS+ key to set up
|
|
134
|
+
BBS+ key to set up.
|
|
137
135
|
|
|
138
136
|
## Configuring in Claude Desktop / Claude Code
|
|
139
137
|
|
|
@@ -202,12 +200,12 @@ either way, restart the server afterward (env vars load once, at process start).
|
|
|
202
200
|
`heldCredentials`; the response tells you whether the agent-identity credential you need is
|
|
203
201
|
already there. Skip to Phase 3 if so.
|
|
204
202
|
|
|
205
|
-
**Phase 2 — `subscribe_and_issue` — VC issuance
|
|
203
|
+
**Phase 2 — `subscribe_and_issue` — VC issuance.**
|
|
206
204
|
`{ templateId, attributes }` → holder-signs the payload via Wallet BE → MBI's x402 `402` →
|
|
207
205
|
self-pay → MBI settles **and** issues the VC in one call. **Hold onto the returned `vc`** — it's
|
|
208
206
|
what you pass into every future `prove_identity` call.
|
|
209
207
|
|
|
210
|
-
**Phase 3 — `prove_identity` — x401 identity proof
|
|
208
|
+
**Phase 3 — `prove_identity` — x401 identity proof.**
|
|
211
209
|
`{ proofRequest, vc }` (omit `revealAttribute`/`issuerKeys` — both now resolve automatically).
|
|
212
210
|
Internally: fetch the OID4VP presentation definition → derive the BBS+ selective-disclosure VP
|
|
213
211
|
via MBI (`/vp/ext/create` + `/vp/ext/submit`, `includeVp: true`) → resolve the issuer's
|
|
@@ -217,23 +215,23 @@ resource server happens outside this MCP, in whatever drove the conversation. Se
|
|
|
217
215
|
`PROOF-REQUEST` header" section in [`docs/USAGE_FLOW.md`](docs/USAGE_FLOW.md) for the exact wire
|
|
218
216
|
structure and field semantics.
|
|
219
217
|
|
|
220
|
-
**Phase 4 — `pay_and_fetch` — pay-per-use
|
|
218
|
+
**Phase 4 — `pay_and_fetch` — pay-per-use.**
|
|
221
219
|
`{ url, method?, headers?, body? }` → fetch → on `402`, self-pay → retry with `X-PAYMENT`.
|
|
222
220
|
Independent of Phases 2/3 — no VC or identity proof involved, just a fresh payment per call.
|
|
223
221
|
|
|
224
222
|
## Network reachability & troubleshooting
|
|
225
223
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
224
|
+
The `*.myegdev.com` testnet endpoints are public — no VPN needed to reach them. One dependency
|
|
225
|
+
sits behind a CDN edge (see the ZID resolver row below). When something that worked before
|
|
226
|
+
suddenly times out or 403s, check this table before assuming a code regression.
|
|
229
227
|
|
|
230
228
|
| Symptom | Cause | Fix / status |
|
|
231
229
|
|---|---|---|
|
|
232
|
-
| `Wallet BE /wallet/hsm/sign-blob request failed <- fetch failed <- UND_ERR_CONNECT_TIMEOUT` (or same for `mbi-vc.myegdev.com`) |
|
|
233
|
-
| `VP derivation failed <- ZID resolver HTTP 403 ... cf-mitigated: challenge` | ZID resolver (`zid-resolver-sandbox.zetrix.com`)
|
|
230
|
+
| `Wallet BE /wallet/hsm/sign-blob request failed <- fetch failed <- UND_ERR_CONNECT_TIMEOUT` (or same for `mbi-vc.myegdev.com`) | Transient network issue, or (if you're on a corporate VPN) the VPN routing away from the public internet | If you're on a VPN, try disconnecting it and retrying. Verify reachability directly: `curl -I https://wallet-api.myegdev.com/server` |
|
|
231
|
+
| `VP derivation failed <- ZID resolver HTTP 403 ... cf-mitigated: challenge` | ZID resolver (`zid-resolver-sandbox.zetrix.com`) sitting behind a Cloudflare **managed challenge** that blocks plain server-to-server `fetch` | Server-to-server access to the resolver must be allowlisted so it returns `200` directly. If the challenge is active, `prove_identity`'s `issuerKeys` input is the fallback — fetch the DID document via a real browser (it clears the JS challenge) and pass its `verificationMethod` entries' `publicKeyMultibase` (BBS+) / `publicKeyHex` (Ed25519) directly. |
|
|
234
232
|
| `OID4VP backend returned a malformed presentation definition` | Historical SDK bug: the live sandbox's `GET /v1/presentation/{id}` response has no `expires_at` field, but the SDK guard required one | **Fixed** in `x401-zetrix-client` — `expiresAt` is now optional on `PresentationDefinition`. If you see this, you're on a stale cached `npx` install — clear it (`npx clear-npx-cache` or bump the version) to pick up the current published `agentic-wallet-mcp`. |
|
|
235
233
|
| `SUBMIT_FAILED: OID4VP backend returned 401 ... Missing X-Wallet-Public-Key header` | Historical SDK gap: `POST /v1/presentation/submit` requires wallet-auth headers (`X-Wallet-Public-Key` / `X-Wallet-Signed-Data`, holder signs their own address) that the SDK didn't send | **Fixed** — `X401Wallet` now accepts an injected `submitAuth` provider and the wallet wires it automatically; nothing to configure. |
|
|
236
|
-
| `MBI /vp/ext/submit did not return vp` | MBI's `includeVp` opt-in
|
|
234
|
+
| `MBI /vp/ext/submit did not return vp` | MBI's `includeVp` opt-in not deployed on the target instance | Deployed on the sandbox (`mbi-vc.myegdev.com`). If you see this against a different MBI instance, that instance needs the same rollout. |
|
|
237
235
|
|
|
238
236
|
## Security notes
|
|
239
237
|
|
|
@@ -241,8 +239,7 @@ observed so far, the code was correct and the network/edge state had changed.
|
|
|
241
239
|
Wallet BE's HSM (`/wallet/hsm/*`); `walletCfg.privateKey` is always `''`.
|
|
242
240
|
- **`MAX_PAYMENT_AMOUNT` is the real control against unbounded auto-spend** — see Environment
|
|
243
241
|
above. Without it, `pay_and_fetch`/`subscribe_and_issue` will pay whatever a server's `402`
|
|
244
|
-
challenge demands, up to the HSM account's balance.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
could just as easily drive the confirmation.
|
|
242
|
+
challenge demands, up to the HSM account's balance. An agent-side "confirm before paying" step
|
|
243
|
+
is not a real security boundary: the same prompt injection or bad instruction that drove the
|
|
244
|
+
call in the first place could just as easily drive the confirmation.
|
|
248
245
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-wallet-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Agent-facing MCP wallet for Zetrix — orchestrates x401 identity proof, x402 payment, and MBI VC issuance",
|
|
5
5
|
"keywords": ["mcp", "model-context-protocol", "zetrix", "wallet", "x401", "x402", "blockchain"],
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "MyEG Services Berhad",
|
|
8
|
-
"homepage": "https://
|
|
8
|
+
"homepage": "https://github.com/Zetrix-Chain/zetrix-agentic-wallet",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://
|
|
11
|
+
"url": "https://github.com/Zetrix-Chain/zetrix-agentic-wallet.git"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://
|
|
14
|
+
"url": "https://github.com/Zetrix-Chain/zetrix-agentic-wallet/issues"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"engines": {
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
36
36
|
"x401-zetrix-client": "^0.2.1",
|
|
37
|
-
"x402-zetrix-client": "^0.2.2"
|
|
37
|
+
"x402-zetrix-client": "^0.2.2",
|
|
38
|
+
"zetrix-sdk-nodejs": "^1.0.3"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@types/node": "^20.0.0",
|