Skip to content
Tech News
← Back to articles

X402, a static blog monetization excercise

read original more articles

x402, a static blog monetization excercise

x402

Cloudflare has published an announcement couple of days ago about Monetization Gateway launch. This is revolutionary for many reasons. It removes the high entry barrier for monetization, it lets you have a very precise control over what you charge for and how low the payment can be. This literally can change how we use internet making advertisement economy internet runs on obsolete.

It sounds like an ideal tool to monetize a blog, or an API, for example. And even though I don't have anything to monetize, the technology seems too important for me not to try it out. So let's do just that.

The plan

Unfortunately the Cloudflare service still seems to be in a closed beta(?), meaning you can't get access to it freely as of now, you need to join a waitlist. So what we are left with is to implement the thing ourselves. Which is even more fun, isn't it? Fortunately it sounds like a pretty simple set up. That does add a couple of moving parts to a static blog, though nothing that you can't bolt on top in a day.

So what do we need for the thing to work?

A wallet to receive funds to A worker to execute the payment processing logic A resource we want to paywall

I have items 1 and 3, but not 2. In this role for now I will go with Cloudflare Workers, since I host my site there. This also dictates the choice of a language we will implement the thing on, TypeScript. Maybe later I will reimplement it to be hosted on my local server, but to keep the scope of the experiment manageable - let's stick with cloudflare for now.

The middleware

... continue reading