{"id":18026818,"url":"https://github.com/yegor256/sibit","last_synced_at":"2026-01-02T17:16:07.659Z","repository":{"id":51275251,"uuid":"180142660","full_name":"yegor256/sibit","owner":"yegor256","description":"Simplified Command-Line Bitcoin Client and a Ruby library for making Bitcoin payments and checking address balances","archived":false,"fork":false,"pushed_at":"2025-12-28T17:43:06.000Z","size":807,"stargazers_count":27,"open_issues_count":6,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-28T21:55:38.670Z","etag":null,"topics":["bitcoin","bitcoin-client","blockchain","cryptocurrency","ruby"],"latest_commit_sha":null,"homepage":"https://www.yegor256.com/2019/05/07/sibit-bitcoin-command-line-client.html","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yegor256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-08T12:18:44.000Z","updated_at":"2025-12-27T18:08:38.000Z","dependencies_parsed_at":"2022-08-12T23:00:45.316Z","dependency_job_id":"e0d786fd-96bd-436a-958c-563fe0bf3424","html_url":"https://github.com/yegor256/sibit","commit_stats":null,"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"purl":"pkg:github/yegor256/sibit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fsibit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fsibit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fsibit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fsibit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yegor256","download_url":"https://codeload.github.com/yegor256/sibit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fsibit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28174895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-02T02:00:06.235Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","bitcoin-client","blockchain","cryptocurrency","ruby"],"created_at":"2024-10-30T08:08:09.767Z","updated_at":"2026-01-02T17:16:07.653Z","avatar_url":"https://github.com/yegor256.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Send Bitcoin via Command Line, in Ruby\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/sibit)](https://www.rultor.com/p/yegor256/sibit)\n[![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)\n\n[![rake](https://github.com/yegor256/sibit/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/sibit/actions/workflows/rake.yml)\n[![PDD status](https://www.0pdd.com/svg?name=yegor256/sibit)](https://www.0pdd.com/p?name=yegor256/sibit)\n[![Gem Version](https://badge.fury.io/rb/sibit.svg)](https://badge.fury.io/rb/sibit)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/takes/sibit/master/LICENSE.txt)\n[![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/sibit.svg)](https://codecov.io/github/yegor256/sibit?branch=master)\n[![Hits-of-Code](https://hitsofcode.com/github/yegor256/sibit)](https://hitsofcode.com/view/github/yegor256/sibit)\n\nTo understand how the Bitcoin protocol works, I recommend you watching\n  this [short video] and then reading this blog post of mine:\n  [_Sibit Demonstrates How Bitcoin Works_][blog].\n\nThis is a simple Bitcoin client for use from the command line\n  or from your Ruby app.\nYou don't need to run any Bitcoin software or install anything.\nAll you need is just a command line and [Ruby] 2.3+.\nThe purpose of this client is to simplify most typical operations with Bitcoin.\nIf you need something more complex, I would recommend using\n  [bitcoin-ruby] for Ruby and [Electrum] as a GUI client.\n\nYou may want to discuss this tool at [Bitcointalk]\n  and give the thread a few merits.\n\nThis is a Ruby gem, install it first (if it doesn't work, there are\n  some hints at the bottom of this page):\n\n```bash\ngem install sibit\n```\n\nThen, you generate a [private key]:\n\n```bash\n$ sibit generate\n1461cc61c3b09d01d5c02b901577c9d052264e77043bddd3d222ab8a6f7e0db0\n```\n\nNext, you create a new [address],\nusing your private key:\n\n```bash\n$ sibit create 1461cc61c3b09d01d5c02b901577c9d052264e77043bddd3d222ab8a6f7e0db0\n1PfsYNygsuVL8fvBarJNQnHytkg4rGih1U\n```\n\nTo check the balance at the address (the result is in\n[satoshi]):\n\n```bash\n$ sibit balance 1PfsYNygsuVL8fvBarJNQnHytkg4rGih1U\n80988977\n```\n\nTo send a payment from a few addresses to a new address:\n\n```bash\n$ sibit pay AMOUNT FEE P1,P2,... TARGET CHANGE\ne87f138c9ebf5986151667719825c28458a28cc66f69fed4f1032a93b399fdf8\n```\n\nHere:\n\n* `AMOUNT` is the amount of [satoshi] you are sending (integer),\n  or `0.42BTC` if in bitcoins (with a suffix),\n* `FEE` is the [miner fee] you are ready to spend to get\n  this transaction delivered (you can say `S`, `M`, `L`, or `XL` if you want it\n  to be calculated automatically),\n* `P1,P2,...` is a comma-separated list\n  of private keys `P` you are sending your coins from,\n* `TARGET` is the address you are sending to,\n* `CHANGE` is the address where the change goes.\n\nThe transaction hash is returned.\nNot all [UTXOs] may be used, but only the necessary amount of them.\n\nBy default, the fee is paid on top of the payment amount you are sending.\nSay, you are sending 0.5 BTC and the fee is 0.0001 BTC.\nTotally, you spend 0.5001.\nHowever, you can make Sibit deduct the fee from the payment amount.\nIn this case you should provide a negative amount\n  of the fee or one of `S-`, `M-`, `L-`, `XL-`.\nYou can also say `S+`, if you want the opposite, which is the default.\n\nIt is recommended to run it with `--dry --verbose` options first,\n  to see what's going to be sent to the network.\nIf everything looks correct, remove the `--dry` and run again,\n  the transaction is pushed to the network.\n\nTo use an HTTPS proxy for all requests:\n\n```bash\nsibit --proxy=host:port balance 1PfsYNygsuVL8fvBarJNQnHytkg4rGih1U\n```\n\nThe proxy address may include authentication credentials:\n\n```bash\nsibit --proxy=user:password@host:port balance 1PfsYNygsuVL8fvBarJNQnHytkg4rGih1U\n```\n\nAll operations are performed through the [Blockchain API].\nTransactions are pushed to the Bitcoin network via [this relay].\n\n## Ruby SDK\n\nYou can do the same from your Ruby app:\n\n```ruby\nrequire 'sibit'\nsibit = Sibit.new\npkey = sibit.generate\naddress = sibit.create(pkey)\nbalance = sibit.balance(address)\ntarget = sibit.create(pkey) # where to send coins to\nchange = sibit.create(pkey) # where the change goes\ntx = sibit.pay(10_000_000, 'XL', { address =\u003e pkey }, target, change)\n```\n\nIt should work.\n\n## APIs\n\nThe library works through one (or a few) public APIs for fetching\n  Bitcoin data and pushing transactions to the network.\nAt the moment we work with the following APIs:\n\n* [Blockchain.com] - `Sibit::Blockchain`\n* [BTC.com] - `Sibit::Btc`\n* [Cryptoapis.io] - `Sibit::Cryptoapis`\n* [Bitcoinchain.com] - `Sibit::Bitcoinchain`\n* [Blockchair.com] - `Sibit::Blockchair`\n* [Cex.io] - `Sibit::Cex`\n\nThe first one in this list is used by default.\nIf you want to use a different one,\n  you just specify it in the constructor of `Sibit` object:\n\n```ruby\nrequire 'sibit'\nrequire 'sibit/btc'\nsibit = Sibit.new(api: Sibit::Btc.new)\n```\n\nYou may also use a combination of APIs.\nThis may be very useful since some APIs are not reliable\n  and others don't have all the features required.\nYou can provide an array of objects and they are used one by one,\n  until a successful response is obtained:\n\n```ruby\nrequire 'sibit'\nrequire 'sibit/btc'\nrequire 'sibit/cryptoapis'\nsibit = Sibit.new(\n  api: Sibit::FirstOf.new(\n    [\n      Sibit::Btc.new,\n      Sibit::Cryptoapis.new('key')\n    ]\n  )\n)\n```\n\nIf you think we may need to use some other API, you can submit a ticket,\nor implement it yourself and submit a pull request.\n\n## How to install\n\nTo install on a fresh Ubuntu 18:\n\n```bash\nsudo apt-get update\nsudo apt-get install -y ruby ruby-dev autoconf automake build-essential\nsudo gem update --system\ngem install rake --no-document\ngem install sibit\n```\n\nIt should work.\nIf it doesn't, submit an issue and I can try to help.\n\n## How to contribute\n\nRead [these guidelines].\nMake sure your build is green before you contribute your pull request.\nYou need to have [Ruby] 2.3+ and [Bundler] installed.\nThen:\n\n```bash\nbundle update\nbundle exec rake\n```\n\nIf it's clean and you don't see any error messages, submit your pull request.\n\n[address]: https://en.bitcoin.it/wiki/Address\n[bitcoin-ruby]: https://github.com/lian/bitcoin-ruby\n[Bitcoinchain.com]: https://bitcoinchain.com/api\n[Bitcointalk]: https://bitcointalk.org/index.php?topic=5130324\n[Blockchain API]: https://www.blockchain.com/api/blockchain_api\n[Blockchain.com]: https://www.blockchain.com/explorer\n[Blockchair.com]: https://blockchair.com/api/docs\n[blog]: https://www.yegor256.com/2019/05/07/sibit-bitcoin-command-line-client.html\n[BTC.com]: https://btc.com/api-doc\n[Bundler]: https://bundler.io/\n[Cex.io]: https://cex.io/rest-api\n[Cryptoapis.io]: https://docs.cryptoapis.io/rest-apis/blockchain-as-a-service-apis/btc/index\n[Electrum]: https://electrum.org/\n[miner fee]: https://en.bitcoin.it/wiki/Miner_fees\n[private key]: https://en.bitcoin.it/wiki/Private_key\n[Ruby]: https://www.ruby-lang.org/en/\n[satoshi]: https://en.bitcoin.it/wiki/Satoshi_%28unit%29\n[short video]: https://www.youtube.com/watch?v=IV9pRBq5A4g\n[these guidelines]: https://www.yegor256.com/2014/04/15/github-guidelines.html\n[this relay]: https://www.blockchain.com/btc/pushtx\n[UTXOs]: https://en.wikipedia.org/wiki/Unspent_transaction_output\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fsibit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyegor256%2Fsibit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fsibit/lists"}