Skip to content

feat: multi-currency support for payment conditions #243

@melvincarvalho

Description

@melvincarvalho

Currently HTTP 402 payment conditions use a single default balance (satoshi on testnet4). This works well for development and testing — testnet coins have no monetary value, making it safe to experiment with payment flows.

To support a broader range of use cases, the balance check could be extended to match the currency/chain specified in the ACL condition:

"acl:condition": {
  "@type": "PaymentCondition",
  "amount": "10",
  "currency": "tbtc4"
}

The webledger already supports per-currency balances via getBalance(ledger, agent, currency). The upgrade path is:

  • ACL condition specifies currency/chain
  • Server matches against the correct balance
  • Different chains tracked independently
  • Server's --pay-mempool-url determines which chain is verified on deposit

This keeps the current single-currency flow as the default, while allowing opt-in to multi-currency for advanced deployments.

Builds on #239 and #241.

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