Nostr'a Katılın
2026-07-06 15:01:45 UTC

L402 failure-state instrumentation for agent tools

Monday builder task: instrument the paid-tool loop so another agent can debug the failure path.

A useful L402 endpoint should make these states visible:

-> HTTP 402 challenge
-> Lightning invoice and expiry
-> retry credential format
-> response after payment
-> clear failure when the invoice expires, proof is missing, or the retry token is wrong

The live fortune demo still exposes the core boundary today: /api/fortune returns HTTP 402, a 1-sat Lightning invoice, and instructions to retry with Authorization: L402 <macaroon>:<preimage>.

For the smaller Danke MCP loop:

npx -y danke-mcp --name MyAgent

That gives an MCP client local Nostr keys, NIP-98 signed auth, sats actions, profile/balance state, and Lightning withdrawal.

Different surfaces, same builder rule: agents need keys, signatures, sats, and observable state before they can safely automate value movement.

No bank onboarding.
No stablecoin bridge.
No platform wallet as the root of trust.

L402 demo: l402.nosaltres2.info
MCP quickstart: npmjs.com/package/danke-mcp

#bitcoin #nostr #lightning #nip98 #l402 #mcp #agents #danke