It is no secret that Nano has the potential to modernize API payments. A feeless, instant cryptocurrency with no minimum spend amount - at face value, it seems like the logical go-to for API payments, yet we don't really see people taking advantage of that. In this article, I will try to cover my own theories and insights as to why that could be.
Pay-per-call vs traditional model
The traditional model, which we are all too familiar with, requires users to top up their balance through a dashboard in order to generate an API key and start using the service. Each API call then deducts a fixed amount from the user's balance if the call is successful.
While this payment model is used the most, it has its drawbacks, which have always felt frustrating. Finished using the service? Too bad - the remaining balance just sits in your virtual wallet forever. Only some providers allow you to cash it out, but that adds even more friction.
So how could Nano shine in this space? Let's explore the options.
A pay-per-API-call model sounds great in theory, but it also comes with challenges! I've thought about this problem on numerous occasions, and the main approaches I've come up with are:
A two-request approach.
The user first sends an API request to retrieve an ephemeral payment address and the required amount. They then send Nano to that address and include the block hash in a second request so the server can validate the payment before processing the original request.
Pretty simple, but this would require around 3-4 work-generations per API-call and would produce a lot of requests, this is inefficient and confusing.
A single-request approach.
The user already knows the destination address and required amount from a global index (for example, a dictionary mapping API routes to addresses and costs). User then sends a signed unprocessed Nano block as part of the request (a header, for example), which is then verified and processed by the backend (including proof-of-work generation).
The second approach requires more abstract thinking, but I generally consider it better. It reduces the number of requests and avoids the need for an additional round-trip just to obtain payment details. In the single-request model, most validation happens server-side, which could ultimately provide a smoother user experience.
For API developers, the latter would also be more consistent - no need to cache those ephemeral payment address or required amounts.
The main issue with second approach, is any kind of flexible pricing. The price for API call will always be whatever's present in the index at given time. We could technically fix that by combining the two approaches - have the first one be price evaluation, while keeping the signed block in second request. Think of it kind of like the HTTP OPTIONS method, it tells your browser what it can and what it cannot do, gives instructions!
Why this has not happened yet?
There is no standard in place. A group of top-tier Nano product developers would have to assemble and heavily enforce a certain standard. I have not researched much, but I recall there being a few projects aiming to achieve this. While I am not familiar with their approaches, one thing is certain - they most likely differ. This is unfortunately a common theme in the Nano community, the lack of standardization (other projects struggle with this as well, this is not limited to Nano). A rather irrelevant example would be the Nautilus' message signing, a handy feature that does not seem to be supported by other major wallets! If used correctly, it is the most comfortable way of Nano authentication.
Most companies love the standard!
This is yet another issue, something I discovered after launching xno.click. Most url shorteners, that are supposed to pay their users, have a certain threshold for payouts. This maximizes their profit. Users that will never reach the threshold generate that profit.
This analogy is perfect when we compare to the top-up standard. You top up the absolute minimum you can - let's say 5$. You know damn well you will not use even half of that money for whatever you're trying to accomplish. Spend 1$, forget about the service forever. The company stays with 4$ that you likely will never touch. They effectively made you overpay 5x for a service that seemed 'cheap'. That is, if we ignore taxes and fees of course.
What can we do?
ENFORCE STANDARDS. BUILD APIs.
Seriously. A good starting place would be a simple apify alternative with people willing to contribute by creating their own APIs. Do not implement many features, be good at this one specific thing rather than adding features like paywalled content etc. Do one thing and do it the best we can.
Show other developers (outside of Nano), how they can easily earn money for their APIs without giving all of their personal data to apify.
That would be it. I'm up for discussion and potential collaboration if anyone decides to step forward with my approach.
Comments