Coinffeine: A P2P Alternative to Centralised Bitcoin Exchanges

Neil Sardesai @@neilsardesai
March 2, 2014
Coinffeine is a distributed, zero-trust Bitcoin exchange platform.

After the Mt. Gox meltdown, people have become a lot warier of centralised exchanges. Gox, Bitstamp, BTC-E, and other popular exchanges see thousands of Bitcoins traded daily, yet they have nothing like FDIC insurance to really back them up in the event of insolvency. Instead, users are forced to trust these services’ accountability and security. Furthermore, such centralised exchanges are huge targets for hackers and scammers, since successful heists can net hundreds of thousands of dollars worth Bitcoins, Litecoins, and other cryptocoins. Centralisation is something that Bitcoin inherently tends to avoid. As such, it only makes sense for Bitcoin exchanges to be similarly decentralised. Fortunately, a new, open-source project called Coinffeine hopes to create a distributed, zero-trust Bitcoin exchange platform. Think of it like BitTorrent for Bitcoins.

How Does it Work?

A Simple Explanation

Good question. It’s actually incredibly simple, and you’ll wonder why no one has already come up with this idea. Just take a look at these slides to get the general idea before moving on to more technical details.

More Technical Details

To make this system actually work, Coinffeine solves two difficult problems. The first is a distributed broker system (that has not yet been implemented) that pairs “asks” and “bids”. The second is a zero-trust exchange algorithm (that is nearly complete) that allows users to exchange Bitcoins and fiat without having to trust any exchange or user. Furthermore, the project is written mostly in Scala. Coinffeine also uses Akka for concurrency and bitcoinJ, a Java implementation of the Bitcoin protocol.


Coinffeine relies on a Bitcoin contract known as Micropayment Channel. This essentially forces users to cooperate in several micro-transactions until the exchange is complete. If users pull out early, they lose money. Users get to decide how many steps they want to take for the transaction to be complete. Next, they deposit a certain amount that expires after some time and is refunded if unused. This deposit prevents users from pulling out early, because deposits are greater than the amount exchanged in each step. The process continues until the final exchange, and the transaction gets confirmed by the miners. A full overview of the protocol is available on the Coinffeine wiki.

When Can I Start Using Coinffeine?

Coinffeine is still in the early stages of development, so it has several issues. The project is currently in “Pre-alpha,” and the developers have published this roadmap for upcoming versions.

  • Version 0.1. First version in which command line peers will be able to perform BTC-fiat exchanges using OKPay (as first supported payment processor) in a distributed fashion. Limitations for this version: price negotiation will be performed in a centralized server and peer communication will be direct and based on protocol buffers RPC, limited parametrization of the process.
  • Version 0.2. Remove some of the constraints.
    • Replace protobuf RPC by DHT routing
    • Introduce a richer order book
    • Introduce a GUI
  • Version 0.3 Get ready for beta testing.
    • Implement a broker set to maintain the order book in a distributed fashion.

You can keep up with Coinffeine’s progress by following the team on twitter or signing up for the Coinffeine newsletter.

How Can I Get Involved?

There are several things you can do to contribute to the Coinffeine project.

Who’s Behind Coinffeine?

Coinffeine was conceived by:

Bitcoin doesn’t need centralised exchanges. And while there are some efforts to bring decentralised exchange systems to Bitcoin, Coinffeine definitely looks like the most elegant solution.

Last modified (UTC): March 2, 2014 21:01

Neil Sardesai @@neilsardesai

I enjoy keeping up with the latest stuff in science and technology and have been following Bitcoin for a few years now. I also occasionally post cool stuff on twitter.