Skip to content

Multi-token support per pod #192

Description

@melvincarvalho

Summary

Support multiple tokens per pod, each with its own ticker and rate. The token trail layer (token.js) is already multi-token capable — trails are stored per-ticker at .well-known/token/<ticker>.json and transferToken() is parameterized by ticker.

Levels of ambition

Level 1: Multi-token config (~50 LOC)

  • New flag: --pay-tokens "PODS:10,ACCESS:5,VIP:100" (ticker:rate pairs)
  • .buy requires { ticker, amount } instead of defaulting to single token
  • .info returns array of available tokens with rates
  • .sell/.swap already carry ticker per offer — no change needed
  • Backward compatible: --pay-token PODS --pay-rate 10 still works as single-token shorthand

Level 2: Token-gated resources (~100 LOC)

  • Gate specific paths by token instead of sats: /pay/premium/* costs 1 VIP token
  • Config: --pay-gate "/pay/premium:VIP:1,/pay/data:ACCESS:1"
  • Middleware deducts from token trail instead of webledger for gated paths
  • Useful for agents needing different capabilities at different token costs

Level 3: Token-to-token swaps (~150 LOC)

  • Sell orders become two-sided: sell token X for token Y (or sats)
  • Swap executes two trail transfers atomically
  • Emergent price discovery between pod tokens

Design considerations

  • Discovery: .info returns all tokens — agents can self-discover pricing
  • Cross-pod portability: MRC20 proofs are already portable (withdraw on pod A, deposit on pod B)
  • Token as reputation: Pods could check holdings from other pods before granting access
  • Minting permissions: Currently owner-only via CLI — consider whether users can create tokens

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