by John Granata, Ali Fathalian, Michael Goldstein, Eli Haims, Saivann Carignan, Matt Storus, and Balaji S. Srinivasan

You can play with the 21 Micropayments Marketplace at 21.co/mkt.

Marketplaces and currencies tend to go well together. Paypal famously got to scale by becoming the currency of choice for eBay buyers and sellers. The US dollar grew to its current international predominance in part on the back of the large, integrated US market. And it thus stands to reason that a digital currency like Bitcoin might be well suited for a digital marketplace based on Bitcoin.

But the exact nature of the products being sold in such a marketplace is important. Unlike a traditional physical market localized to a nation state, the digital currency community is dispersed around the world. Moreover, most users hold relatively small balances, especially relative to their reserves of fiat currency. Finally, the community has a disproportionate share of engineers and computer scientists relative to the general world population.

Taking these constraints into account, we’ve built what we think of as the first micropayments marketplace: a marketplace that allows buyers and sellers to trade in digital goods using micropayments, initially specifically focused on APIs for developer use. If you have a 21 Bitcoin Computer, you can explore the marketplace today at 21.co/mkt; if not, please go and sign up for our forthcoming free client at 21.co/free and you’ll be able to access it soon.

Quickstart

Full documentation on working with the marketplace is available here and here, but let’s jump right in to show how it works.

How to buy API calls for bitcoin

If you have a 21 Bitcoin Computer, we’ve listed a few sample APIs so that you can get started buying and selling on the marketplace immediately. Just do the following steps to update your device:

# Get the latest version of the 21 client

$ 21 update

$ 21 --version

21 v2.3.1 # Reboot and start mining

$ sudo reboot

$ 21 mine

Then do this to buy your first marketplace API call for bitcoin:

# Run part-of-speech tagging on this sentence

$ 21 21 buy $ 21 21 buy https://mkt.21.co/21dotco/part_of_speech_tagger/pos/analyze --data '{"text": "The quick brown fox jumped over the lazy dogs."}' # Output:

# {

# "tagged": [

# ["The","Determiner"],

# ["quick","Adjective"],

# ["brown","Adjective"],

# ["fox","Noun, singular or mass"],

# ["jumped","Verb, past tense"],

# ["over","Preposition or subordinating conjunction"],

# ["the","Determiner"],

# ["lazy","Adjective"],

# ["dogs.","Noun, plural"]

# ]

# }

This command just spent a little bit of bitcoin to call a remote API that performs part-of-speech tagging on the input text.

Here’s another example that queries a large zip code database, using an API to do a lookup rather than a remote computation:

# Pay BTC to query a large remote database instead of storing it locally

$ 21 buy "https://mkt.21.co/21dotco/zip_code_data/zipdata/collect?zip_code=94109" # Output:

# {

# "City": "SAN FRANCISCO",

# "Decommissioned": "false",

# "EstimatedPopulation": "38763",

# "Lat": "37.79",

# "Long": "-122.42",

# "State": "CA",

# "Zipcode": "94109",

# "ZipcodeType": "STANDARD"

# }

Notice that in both of these cases you called a paid API without signing up for an API key or logging in. You are essentially using a Bitcoin address as your login, the corresponding private key as your password, and your Bitcoin balance as your credit card.

How to sell API calls for bitcoin

You just learned how to buy API calls for bitcoin. But it’s just as easy to sell API calls for bitcoin, renting out your local machine as a server. Try this out:

# Download code, join the marketplace, and start a bitcoin-payable

# server that accepts traceroute requests for 1000 satoshis.

git clone https://github.com/21dotco/bitroute.git

cd bitroute

21 join 21market

sudo pip3 install -r requirements.txt

python3 bitroute-server.py & # Use 21 publish to submit a manifest file describing your new

# bitroute endpoint.

21 publish submit manifest.yaml -p 'name="Satoshi Nakamoto" title="Bitroute" email="satoshi@example.com" price="1000" host="AUTO" port="6003"' # Wait a second, then find the endpoint you just put up.

21 publish list # You can also see it in general search results across the marketplace

21 search Bitroute # You can now buy that endpoint from yourself to test it out.

# NOTE: substitute your URL, as seen in '21 publish list' output!

21 buy url http://10.244.108.173:6003/?uri=google.com # Finally, you can see a receipt (in this case a purchase from yourself)

21 log

This sequence of commands shows how to rent out API access to your local machine for bitcoin. In short, you set up a server, chose a given pricing strategy, and published that server to the marketplace. Others can use the search functionality to discover and buy from you, and you can also buy from yourself to test out the endpoint. Purchases are visible in your inbox when you execute “21 log”, and you can come to our Slack channel to find more people to buy your endpoint.

In this particular example, you are allowing other machines to pay your server bitcoin to run a traceroute to a given IP address on their behalf, which can be useful for debugging DNS issues. Now, obviously a traceroute is a very simple operation, but the example can be easily extended to do arbitrary network operations on demand for bitcoin like spidering or relaying.

Why a micropayments marketplace?

To understand why a micropayments marketplace could be a very useful application of digital currency, let’s go through some of the features in more detail.

Buy APIs instantly without signup or credit card

Most of the cost of calling an API is not the nominal per-API call cost in dollars but the hidden fixed cost in developer setup time. That is, for each API, you need to spend at least 30–60 minutes signing up on a website to get a new API key and entering in new credit card details. The more APIs you use in your program, the more up-front cost there is before the first invocation of the program. And modern software development increasingly involves more and more APIs per project.

With a micropayments marketplace, we can essentially eliminate the fixed cost of sign up for any listed API. Just use your bitcoin wallet to do a one-shot purchase of a listed API, or set up a micropayment channel to do many purchases. You can replace the process of signing up for many APIs and giving out your information and credit card details to each site with a single software install and a local supply of digital currency.

Sell APIs instantly without a bank account

The process of selling APIs online typically takes even longer than buying them. First, one often needs to incorporate and then set up a corporate bank account before one can even begin to receive payments, a process that can take days or weeks.

By contrast, in seconds you can now publish an endpoint in the 21 Marketplace that anyone with bitcoin can purchase. That means the ability to instantly set up a simple paid API without the overhead of setting up a fiat bank account and a corresponding payment gateway. Just hit publish and watch your money roll in over time. And if it’s enough to graduate up from a side project to warrant the overhead of incorporation, that’s an obvious next step.

Limitations of our micropayments marketplace

While we think our micropayments marketplace is a pretty cool step towards making bitcoin useful as a digital currency for digital goods, we don’t think of it as a panacea by any means. Look for forthcoming releases to resolve the following known issues:

The 21 Marketplace only works with 21 Bitcoin Computers! Worry not, as in the near future it will work on every device. Just sign up at 21.co/free to be notified when machine-to-machine micropayments are available for your platform.

You need a separate micropayments channel for each API! Right now, we do support micropayment channels at the level of each individual API as described in the example here. However, we will soon be adding support for each client to open single long-running payment channel to 21.co to cover micropayments for all APIs your client is purchasing from the entire marketplace.

The 21 Marketplace has a limited set of first party APIs! We only have a few APIs up today, but will be adding many more APIs to our service shortly. However, before we boil the ocean we’d like to know which specific verticals or services you’d like us to support — machine learning, natural language processing, database lookup, or the like. Come to our Slack channel and let us know what you’d like to see.

Even with these limitations, we think the 21 micropayments marketplace is an important step towards making digital currency useful for developers. It specifically attacks two known, quantifiable developer pain points: the cost for buyers to sign up and pay for an API, and the cost for sellers to publish and receive payment for a new paid API. We’re working to make the tools for you to do this accessible on any device, but if you want to try the marketplace out today, do go and get a 21 Bitcoin Computer at 21.co/buy!