Simplifying Web Monetization

Ben Sharafian
Jan 18, 2019 · 3 min read

Since Coil’s launch, hundreds of sites have become web-monetized. It’s just a matter of adding a couple of scripts, and you can make money (through Interledger) for every Coil subscriber who visits your site.

Based on feedback from these sites, the Interledger community has reworked the Web Monetization standard, making it even simpler to use. The improvements and trade-offs are listed below. Credit to Michiel de Jong for originally suggesting this idea.

The old way to monetize your site was by including this code snippet:

<script src=""></script>
<script src=""></script>
paymentPointer: '$'

The new way to monetize your site is by adding a single <meta> tag to your page’s <head>:

<meta name="monetization" content="$" />

This feature is available in the Coil extension version 0.0.21 and higher. An upgrade to the open-source Minute extension is in-progress.

The previous Web Monetization standard is still supported for the time being, but we advise that you upgrade.

What has improved?

Loading external scripts into your site is a big risk. The previous version of Web Monetization required external scripts in order to work. For sites that dealt with sensitive data, it could be a deal-breaker.

Web Monetization is now a static HTML tag. That means it can’t be used to compromise any sites.

Loading the Web Monetization polyfill took time and bandwidth. It also needed to be parsed every time you loaded a Web Monetized page.

Now, Web Monetization loads no files into the page. All the logic is handled by your browser extension in the background.

The “donate” script that most sites use to wrap Web Monetization is 450 lines of code. If you tried to use the Web Monetization API directly, it was very easy to make mistakes.

The new Web Monetization standard lets the user’s extension handle the complex logic instead of the page.

Events are still emitted when monetization occurs, so you can still easily add counters and thank-you messages to your sites.

What was sacrificed?

Web Monetization no longer exposes the entire STREAM library. That means you can’t do things like turn the stream on/off, pay to multiple destinations, or other advanced features. What we noticed, though, was that all of these features can be implemented server-side.

For example, a revenue-splitting SPSP server is already implemented for anybody to run. Premium content on the server side is also implemented. As Web Monetization gets more adoption, we expect hosted versions of these services to become available.

The polyfill-based version of Web Monetization used iframe communication to work on some browsers without any extension. Many browsers, such as Safari, didn’t support this flow.

Few people used Web Monetization without an extension, so we decided that it’s easier to always require an extension. This makes things simpler for the user as well as developers.


Interledger Blog

Articles and tutorials from the Interledger community.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store