Clojure bindings for the original (C++) Bitcoin Client
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Clojure bindings for the original (C++) Bitcoin Client json-rpc API.

This release was tested with *version 0.11.2*.

For the full list of calls, see: Bitcoin Core APIs.



add this to your project.clj’s :dependencies:

[clj-btc "0.11.2"]




To call the method (for example) getinfo on a bitcoind according to the local default bitcoin.conf file:

user=> (require '[clj-btc.core :as btc])
;;=> nil
user=> (btc/getinfo)
;;=> {"timeoffset" 0, "protocolversion" 70001, "blocks" 111908, "errors" "",
      "testnet" true, "proxy" "", "connections" 4, "version" 80500,
      "keypoololdest" 1380388750, "paytxfee" 0E-8M,
      "difficulty" 4642.44443532M, "keypoolsize" 101, "balance" 0E-8M,
      "walletversion" 60000}

By default, any call on an rpc-method will read the (default) local configuration file. However, since this is somewhat less than efficient, it is possible to specify a configuration manually. The configuration must contain the keys :rpcpassword :rpcuser :testnet :rpcport and :rpchost.

user=> (def config {:rpcpassword "PASSWORD", :rpcuser "USR", :testnet true,
                    :rpcport 18332, :rpchost ""})
;;=> #'user/config
user=> (btc/getbalace :config config)  ; no file is read to get configs
;;=> 2.718281M

It is also possible to use a different configuration file by passing its path to clj-btc.config/parse-config:

user=> (require '[clj-btc.config :only (parse-config)])
;;=> nil
user=> (def config (parse-config "/path/to/my.conf"))
;;=> #'user/config
user=> (btc/getbalace :config config)  ; no file is read to get configs
;;=> 777M

Future Work

  • [ ] Add tests for all the rpc methods.
  • [ ] Replace transactions in tests with some of the first ones on testnet - for test performance and stability.
  • [ ] Add types with core.typed.
  • [ ] Improve documentation with more examples.


See at the root of this repo.


You can contact the maintainer of this library, and other developpers/users at github, or


Copyright 2013-2016 Aviad Reich.

The use and distribution terms for this software are covered by the Apache License, Version 2.0 (, which can be found in the file LICENSE at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.