Developing Bitcoin applications — an overview
We developed our first Bitcoin application that went into production early in 2014 and if you are following the Bitcoin ecosystem you might have heard of it: BitPesa is a remittance product based on Bitcoin for Kenyan diaspora.
That means people can send money to there relatives in Kenya using Bitcoin. Because of the digital nature of Bitcoin it is perfect for cross-border transactions that are slow and expensive with existing payment solution. Read more about BitPesa for example here on CoinDesk
In this post I want to give you a brief introduction on how to write applications that integrate with the Bitcoin network and look into different options.
Using a Payment Service Provider
Like for traditional payment methods there are Payment Service Providers (PSP) for Bitcoin. These companies make it super easy for you to accept Bitcoin payments. You basically just add a little snippet to your website and you are good to go. For companies that do not want to hold Bitcoins or want to instantly exchange parts of it to fiat currency these service provides settle your account in your currency. That means you can request your amount in fiat currency, the customer pays in Bitcoin and the service provider transfers fiat currency to your traditional bank account.
There are several companies out there that you can use. Some big players and some smaller ones that often are specialised on local markets:
- Bitpay: probably the most famous Bitcoin PSP. Provides an extensive API and tools to integrate into your application. no transaction fees
- Coinbase: provides a hosted wallet as well as merchant services to accept Bitcoin. No transaction fees for the first 1Mio USD.
- Coinify: provides a Bitcoin exchange and merchant services.
- Yellowpay: a company providing specialized services for the Middle East.
Using a service providing HTTP API for the Blockchain
The second type of services provide try to make Bitcoin network more accessible for developers. They focus on providing a secure Bitcoin infrastructure that the developers do not need to care about when integrating Bitcoin features. Restful HTTP APIs are provided to access data like addresses, blocks, transaction, etc. Besides using a hosted service there are also tools like insight.is or toshi.io that provide similar services but self hosted. They sit behind a full bitcoin core installation and expose a similar HTTP interface to built upon.
- helloblock.io: extensive API for addresses, transactions, blocks, wallets.
- gem.co: currently in private beta
- toshi.io: the newly open sourced ruby application written by Coinbase. It is a full bitcoin node and exposes a HTTP and Websocket API
- insight.is: an open source node.js application by bitpay. Integrates with the bitcoin code RPC interface and exposes a complete HTTP and Websocket API.
Writing your own integration
And then you of course can directly integrate with the Bitcoin network. Here you can either call the RPC interface of the bitcoin core daemon or fully integrate Bitcoin into your application for example using the bitcoinj library. This means you manually handle the Bitcoin keys and transactions in your application and you deal with your wallet. For sure this allows the most exciting application to be built and I highly recommend looking into the bitcoinj library. It makes working with the network pretty easy. The upcoming v0.12 release will also support hirarchicaly deterministic wallets that will allow easier backups and more security.
- bitcoin core RPC: the core bitcoin application can be run as a daemon and expose a RPC interface to all its functionality
- bitcoinj: the Java library that powers a lot of bitcoin wallets (like the Android Bitcoin wallet). It lets you deeply integrate Bitcoin into your application. Have a look at the examples to get started.
- toshi.io: Toshi is a full Bitcoin node so you not only can use its APIs but also integrate build on top of it and integrate it into your application.
I believe services and tools that are providing an HTTP API to the Blockchain are great tools to integrate blockchain features into applications without worrying about running the infrastructure to connect to the Bitcoin network. However most innovative application will be possible with deeper bitcoin integration. The existing tools make it easy to exactly do that and you should take a closer look to the bitcoin core implementation and the libraries mentioned above.
We are currently mainly using the bitcoinj library with great success.
I hope this gives you some overview of how you can build apps for the Bitcoin ecosystem. Let us know you have questions or need help.
Originally published at www.railslove.com in 2014.