Start your Bitcoin app with just 4 lines of code. go-btcrpc

Hey Guys. A great announcement to everyone who wants to use blockchain.

I made a simple bitcoin library to interact with your bitcoin node called go-btcrpc.


JSONRPC is like JSON but the object is a bit different. Unlike JSON, JSONRPC has a mandatory key like jsonrpc or method.

And all methods of the Http requests are POST. It is used for remote method executing.

In the blockchain application, the infrastructure looks like this. The app server interacts to the blockchain though the bitcoin node server. You can get the docker file of the bitcoin node amacneil/bitcoin.

How can I create a app?

For my example, I use a golang webframework for my application server. And I use this go-btcrpc package for the interaction between these two.


How to use this package?

This is extremely easy.

package main

import (
  btcrpc ""

func main() {
    basicAuth := &BasicAuth{
        Username: os.Getenv("USERNAME"),
        Password: os.Getenv("PASSWORD"),
    c := NewRPCClient(os.Getenv("BTCD_ENDPOINT"), basicAuth)
    address := "my88QLpf2RYYDdNMmDwYvfx6TFc6NXaELa"
    balance := c.GetBalance(address)
    fmt.Print(balance) // 0.13514 BTC

That's all. It alreadly got the balance(the mount of bitcoin) of the address. There is more useful methods, see the for more specific infomations about the methods. Not all methods of bitcoin api is implemented!

How to get the bitcoin node?

See the official repo for installation. bitcoin/bitcoin

Remember to set the basic auth option when you start your bitcoind.

How to contribute?

Just send a pull request to this repo. I believe that this project is very cool lets people develop blockchain application much easlier.

Make world a better place. That's why this project is OSS.


Please feel free to ask questions about this package via email, github, facebook and such like. I've created app on Ethereum,Bitcoin, Ripple, Lisk...etc.

Any questions are welcomed.


Github: @KeisukeYamashita