open-payments icon indicating copy to clipboard operation
open-payments copied to clipboard

JSON-LD namespace for Open Payments specification types

Open jeremiahlee opened this issue 1 year ago • 0 comments

I propose that the JSON-LD namespace for Open Payments be https://interledger.org/ns/open-payments# and request a decision.

(If you are unfamiliar with JSON-LD, I recommend reading this explainer.)

Background

Web Monetization requires associating an Open Payments wallet address with content. WICG/webmonetization/#489 defines how to associate a wallet address with Activity Streams content distributed using ActivityPub. Activity Streams uses the JSON-LD data format. This is necessary in order to use Web Monetization with social web / federated social networks / fediverse applications such as Mastodon (like Twitter), Pixelfed (like Instagram), PeerTube (like YouTube), Lemmy (like Reddit), Castopod, and others.

JSON-LD annotates JSON object properties with types. To add a monetization property to the Activity Streams Profile (user profile) and Note (like a tweet) objects like {"monetization": "https://fybos.me/jeremiah"} we must formally declare a JSON-LD type for monetization.

The monetization value is an Open Payments wallet address. At a minimum, we need a JSON-LD definition that monetization is of the WalletAddress type. (We could go further and define the WalletAddress type, but this is optional since Open Payments clients don’t use JSON-LD.)

JSON-LD types are defined by putting a JSON-LD file with a definition of the type at some IRI. This should be a URL that never changes because JSON-LD documents get "expanded" from {"monetization": "https://fybos.me/jeremiah"} to {"https://interledger.org/ns/open-payments#monetization": "https://fybos.me/jeremiah"}

The common pattern for standards bodies like W3C is to host all of their specifications’ namespaces on their namespace, not a namespace specific to the specification. For example: while ActivityPub has its own specification website at https://activitypub.rocks/, the JSON-LD namespace for ActivityPub is https://www.w3.org/ns/activitystreams# because it’s a technical standard stewarded by the W3C.

Similarly, while Open Payments has its own specification website at https://openpayments.dev/, the JSON-LD namespace for Open Payments should be https://www.w3.org/ns/activitystreams# because it’s a technical standard stewarded by the Interledger Foundation.

Other considerations

Use https://openpayments.dev/ns# as the JSON-LD namespace for Open Payments.

  • Argument: The Open Payments API specification does not rely on the Interledger Protocol.
    • Counter: True. However, the Interledger Foundation has a mission and activities larger than the scope of its eponymous protocol.
  • Argument: The Interledger Foundation is not a standards body itself.
    • Counter: The Interledger Foundation is a non-profit organization already facilitating multi-stakeholder collaboration. The GitHub repository is under the foundation's organization. Any change in governance would require approval by the foundation.
  • Argument: The Interledger Foundation cannot be vendor neutral when it operates the Interledger Wallet service.
    • Counter: The Interledger Foundation operates a flagship service provider for the purpose of kickstarting an ecosystem. It does not intend to compete with service providers in the ecosystem. The Interledger Wallet uses service providers from the ecosystem and is not a registered financial service provider itself.
  • Argument: The Interledger Foundation might not be the best standards body to oversee the Open Payments specification in the future.
    • Counter: If another standards body assumes responsibility for the standard, it could choose to preserve the namespace or introduce a new namespace for future versions of the specification. The Interledger Foundation could redirect the namespace to the new namespace IRI as a courtesy.

This option is acceptable to me if others believe the Interledger Foundation is likely to give up governance of this specification.

Edits

Web Monetization will use the JSON-LD namespace https://webmonetization.org/ns# with the context at https://webmonetization.org/ns.jsonld . https://webmonetization.org/ns#monetization accepts a range of type Wallet Address.

jeremiahlee avatar Jan 14 '25 21:01 jeremiahlee