Skip to content

Commit ffeb851

Browse files
authored
feat: inference marketplace provider tools (#587)
* feat: inference marketplace provider tools (wallet-signed) Add register/update/reveal-key/check/list tools that sign an ownership message with the unlocked payout wallet and call the marketplace gateway. * feat: wire inference marketplace tools into registry * docs: document inference marketplace tools in SKILL.md * fix: allowlist gateway host and bound request timeout Restrict the gateway override to localhost / *.aibtc.com so wallet-signed headers and endpoint apiKey can't be redirected to an arbitrary host by a prompt-injected value; add allowUnsafeGateway escape hatch. Extract resolveGateway helper and add a 15s fetch timeout.
1 parent 885b6ea commit ffeb851

3 files changed

Lines changed: 381 additions & 0 deletions

File tree

skill/SKILL.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,33 @@ Always probe before executing paid endpoints. Never call `execute_x402_endpoint`
214214
See: [references/stacks-defi.md](references/stacks-defi.md) for endpoint catalog
215215
See: [references/x402-inbox.md](references/x402-inbox.md) for inbox-specific flow details
216216

217+
### Inference Marketplace (earn sBTC serving models)
218+
219+
List an OpenAI-compatible model endpoint on the AIBTC Inference Marketplace and
220+
get paid per request in sBTC. Ownership is proven by a wallet signature — the
221+
same wallet that receives payouts — so there are no accounts or API keys. The
222+
tools sign locally with the unlocked wallet and call the gateway, so an agent can
223+
register and manage a listing in one step.
224+
225+
```
226+
"Register my endpoint https://my-host/v1 serving Qwen/Qwen2.5-7B-Instruct on the inference marketplace"
227+
```
228+
229+
| Tool | Description | Signed |
230+
|------|-------------|:------:|
231+
| `inference_register_provider` | Verify + list an endpoint (name, models, payout, optional apiKey) ||
232+
| `inference_update_provider` | Change name/models/payout/endpoint/description/apiKey in place ||
233+
| `inference_reveal_key` | Reveal or rotate the gateway↔endpoint shared key (`rotate: true`) ||
234+
| `inference_check_provider` | Re-run the health/functional probe ||
235+
| `inference_list_providers` | List providers + health (find your id by `payoutAddress`) ||
236+
237+
The gateway verifies the signature recovers to `payoutAddress` (which also fixes
238+
the network), that the endpoint is reachable AND actually serving inference, and
239+
that model ids are real, commercially-licensed Hugging Face repos. Requires an
240+
unlocked wallet on the gateway's network. Every tool takes an optional `gateway`
241+
arg (defaults to `https://inference.aibtc.com`; use `http://localhost:8787` for
242+
local dev).
243+
217244
### Genesis Lifecycle
218245

219246
Agent identity and reputation on Bitcoin and Stacks:

src/tools/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { registerOrdinalsMarketplaceTools } from "./ordinals-marketplace.tools.j
3636
import { registerTaprootMultisigTools } from "./taproot-multisig.tools.js";
3737
import { registerJingswapTools } from "./jingswap.tools.js";
3838
import { registerSigningTools } from "./signing.tools.js";
39+
import { registerInferenceMarketplaceTools } from "./inference-marketplace.tools.js";
3940
import { registerNewsTools } from "./news.tools.js";
4041
import { registerIdentityTools } from "./identity.tools.js";
4142
import { registerCredentialsTools } from "./credentials.tools.js";
@@ -202,6 +203,9 @@ export function registerAllTools(server: McpServer): void {
202203
// Message Signing (BTC BIP-322, Stacks SIWS, SIP-018 structured data, Nostr NIP-01)
203204
registerSigningTools(server);
204205

206+
// AIBTC Inference Marketplace (list/manage a paid model endpoint via wallet signature)
207+
registerInferenceMarketplaceTools(server);
208+
205209
// AIBTC News (signal feed, leaderboard, file signals)
206210
registerNewsTools(server);
207211

0 commit comments

Comments
 (0)