When we started Coinbase, we took a look at the Bitcoin Core open source project, and tried to decide how we could use it to build a web application. Bitcoin Core is a great reference implementation, but was never designed to query blockchain data in a flexible way (such as through a SQL database) or to scale to millions of users across dozens of servers. And so we built our own Bitcoin node to power Coinbase (which we’ve now scaled to 1.6M wallets).
Today we’re happy to announce Toshi, the next generation of our Bitcoin node, has been open sourced.
Toshi is a full Bitcoin node, that is 100% compatible with Bitcoin Core and makes it easy to build web applications. It provides an API to query blockchain data, is written in Ruby, and is backed by PostgreSQL.
What can you do with Toshi?
If you are a developer and want to start building bitcoin applications by querying blockchain data – you can use Toshi to do this. The easiest way to get started is with our free hosted version of Toshi.
When your app becomes popular or needs some new feature (or you just want to run it in your own datacenter), we make it easy to host your own copy of Toshi.
You can even deploy your own copy of Toshi to Heroku with one click:
Once deployed you can start syncing with the blockchain with one more command:
$ heroku scale block_worker=1 peer_manager=1 transaction_worker=2 web=1
What does the API look like?
Toshi provides access to raw blockchain data. This allows you to do things like:
- read information about blocks, transactions, addresses, etc
- broadcast new transactions that you’ve generated to the network
- get stats on the blockchain like height and confirmation times
If you are looking to do more complex things like:
- store bitcoin securely
- buy and sell bitcoin (exchange it to your local currency)
- accept bitcoin as a merchant
- create off-blockchain micro-transactions
…these are all available through the main Coinbase API. Some applications can be built entirely on Toshi, but Coinbase provides a full suite of other APIs for developers who want to use them. Our app gallery highlights some of the awesome apps built on our API.
Toshi has a great team of developers at Coinbase working on it, and will soon be powering a key piece of our infrastructure. We plan to not only keep it up to date with core bitcoin changes, but add some new features of our own (such as monitoring double spends). If you have any feedback or would like to contribute to Toshi, please open an issue on Github.
Note that this is a v0.1 release of Toshi. The API is subject to change, and we continue to work on stability + performance improvements over the coming months.
To check out Toshi, visit toshi.io.