Bitcoin is much more than just a digital currency. It is a protocol, a network, a currency and a transaction language. Most of all, though, it is an application programming interface (API) for money. Nowadays, bathroom scales and fridges have APIs, so why not money?
Traditional money does have APIs, but they are closed. You can program the merchant API of the VISA network if you are a trusted merchant. You can send and receive FIX messages if you are a stockbroker or exchange. Regular people, however, don’t even have APIs into their bank accounts, let alone the broader economy. Bitcoin changes all that by not only offering an API for accounts (wallets) and transactions, but also making that API available to everyone.
In a traditional financial network, trust is achieved through a complex web of regulations, fraud detection, and accreditation — but most of all exclusion. Financial networks remain secure by keeping the APIs closed and inaccessible except to the few who are trusted, and thereby keep out bad actors (at least in theory). Bitcoin shifts the model from “trust by exclusion” to “trust by computation.” Trust is distributed across a large (and ever-growing) network of collaborators who continuously check one another, making it increasingly difficult for any bad actor — or even a set of bad actors — to hijack the network. As a result, there is no need for exclusion or access controls. Anyone can participate in the Bitcoin network and see all the transactions, or rather everyone can access the APIs.
On the Bitcoin network, you can programmatically check your balance, or the balance of any Bitcoin wallet. You can create and consume transactions on a level playing field. You can operate a bank, a stock exchange, a wire transfer service or an escrow service without anyone’s permission or accreditation. The Internet made every blogger able to reach an audience as big as that of the New York Times. Bitcoin makes every node, even that running on your cellphone, equal in capability to Wells Fargo or Bank of America.
Of course, not everyone wants to open a bank or invent a new financial service. Not everyone has the skills or credibility to operate a financial service. Ultimately, the market can decide. Just like the Internet democratized publishing, removing barriers and intermediaries and allowing direct access for both publishers and consumers of media, Bitcoin promises to do the same for money. It empowers users to determine who they will trust for their financial services, just as the Internet empowers users to determine who they will trust for their information.
The Bitcoin network offers three distinct APIs. The first is the transaction scripting language, a Forth-like language for defining transactions. The most commonly used script corresponds to “Transfer X coins from Alice’s wallet to Bob’s wallet.” While almost all transactions look like this, the scripting language is incredibly powerful and allows for innovation at the transaction level. One example of such innovation is the M–of–N signatures script, which is a transaction that can be unlocked if any M of a total N keys are used to sign it. For example, a transaction could require a third-party escrow key — in addition to the recipient’s key — to validate. In a corporate setting, this allows for capital accounts to require two or more signatories to spend, for example the CFO, the treasurer and the auditor. A transaction could be set to unlock with either one of two keys, allowing for example a “joint account,” or a trustee/executor relationship.
Beyond the M–of–N model, the scripting language can specify validation conditions that have nothing to do with keys. For example, a transaction might be payable to anyone guessing a combination of numbers, creating the possibility for a global and verifiable lottery. A transaction could be set to unlock by anyone, but only after a specified time, creating a timelock. Or it could be co-signed (paid) by 10 different people combining their keys to pay for a song they all can share. The possibilities are truly infinite, as this is a language that can be extended over time.
The second API in bitcoin is the P2P network protocol API, that allows nodes to communicate, exchanging transactions, validating new blocks of transactions and newly generated coins. All of these network protocol interactions allow each node to construct a complete and identical local copy of the shared transactions ledger that is the blockchain, at the heart of Bitcoin. The open nature of the Bitcoin ledger enables anyone to offer services that require knowledge of Bitcoin transactions. For example, by telling your tax accountant which of the public Bitcoin wallet addresses belong to you, they can easily find all of the transactions associated with your wallets in the ledger and compute your profits and losses — or even create optimal tax strategies for Bitcoin trading activity.
Finally, the third API is the “northbound” client API that exposes the Bitcoin economy as a set of JSON-RPC services for client applications. This API offers services such as checking the balance in a wallet, the equivalent of a bank account in the Bitcoin world; creating a transaction; creating new wallets; etc. Think of it as an API to online banking services, on steroids.
Of course, Bitcoin’s APIs don’t end there. Bitcoin acts as a platform for higher level services, such as lightweight clients (Stratum API), currency exchanges, notification and alerting services, market data services, econometric services, etc. All of these come with their own APIs.
If Bitcoin is equivalent to IP (Internet Protocol), there are not only APIs and protocols that extend it like TCP, but also layers of protocols above it, providing services like the application layer protocols of the Internet SMTP, HTTP, etc. Using the underlying distributed-ledger foundation, developers have introduced attestation and notarization services that prove the existence of a document at a specified time and even secure messaging services.
Bitcoin turns money and transactions — and therefore trade — into a programmer’s paradise: money-as-a-service, with open, flexible and powerful APIs into an entire economy, all just a JSON request away. If you’re looking at Bitcoin and thinking of digital cash, you’re missing the iceberg below the surface.