Skip to content
Simplified Command Line Bitcoin Client
Branch: master
Clone or download
1
Latest commit 739b369 May 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin #21 --dry May 6, 2019
features #21 --dry May 6, 2019
lib #21 show dollars May 6, 2019
test #21 show dollars May 6, 2019
.0pdd.yml #1 skeleton Apr 8, 2019
.gitattributes #1 skeleton Apr 8, 2019
.gitignore #1 skeleton Apr 8, 2019
.pdd #1 skeleton Apr 8, 2019
.rubocop.yml #21 show dollars May 6, 2019
.rultor.yml #1 version Apr 8, 2019
.simplecov #1 skeleton Apr 8, 2019
.travis.yml #1 skeleton Apr 8, 2019
Gemfile #1 skeleton Apr 8, 2019
LICENSE.txt #1 skeleton Apr 8, 2019
README.md #21 --dry explained May 6, 2019
Rakefile #21 --dry May 6, 2019
appveyor.yml #21 --dry May 6, 2019
cucumber.yml #1 skeleton Apr 8, 2019
logo.png logo May 3, 2019
sibit.gemspec #6 versions Apr 11, 2019

README.md

EO principles respected here Managed by Zerocracy DevOps By Rultor.com We recommend RubyMine

Build Status Build status PDD status Gem Version Maintainability

Test Coverage Hits-of-Code

To understand how Bitcoin protocol works, I recommend you watching this short video.

This is a simple Bitcoin client, to use from the command line or from your Ruby app. You don't need to run any Bitcoin software, no need to install anything, and so on. All you need is just a command line and Ruby 2.3+. The purpose of this client is to simplify most typical operations with Bitcoin. If you need something more complex, I would recommend using bitcoin-ruby for Ruby and Electrum as a GUI client.

You may want to discuss this tool at Bitcointalk and give the thread a few merits.

This is a Ruby gem, install it first (if doesn't work, there are some hints at the bottom of this page):

$ gem install sibit

Then, you generate a private key:

$ sibit generate
E9873D79C6D87FC233AA332626A3A3FE

Next, you create a new address, using your private key:

$ sibit create E9873D79C6D87FC233AA332626A3A3FE
1CC3X2gu58d6wXUWMffpuzN9JAfTUWu4Kj

To check the balance at the address (the result is in satoshi):

$ sibit balance 1CC3X2gu58d6wXUWMffpuzN9JAfTUWu4Kj
80988977

To send a payment from a few addresses to a new address:

$ sibit pay AMOUNT FEE A1:P1,A2:P2,... TARGET CHANGE
e87f138c9ebf5986151667719825c28458a28cc66f69fed4f1032a93b399fdf8

Here, AMOUNT is the amount of satoshi you are sending, FEE is the miner fee you are ready to spend to make this transaction delivered (you can say S, M, L, or XL if you want it to be calculated automatically), A1:P1,A2:P2,... is a comma-separated list of addresses A and private keys P you are sending your coins from, TARGET is the address you are sending to, CHANGE is the address where the change will be sent to. The transaction hash will be returned. Not all UTXOs will be used, but only the necessary amount of them.

It is recommended to run it with --dry --verbose options first, to see what's going to be sent to the network. If everything looks correct, remove the --dry and run again, the transaction will be pushed to the network.

All operations are performed through the Blockchain API. Transactions are pushed to the Bitcoin network via this relay.

Ruby SDK

You can do the same from your Ruby app:

require 'sibit'
sibit = Sibit.new
pkey = sibit.generate
address = sibit.create(pkey)
balance = sibit.balance(address)
target = sibit.create(pkey) # where to send coins to
change = sibit.create(pkey) # where the change will sent to
tx = sibit.pay(10_000_000, 'XL', { address => pkey }, target, change)

Should work.

How to install

To install on a fresh Ubuntu 18:

$ sudo apt-get update
$ sudo apt-get install -y ruby ruby-dev autoconf automake build-essential
$ sudo gem update --system
$ gem install rake --no-document
$ gem install sibit

Should work. If it doesn't, submit an issue, I will try to help.

How to contribute

Read these guidelines. Make sure your build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:

$ bundle update
$ bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.

You can’t perform that action at this time.