header source
my icon
esplo.net
ぷるぷるした直方体
Cover Image for Paid API by Mining Cryptocurrency

Paid API by Mining Cryptocurrency

about4mins to read

Introduction Video

https://www.youtube.com/watch?v=Z11CF_NQSus

Background

Providing APIs is a crucial component in expanding 3rd party ecosystems.
There is a famous story about Jeff Bezos' "The API Mandate" (all AWS services must be exposed as APIs or die), which highlights the importance of APIs in AWS's growth.

On the other hand, there are various obstacles to providing APIs.
Security is a major concern, but economic issues are also significant.

Basically, APIs need to be available 24/7, and operating costs are incurred during this time. Moreover, it is difficult to measure the benefits of expanding the ecosystem, making it challenging to justify the business costs.

A simple solution is to charge a monthly fee, but this can be inconvenient for users. There are also management costs associated with subscriptions.
On the other hand, pay-per-use pricing is beneficial for users, but it places a significant burden on the provider.

Proposed Method

Inspired by Coinhive, we propose a method to provide easy-to-use and paid APIs utilizing the power of cryptocurrency.
Specifically, we will use a gateway that leverages cryptocurrency mining to address these issues.

API users will obtain cryptocurrency through mining or purchasing, and pay the set amount for each API endpoint.
This will realize a prepaid API usage model, reducing management costs.
Furthermore, by using easily accessible cryptocurrency, we can lower the barriers to entry.

Challenges

Latency will significantly increase. Since payment completion is required, it is difficult to return results in a few milliseconds.

Additionally, we need to consider how to handle payment errors.

Technical Details

Details are described here:

https://qiita.com/esplo/items/65fedba8efbc602f91cb

Usage

The demo site is currently not operational.

Please check the details on GitHub:

https://github.com/esplo/crypto-api-gateway

Share