btc-ocaml icon indicating copy to clipboard operation
btc-ocaml copied to clipboard

A toy implementation of the bitcoin protocol in ocaml.

  1. Overview

btc-ocaml is a toy implementation of the bitcoin p2p protocol. For now it just connects to the bitcoin network and downloads the block headers for the full blockchain. Note that this is very experimental so bugs should be expected and in particular the downloaded blockchain should not be considered as the consensus blockchain as there is no proper check for this!

  1. Building

btc-ocaml can be built using opam on a linux platform as follows. A. Install the following dependencies using opam as well as ocaml 4.02.2: - cryptokit (1.10) - core (113.00.00) - async (113.00.00) B. Build btc.native via the following command line: corebuild btc.native -pkgs core -pkgs async -pkgs cryptokit

  1. Running

The -blockchain flag is used to specify a file where the blockchain can be stored and accessed. ./btc.native -blockchain ./blockchain.bin

  1. License

btc-ocaml is distributed under the terms of GNU LGPL version 2.1 with ocaml linking exception. See the LICENSE.txt file for the full text.