Artifact Content
Not logged in

Artifact ee93845c85982d2b2cb3fc9611a4b89c2bea7d02:

title: Web Monetization

draft: 1

Web Monetization

Web Monetization is a proposed browser API that uses ILP micropayments to monetize a site. It can be polyfilled by extensions, or can be implemented directly into an ILP-enabled browser.



Design Goals

Relation to Other Protocols

The reason this is not using the W3C Web Payments API is that Web Monetization is intended for continuous payments rather than discrete payments. It is also not designed to have any user interaction. The idea is to provide a direct alternative to advertisements, rather than an alternative to existing checkout methods.

With advertisements, the browser decides whether to display the ads and the user decides whether to engage with the ads. With Web Monetization, the browser decides whether to pay the site and, if so, how much to pay.

Web Monetization makes use of Payment Pointers in order to associate a site with an ILP destination, and SPSP in order to set up ILP payments.

The browser or browser extension which provides Web Monetization will likely use the Ledger Plugin Interface in order to trigger payment when a site requests it.




window.monetize({ receiver: string }) -> Promise<void>

Request the user's browser or Web Monetization extension to send money to the specified receiver. If the browser does not support Web Monetization and there is no Web Monetization extension, this function will not be defined.

If this call is successful, the user's browser will begin to send payment to the receiver by resolving it as a payment pointer and then using SPSP. If receiver does not begin with a $ then it will be queried as an SPSP endpoint as a URL directly.

The amount of money that the user decides to send is up to them. The user SHOULD pay continuously with time, and SHOULD only pay when the user has the monetized page active.

This function does not guarantee that the user has paid the server. The backend which runs the SPSP receiver will have to be queried in order to confirm how much has been paid to a specific receiver.

Name Type Description
opts Object The options for monetization.
opts.receiver String The payment pointer or SPSP endpoint to which ILP payments should be sent.

Promise<void> - A promise which resolves if the user decides to send money to the page.

Rejects with Error if the user's browser decides not to send money to this page.