profile picture

@code @crypto @robotics

#bitcoin #ethereum #haskell

Bootstrapping Haskell for Bitcoin development

It’s time to get our hands dirty. Let’s begin bootstrapping our Haskell development environment. Before we proceed it’s probably fair to note that it’s very early days for Bitcoin development using Haskell and like users of most languages one should expect the Bitcoin libraries to be changing rapidly.

Bitcoin Wallets

In this blog post I’m going to concentrate on Bitcoin wallets which will be our foundation for a more developer-oriented discussion. Wallets are analogous to web browsers in that they are the main interface for end users to interact with the network. In its simplest form it is a file which contains a collection of private keys. In addition the wallet software usually takes care of communicating with peers, managing the blockchain and keeping records of wallet transactions.

Bitcoin from a developer's perspective

Bitcoin is an exciting new technology invented by the mysterious Satoshi in 2009 which has been gaining some serious traction in the last few months. Although there are many introductory blog posts about Bitcoin there aren’t necessarily many which tackle the subject from a developer’s perspective.

Network programming in Haskell

At work we use Clojure as our primary implementation language. I wrote a blog post about the decision which got a lot of attention from the Hacker News community. While we are extremely happy with our decision we have started to deploy some Haskell code on some low memory VPS we deploy.

Some of the machines we deploy are 256M and 512M instances and with multiple instances of the JVM the machines start swapping to disk sooner or later. The other day we needed a simple way to forward all HTTP traffic received by our DNS servers to our website. It seemed like the perfect project to introduce Haskell since the code is independent of everything else and extremely simple; just output a HTTP 301 redirect response no matter what was received on the socket.

The resulting code is as close to a networking skeleton written in Haskell which I hope others will benefit from when starting a Haskell project involving network communication.