402-announce 1.1.4 → 1.1.5
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 +84 -82
- package/build/announce.d.ts +5 -0
- package/build/announce.js +5 -0
- package/build/announce.js.map +1 -1
- package/build/event.js +24 -2
- package/build/event.js.map +1 -1
- package/llms-full.txt +2 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -56,6 +56,90 @@ console.log('From pubkey:', handle.pubkey)
|
|
|
56
56
|
handle.close()
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
See [`examples/`](./examples) for runnable scripts.
|
|
60
|
+
|
|
61
|
+
## How it fits together
|
|
62
|
+
|
|
63
|
+
```mermaid
|
|
64
|
+
flowchart LR
|
|
65
|
+
subgraph "Your Server"
|
|
66
|
+
API[Your API]
|
|
67
|
+
TB[toll-booth<br/>L402 paywall]
|
|
68
|
+
AN[402-announce]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
subgraph "Nostr Network"
|
|
72
|
+
R1[(Relay 1)]
|
|
73
|
+
R2[(Relay 2)]
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
subgraph "AI Agent"
|
|
77
|
+
MCP[402-mcp<br/>discovery + payment]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
API --> TB
|
|
81
|
+
TB -->|"protects"| API
|
|
82
|
+
AN -->|"kind 31402"| R1
|
|
83
|
+
AN -->|"kind 31402"| R2
|
|
84
|
+
R1 -->|"subscribe"| MCP
|
|
85
|
+
R2 -->|"subscribe"| MCP
|
|
86
|
+
MCP -->|"HTTP + L402 token"| TB
|
|
87
|
+
|
|
88
|
+
style TB fill:#ef4444,color:#fff
|
|
89
|
+
style AN fill:#f59e0b,color:#000
|
|
90
|
+
style MCP fill:#3b82f6,color:#fff
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
1. **[toll-booth](https://github.com/TheCryptoDonkey/toll-booth)** wraps your API with an L402 paywall
|
|
94
|
+
2. **402-announce** publishes a kind 31402 event describing the service, pricing, and payment methods
|
|
95
|
+
3. **[402-mcp](https://github.com/TheCryptoDonkey/402-mcp)** discovers the announcement, pays the invoice, and calls your API
|
|
96
|
+
|
|
97
|
+
## What it does
|
|
98
|
+
|
|
99
|
+
- Builds and signs kind 31402 Nostr events
|
|
100
|
+
- Publishes to one or more Nostr relays in parallel
|
|
101
|
+
- Zeroises secret key bytes after use
|
|
102
|
+
- Degrades gracefully when individual relays fail
|
|
103
|
+
- Provides a `close()` handle for clean disconnection
|
|
104
|
+
|
|
105
|
+
## What it does not do
|
|
106
|
+
|
|
107
|
+
- Does not run an L402 paywall (use [toll-booth](https://github.com/TheCryptoDonkey/toll-booth) for that)
|
|
108
|
+
- Does not subscribe to or search for announcements (use [402-mcp](https://github.com/TheCryptoDonkey/402-mcp) for that)
|
|
109
|
+
- Does not handle payments or token verification
|
|
110
|
+
|
|
111
|
+
## API
|
|
112
|
+
|
|
113
|
+
### `announceService(config): Promise<Announcement>`
|
|
114
|
+
|
|
115
|
+
High-level function that builds, signs, and publishes the event to multiple relays.
|
|
116
|
+
|
|
117
|
+
**Returns** an `Announcement` handle:
|
|
118
|
+
- `eventId` — the published Nostr event ID
|
|
119
|
+
- `pubkey` — the Nostr pubkey derived from your secret key
|
|
120
|
+
- `close()` — disconnect from all relays
|
|
121
|
+
|
|
122
|
+
### `buildAnnounceEvent(secretKey, config): VerifiedEvent`
|
|
123
|
+
|
|
124
|
+
Lower-level function that builds and signs the event without publishing. Useful if you manage relay connections yourself.
|
|
125
|
+
|
|
126
|
+
### Config options
|
|
127
|
+
|
|
128
|
+
| Field | Type | Required | Description |
|
|
129
|
+
|------------------|-------------------|----------|------------------------------------------------|
|
|
130
|
+
| `secretKey` | `string` | yes | 64-char hex Nostr secret key |
|
|
131
|
+
| `relays` | `string[]` | yes | Relay URLs (`wss://` or `ws://`) |
|
|
132
|
+
| `identifier` | `string` | yes | Unique listing ID (Nostr `d` tag) |
|
|
133
|
+
| `name` | `string` | yes | Human-readable service name |
|
|
134
|
+
| `url` | `string` | yes | HTTP endpoint for the service |
|
|
135
|
+
| `about` | `string` | yes | Short description |
|
|
136
|
+
| `pricing` | `PricingDef[]` | yes | Per-capability pricing |
|
|
137
|
+
| `paymentMethods` | `string[]` | yes | Accepted payment methods |
|
|
138
|
+
| `picture` | `string` | no | Icon URL |
|
|
139
|
+
| `topics` | `string[]` | no | Topic tags for filtering |
|
|
140
|
+
| `capabilities` | `CapabilityDef[]` | no | Capability details (stored in event content) |
|
|
141
|
+
| `version` | `string` | no | Service version (stored in event content) |
|
|
142
|
+
|
|
59
143
|
## Announce flow
|
|
60
144
|
|
|
61
145
|
```mermaid
|
|
@@ -128,74 +212,6 @@ The event content is a JSON object with optional fields:
|
|
|
128
212
|
}
|
|
129
213
|
```
|
|
130
214
|
|
|
131
|
-
## API
|
|
132
|
-
|
|
133
|
-
### `announceService(config): Promise<Announcement>`
|
|
134
|
-
|
|
135
|
-
High-level function that builds, signs, and publishes the event to multiple relays.
|
|
136
|
-
|
|
137
|
-
**Returns** an `Announcement` handle:
|
|
138
|
-
- `eventId` — the published Nostr event ID
|
|
139
|
-
- `pubkey` — the Nostr pubkey derived from your secret key
|
|
140
|
-
- `close()` — disconnect from all relays
|
|
141
|
-
|
|
142
|
-
### `buildAnnounceEvent(secretKey, config): VerifiedEvent`
|
|
143
|
-
|
|
144
|
-
Lower-level function that builds and signs the event without publishing. Useful if you manage relay connections yourself.
|
|
145
|
-
|
|
146
|
-
### Config options
|
|
147
|
-
|
|
148
|
-
| Field | Type | Required | Description |
|
|
149
|
-
|------------------|-------------------|----------|------------------------------------------------|
|
|
150
|
-
| `secretKey` | `string` | yes | 64-char hex Nostr secret key |
|
|
151
|
-
| `relays` | `string[]` | yes | Relay URLs (`wss://` or `ws://`) |
|
|
152
|
-
| `identifier` | `string` | yes | Unique listing ID (Nostr `d` tag) |
|
|
153
|
-
| `name` | `string` | yes | Human-readable service name |
|
|
154
|
-
| `url` | `string` | yes | HTTP endpoint for the service |
|
|
155
|
-
| `about` | `string` | yes | Short description |
|
|
156
|
-
| `pricing` | `PricingDef[]` | yes | Per-capability pricing |
|
|
157
|
-
| `paymentMethods` | `string[]` | yes | Accepted payment methods |
|
|
158
|
-
| `picture` | `string` | no | Icon URL |
|
|
159
|
-
| `topics` | `string[]` | no | Topic tags for filtering |
|
|
160
|
-
| `capabilities` | `CapabilityDef[]` | no | Capability details (stored in event content) |
|
|
161
|
-
| `version` | `string` | no | Service version (stored in event content) |
|
|
162
|
-
|
|
163
|
-
## How it fits together
|
|
164
|
-
|
|
165
|
-
```mermaid
|
|
166
|
-
flowchart LR
|
|
167
|
-
subgraph "Your Server"
|
|
168
|
-
API[Your API]
|
|
169
|
-
TB[toll-booth<br/>L402 paywall]
|
|
170
|
-
AN[402-announce]
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
subgraph "Nostr Network"
|
|
174
|
-
R1[(Relay 1)]
|
|
175
|
-
R2[(Relay 2)]
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
subgraph "AI Agent"
|
|
179
|
-
MCP[402-mcp<br/>discovery + payment]
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
API --> TB
|
|
183
|
-
TB -->|"protects"| API
|
|
184
|
-
AN -->|"kind 31402"| R1
|
|
185
|
-
AN -->|"kind 31402"| R2
|
|
186
|
-
R1 -->|"subscribe"| MCP
|
|
187
|
-
R2 -->|"subscribe"| MCP
|
|
188
|
-
MCP -->|"HTTP + L402 token"| TB
|
|
189
|
-
|
|
190
|
-
style TB fill:#ef4444,color:#fff
|
|
191
|
-
style AN fill:#f59e0b,color:#000
|
|
192
|
-
style MCP fill:#3b82f6,color:#fff
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
1. **[toll-booth](https://github.com/TheCryptoDonkey/toll-booth)** wraps your API with an L402 paywall
|
|
196
|
-
2. **402-announce** publishes a kind 31402 event describing the service, pricing, and payment methods
|
|
197
|
-
3. **[402-mcp](https://github.com/TheCryptoDonkey/402-mcp)** discovers the announcement, pays the invoice, and calls your API
|
|
198
|
-
|
|
199
215
|
## Security
|
|
200
216
|
|
|
201
217
|
- Secret key bytes are zeroised immediately after signing (in both `announceService` and `buildAnnounceEvent`)
|
|
@@ -203,20 +219,6 @@ flowchart LR
|
|
|
203
219
|
- Relay connections use a 10-second timeout to prevent hanging
|
|
204
220
|
- Individual relay failures are logged as warnings but don't reject the promise
|
|
205
221
|
|
|
206
|
-
## What it does
|
|
207
|
-
|
|
208
|
-
- Builds and signs kind 31402 Nostr events
|
|
209
|
-
- Publishes to one or more Nostr relays in parallel
|
|
210
|
-
- Zeroises secret key bytes after use
|
|
211
|
-
- Degrades gracefully when individual relays fail
|
|
212
|
-
- Provides a `close()` handle for clean disconnection
|
|
213
|
-
|
|
214
|
-
## What it does not do
|
|
215
|
-
|
|
216
|
-
- Does not run an L402 paywall (use [toll-booth](https://github.com/TheCryptoDonkey/toll-booth) for that)
|
|
217
|
-
- Does not subscribe to or search for announcements (use [402-mcp](https://github.com/TheCryptoDonkey/402-mcp) for that)
|
|
218
|
-
- Does not handle payments or token verification
|
|
219
|
-
|
|
220
222
|
## Ecosystem
|
|
221
223
|
|
|
222
224
|
| Package | Purpose |
|
package/build/announce.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ import type { AnnounceConfig, Announcement } from './types.js';
|
|
|
8
8
|
* Relay failures are logged but do not reject the promise -- the function
|
|
9
9
|
* degrades gracefully. A warning is emitted if *no* relay accepted the event.
|
|
10
10
|
*
|
|
11
|
+
* **SSRF note:** Relay URLs are checked against known private/loopback address
|
|
12
|
+
* patterns, but DNS rebinding (a hostname that resolves to a private IP at
|
|
13
|
+
* connection time) is not caught. Deploy behind network-level egress controls
|
|
14
|
+
* in production environments.
|
|
15
|
+
*
|
|
11
16
|
* @throws If the relay list is empty or contains invalid URLs.
|
|
12
17
|
*/
|
|
13
18
|
export declare function announceService(config: AnnounceConfig): Promise<Announcement>;
|
package/build/announce.js
CHANGED
|
@@ -10,6 +10,11 @@ import { isPrivateHost } from './utils.js';
|
|
|
10
10
|
* Relay failures are logged but do not reject the promise -- the function
|
|
11
11
|
* degrades gracefully. A warning is emitted if *no* relay accepted the event.
|
|
12
12
|
*
|
|
13
|
+
* **SSRF note:** Relay URLs are checked against known private/loopback address
|
|
14
|
+
* patterns, but DNS rebinding (a hostname that resolves to a private IP at
|
|
15
|
+
* connection time) is not caught. Deploy behind network-level egress controls
|
|
16
|
+
* in production environments.
|
|
17
|
+
*
|
|
13
18
|
* @throws If the relay list is empty or contains invalid URLs.
|
|
14
19
|
*/
|
|
15
20
|
export async function announceService(config) {
|
package/build/announce.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announce.js","sourceRoot":"","sources":["../src/announce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG1C
|
|
1
|
+
{"version":3,"file":"announce.js","sourceRoot":"","sources":["../src/announce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG1C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAsB;IAC1D,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM,CAAA;IAC/C,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAA;IAEtC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,6CAA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,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1B,QAAQ,EAAE,CAAA;IACZ,CAAC,CAAC,CACH,CAAA;IAED,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,CAAC,qCAAqC,MAAM,CAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACrI,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAA;IAC7D,CAAC;IAED,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,EAAE;QACjB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,KAAK;YACH,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;gBACpC,IAAI,CAAC;oBACH,KAAK,CAAC,KAAK,EAAE,CAAA;gBACf,CAAC;gBAAC,MAAM,CAAC;oBACP,sBAAsB;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/build/event.js
CHANGED
|
@@ -17,14 +17,22 @@ export function buildAnnounceEvent(secretKeyHex, config) {
|
|
|
17
17
|
}
|
|
18
18
|
// M1: Validate url field (scheme only — this function serialises the URL
|
|
19
19
|
// into event tags without performing network I/O, so private hosts are allowed)
|
|
20
|
-
|
|
20
|
+
const urlLower = config.url.toLowerCase();
|
|
21
|
+
if (!urlLower.startsWith('http://') && !urlLower.startsWith('https://')) {
|
|
21
22
|
throw new Error('config.url must start with http:// or https://');
|
|
22
23
|
}
|
|
24
|
+
if (config.url.length > 2048) {
|
|
25
|
+
throw new Error('config.url must not exceed 2048 characters');
|
|
26
|
+
}
|
|
23
27
|
// M1: Validate picture field when present
|
|
24
28
|
if (config.picture !== undefined) {
|
|
25
|
-
|
|
29
|
+
const picLower = config.picture.toLowerCase();
|
|
30
|
+
if (!picLower.startsWith('http://') && !picLower.startsWith('https://')) {
|
|
26
31
|
throw new Error('config.picture must start with http:// or https://');
|
|
27
32
|
}
|
|
33
|
+
if (config.picture.length > 2048) {
|
|
34
|
+
throw new Error('config.picture must not exceed 2048 characters');
|
|
35
|
+
}
|
|
28
36
|
}
|
|
29
37
|
// M2: Validate identifier is non-empty and within length limit
|
|
30
38
|
if (config.identifier.trim().length === 0) {
|
|
@@ -120,6 +128,20 @@ export function buildAnnounceEvent(secretKeyHex, config) {
|
|
|
120
128
|
}
|
|
121
129
|
const contentObj = {};
|
|
122
130
|
if (config.capabilities) {
|
|
131
|
+
if (config.capabilities.length > 100) {
|
|
132
|
+
throw new Error('config.capabilities must not exceed 100 entries');
|
|
133
|
+
}
|
|
134
|
+
for (const cap of config.capabilities) {
|
|
135
|
+
if (cap.name.trim().length === 0) {
|
|
136
|
+
throw new Error('config.capabilities name must not be empty or whitespace-only');
|
|
137
|
+
}
|
|
138
|
+
if (cap.name.length > 128) {
|
|
139
|
+
throw new Error('config.capabilities name must not exceed 128 characters');
|
|
140
|
+
}
|
|
141
|
+
if (cap.description.length > 4096) {
|
|
142
|
+
throw new Error('config.capabilities description must not exceed 4096 characters');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
123
145
|
contentObj.capabilities = config.capabilities;
|
|
124
146
|
}
|
|
125
147
|
if (config.version) {
|
package/build/event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAIvC;;;;;;;;;GASG;AACH,MAAM,UAAU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AClC,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAA;gBACpF,CAAC;YACH,CAAC;YACD,UAAU,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAA;QAC/C,CAAC;QACD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QACrC,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAC1C,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;QAChE,CAAC;QAED,MAAM,KAAK,GAAG,aAAa,CACzB;YACE,IAAI,EAAE,kBAAkB;YACxB,IAAI;YACJ,OAAO;YACP,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;SAC1C,EACD,EAAE,CACH,CAAA;QAED,OAAO,KAAK,CAAA;IACd,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACZ,CAAC;AACH,CAAC"}
|
package/llms-full.txt
CHANGED
|
@@ -48,6 +48,8 @@ PricingDef:
|
|
|
48
48
|
CapabilityDef:
|
|
49
49
|
- name (string): Capability name
|
|
50
50
|
- description (string): Human-readable description
|
|
51
|
+
- schema (unknown, optional): JSON Schema describing the capability's input parameters
|
|
52
|
+
- outputSchema (unknown, optional): JSON Schema describing the capability's output
|
|
51
53
|
|
|
52
54
|
**Returns** Announcement:
|
|
53
55
|
- eventId (string): The published Nostr event ID
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "402-announce",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Announce HTTP 402 services (L402 and x402) on Nostr for decentralised discovery. Kind 31402 parameterised replaceable events.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"machine-payments",
|
|
51
51
|
"http-402"
|
|
52
52
|
],
|
|
53
|
+
"homepage": "https://github.com/TheCryptoDonkey/402-announce",
|
|
53
54
|
"repository": {
|
|
54
55
|
"type": "git",
|
|
55
56
|
"url": "https://github.com/TheCryptoDonkey/402-announce.git"
|