Skip to content

Feature Request: L402 (Lightning 402) Support with DID-bound Macaroons #75

@hexdaemon

Description

@hexdaemon

Summary

Add L402 support to Archon's Gatekeeper, enabling authenticated paid API access via DID-bound macaroons backed by Lightning invoices and/or Cashu tokens.

Motivation

No existing agent identity system combines cryptographic identity with native economic access control. Archon is uniquely positioned — the Gatekeeper already sits as a reverse proxy with DID verification. Adding L402 turns it into an authenticated payment gateway.

Use Cases

  • Paid DID registration — charge a few sats to register a DID on BTC mainnet
  • Agent-to-agent commerce — agents with Archon DIDs buy services from each other autonomously
  • Per-request API billing — micro-granular access control without API keys or OAuth
  • Delegated spending — humans give agents pre-loaded Cashu tokens as spending budgets

Proposed Flow

  1. Agent presents DID credential to Gatekeeper
  2. Gatekeeper returns HTTP 402 with a Lightning invoice (or accepts Cashu token)
  3. Agent pays the invoice / presents token
  4. Gatekeeper issues an L402 macaroon with DID-bound caveats (identity + payment proof)
  5. Agent uses the macaroon for subsequent API access

Design Considerations

Payment Methods

Method Pros Cons
Lightning invoice Direct settlement, widely supported Requires online routing
Cashu token Offline-capable, privacy (blind sigs), micro-granular, delegatable Requires mint trust

Both should be supported — the agent picks whichever fits its situation.

Cashu + Delegation

Cashu tokens map cleanly to Archon's trust model:

  • Keymaster (human) mints the spending budget as Cashu tokens
  • Gatekeeper (agent-facing) accepts and redeems tokens
  • Agent cannot spend more than what it was given — no wallet key exposure

New Credential Type

A new L402AccessCredential verifiable credential could bind:

  • DID (identity)
  • Payment proof (preimage or Cashu receipt)
  • Access scope and expiry (macaroon caveats)

Competitive Advantage

None of the competitors can do this:

  • agent-did — no payment layer
  • agent-identity-hub — Ethereum-based (slow, expensive)
  • payelink — payments but weak identity

Archon + L402 = only system with native economic identity + paid access control.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions