{"id":47845142,"url":"https://github.com/mempoolco/spruned","last_synced_at":"2026-04-03T21:09:49.715Z","repository":{"id":40417359,"uuid":"121128294","full_name":"mempoolco/spruned","owner":"mempoolco","description":"A Bitcoin-without-Blockchain client w/ RPC that can fetch any block or transaction","archived":false,"fork":false,"pushed_at":"2023-07-20T15:09:21.000Z","size":1166,"stargazers_count":170,"open_issues_count":19,"forks_count":31,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-11-27T21:41:12.209Z","etag":null,"topics":["bitcoin","bitcoin-api","bitcoind","blockchain"],"latest_commit_sha":null,"homepage":"","language":"Python","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/mempoolco.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}},"created_at":"2018-02-11T13:53:20.000Z","updated_at":"2025-11-20T21:09:34.000Z","dependencies_parsed_at":"2022-08-09T19:50:32.780Z","dependency_job_id":null,"html_url":"https://github.com/mempoolco/spruned","commit_stats":null,"previous_names":["gdassori/spruned"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/mempoolco/spruned","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mempoolco%2Fspruned","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mempoolco%2Fspruned/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mempoolco%2Fspruned/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mempoolco%2Fspruned/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mempoolco","download_url":"https://codeload.github.com/mempoolco/spruned/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mempoolco%2Fspruned/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31377619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-api","bitcoind","blockchain"],"created_at":"2026-04-03T21:09:49.583Z","updated_at":"2026-04-03T21:09:49.705Z","avatar_url":"https://github.com/mempoolco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### spruned \n\n#### A Bitcoin-without-Blockchain client w/ RPC that can fetch any block or transaction\n********\n[![travis](https://travis-ci.org/gdassori/spruned.svg?branch=master)](https://travis-ci.org/gdassori/spruned)\n[![coveralls](https://coveralls.io/repos/github/gdassori/spruned/badge.svg)](https://coveralls.io/github/gdassori/spruned)\n[![rtd](https://readthedocs.org/projects/spruned/badge/?version=latest)](http://spruned.readthedocs.io/en/latest/#)\n[![PyPI version](https://badge.fury.io/py/spruned.svg)](https://badge.fury.io/py/spruned)\n[![PyPI version](https://img.shields.io/badge/talk-groups.io-blue.svg)](https://groups.io/g/spruned/)\n\n\nInterested in spruned development ? Join the [telegram group](https://t.me/spruned_dev)\n\n#### What's this?\n\nspruned is a bitcoin client for lightweight systems. \u003cbr /\u003e \nit doesn't need to store the blockchain on the disk, just the headers.\u003cbr /\u003e\n__128mb ram \u0026 500mb hdd__ should be fairly enough to keep it up \u0026 running.\n\u003cbr /\u003e\n\nSupports both Bitcoin Mainnet and Testnet\u003cbr /\u003e\n\n__The RPC API is able to support__:\n \n - c-lightning\n - LND (zeromq must be enabled)\n - btc-rpc-explorer\n - ...many more, open an issue if you need other API calls.\n  \n\u003cbr /\u003e\n\nDive into spruned by reading the __[documentation](http://spruned.readthedocs.io/en/latest/#)__\n\n\n#### How it works?\n\nspruned downloads and store the bitcoin blocks on demand, when you need them, directly from the __peer to peer bitcoin network__.\u003cbr/\u003e\n\u003cbr /\u003ethere's a \"bootstrap\" functionality, to keep the last ~50 (default settings) blocks on the local storage, because \nfetch blocks may require also up to 10 seconds with slow connections, and this \"bootstrap mode\" reduces latencies on usage.\u003cbr /\u003e\n\nYou can use bitcoin-cli, or any other RPC client, as if you had bitcoind up \u0026 running.\u003cbr /\u003e\n\nFor the transactions related APIs and utxo tracking, spruned uses the __electrum network__.\n\n#### Dependencies\n\nspruned works with Python \u003e= 3.5.2. Right now it should work only on Linux systems.\u003cbr /\u003e\n\u003cbr /\u003e\nIt make intensive usage of connectrum, pybitcointools and pycoinnet libraries. Thanks to mantainers \u0026 contributors! \u003cbr /\u003e\nEspecially at this stage of development (but it would be better always), it is recommended to use virtualenv to run spruned.\n\n\n#### Installation from pypi\n```console\n$ cd ~/src\n$ sudo apt-get install libleveldb-dev python3-dev virtualenv gcc g++\n$ virtualenv -p python3.5 venv\n$ . venv/bin/activate\n$ pip install spruned\n```\n\n#### Installation from github\n\n```console\n$ cd ~/src\n$ sudo apt-get install libleveldb-dev python3-dev git virtualenv gcc g++\n$ git clone https://github.com/gdassori/spruned.git\n$ cd spruned\n$ virtualenv -p python3.6 venv\n$ . venv/bin/activate\n$ pip install -r requirements.txt\n$ python setup.py install\n```\n\n#### Usage\n\n\nspruned options:\n```console\n\n$ ~/src/spruned/venv/bin/spruned\n\nusage: spruned    [-h] [--rpcuser RPCUSER] [--rpcpassword RPCPASSWORD]\n                  [--rpcport RPCPORT] [--rpcbind RPCBIND] [--datadir DATADIR]\n                  [--daemon] [--keep-blocks KEEP_BLOCKS]\n                  [--network {bitcoin.mainnet,bitcoin.testnet}] [--debug]\n                  [--cache-size CACHE_SIZE] [--proxy PROXY] [--tor]\n                  [--no-dns-seeds] [--add-p2p-peer ADD_P2P_PEER]\n                  [--max-p2p-connections MAX_P2P_CONNECTIONS]\n                  [--add-electrum-server ELECTRUM_SERVER]\n                  [--max-electrum-connections MAX_ELECTRUM_CONNECTIONS]\n                  [--disable-p2p-peer-discovery]\n                  [--disable-electrum-peer-discovery]\n                  [--zmqpubhashblock ZMQPUBHASHBLOCK]\n                  [--zmqpubrawtx ZMQPUBRAWTX] [--zmqpubhashtx ZMQPUBHASHTX]\n                  [--zmqpubrawblock ZMQPUBRAWBLOCK]\n                  [--mempool-size MEMPOOL_SIZE]\n\nA Bitcoin Lightweight Client\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --rpcuser RPCUSER     Username for JSON-RPC connections (default: rpcuser)\n  --rpcpassword RPCPASSWORD\n                        Password for JSON-RPC connections (default: passw0rd)\n  --rpcport RPCPORT     Listen for JSON-RPC connections on \u003cport\u003e (default:\n                        8332 or testnet: 18332) (default: None)\n  --rpcbind RPCBIND     Bind to given address to listen for JSON-RPC\n                        connections. (default: 127.0.0.1)\n  --datadir DATADIR     Specify data directory (default: /home/guido/.spruned)\n  --daemon              Run in the background as a daemon and accept commands\n                        (default: False)\n  --keep-blocks KEEP_BLOCKS\n  --network {bitcoin.mainnet,bitcoin.testnet}\n  --debug               Enable debug mode (default: False)\n  --cache-size CACHE_SIZE\n                        Cache size (in megabytes) (default: 50)\n  --proxy PROXY         Proxy server (hostname:port) (default: None)\n  --tor                 Connect only to hidden services. Use proxy on\n                        localhost:9050, if nothing else is provided with\n                        --proxy (default: False)\n  --no-dns-seeds        Disable DNS seeds for P2P peers discovery (default:\n                        False)\n  --add-p2p-peer ADD_P2P_PEER\n                        Add a P2P peer (default: None)\n  --max-p2p-connections MAX_P2P_CONNECTIONS\n                        How many P2P peers to connect (default: None)\n  --add-electrum-server ELECTRUM_SERVER\n                        Add an Electrum server (default: None)\n  --max-electrum-connections MAX_ELECTRUM_CONNECTIONS\n                        How many Electrum servers to connect (default: None)\n  --disable-p2p-peer-discovery\n                        Control P2P peers discovery (getaddr) (default: False)\n  --disable-electrum-peer-discovery\n                        Control electrum peers discovery (peer subscribe)\n                        (default: False)\n  --zmqpubhashblock ZMQPUBHASHBLOCK\n                        Enable publish hash block in \u003caddress\u003e (default: )\n  --zmqpubrawtx ZMQPUBRAWTX\n                        Enable publish raw transaction in \u003caddress\u003e (default:\n                        )\n  --zmqpubhashtx ZMQPUBHASHTX\n                        Enable publish hash transaction in \u003caddress\u003e (default:\n                        )\n  --zmqpubrawblock ZMQPUBRAWBLOCK\n                        Enable publish raw block in \u003caddress\u003e (default: )\n  --mempool-size MEMPOOL_SIZE\n                        Set the mempool size in megabytes (0 = mempool\n                        disabled, default) - VERY experimental (default: 0)\n\n\n```\n\nAnd, once you run spruned:\n\n```console\n$ tail -f ~/.spruned/spruned.log # to see what's going on!\n```\n\nYou'll see it will took about 15 minutes to sync block headers (up to 2 hours on a raspberry pi zero, I'm working on this.)\n\nIn sync ? Ok, see the list of available commands:\n\n```console\n\nbitcoin-cli help\n\n== Blockchain ==\ngetbestblockhash\ngetblock \"blockhash\" ( verbosity )\ngetblockchaininfo\ngetblockcount\ngetblockhash height\ngetblockheader \"hash\" ( verbose )\ngettxout \"txid\" n ( include_mempool )\ngetmempoolinfo\ngetrawmempool\n\n== Rawtransactions ==\ngetrawtransaction \"txid\" ( verbose )\nsendrawtransaction \"hexstring\" ( allowhighfees )\n\n== Util ==\nestimatefee nblocks\nestimatesmartfee conf_target (\"estimate_mode\")\nuptime\n\n== Network ==\ngetpeerinfo\ngetnetworkinfo\n\n== Wallet ==\nvalidateaddress\n\n== Partially emulated for compatibility ==\ngetchaintxstats\ngetmininginfo\ngetnettotals\n\n```\n\nor check the status*:\n\n```console\n$ bitcoin-cli getblockchaininfo\n{\n  \"mediantime\": 1523387051,\n  \"blocks\": 517579,\n  \"headers\": 517579,\n  \"verificationprogress\": 100,\n  \"chain\": \"main\",\n  \"chainwork\": null,\n  \"difficulty\": null,\n  \"bestblockhash\": \"00000000000000000018e502dec1f93d32521674019a45d7d095cbd390279dff\",\n  \"warning\": \"spruned 0.0.1a7, emulating bitcoind v0.16\",\n  \"pruned\": false\n}\n```\n\nDownload a block:\n```console\n$ bitcoin-cli getblock `bitcoin-cli getblockhash 1`\n{\n  \"bits\": 486604799,\n  \"mediantime\": 1231469665,\n  \"nextblockhash\": \"000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd\",\n  \"tx\": [\n    \"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098\"\n  ],\n  \"previousblockhash\": \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\",\n  \"version\": 1,\n  \"chainwork\": \"Not Implemented Yet\",\n  \"nonce\": 2573394689,\n  \"time\": 1231469665,\n  \"height\": 1,\n  \"hash\": \"00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048\",\n  \"versionHex\": \"Not Implemented Yet\",\n  \"merkleroot\": \"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098\",\n  \"difficulty\": \"Not Implemented Yet\"\n}\n```\n\nOr a transaction:\n```console\n$ bitcoin-cli getrawtransaction 0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098\n01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff\n001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb\n8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000\n\n```\n\nOr in verbose mode:\n\n```console\n$ bitcoin-cli getrawtransaction 0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098 1\n{\n  \"txid\": \"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098\",\n  \"hash\": \"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098\",\n  \"version\": 1,\n  \"size\": 134,\n  \"vsize\": 134,\n  \"locktime\": 0,\n  \"vin\": [\n    {\n      \"coinbase\": \"04ffff001d0104\",\n      \"sequence\": 4294967295\n    }\n  ],\n  \"vout\": [\n    {\n      \"value\": 50.0,\n      \"n\": 0,\n      \"scriptPubKey\": {\n        \"asm\": \"0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG\",\n        \"hex\": \"410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac\",\n        \"reqSigs\": 1,\n        \"type\": \"pubkey\",\n        \"addresses\": [\n          \"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"\n        ]\n      }\n    }\n  ],\n  \"hex\": \"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000\",\n  \"blockhash\": \"00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048\",\n  \"confirmations\": 522493,\n  \"time\": 1231469665,\n  \"blocktime\": 1231469665\n}\n\n```\n\nAnd, eventually, broadcast one:\n```console\n$ bitcoin-cli sendrawtransaction 01000000011cee4c0dd7f1a90ae80311c414d48f3a16596e9ea08fa3edfb793734e2b2a100010000006a47304402205a665616085b4f425cccfde5be2113258f3c104c2c53ef918866ada8f02f7caf0220458bdbc220a3f1017b65d9138e5121a9c63decc89550a2e64e914013d26cb93b0121029643906e277eae677134d40356dfb575a2dfbe09a18a1fd7fadfd853715a7242ffffffff0234e3e600000000001976a91410a71790c6bbc2694c74b6fee9a449a11f74123388ac444c5501000000001976a9148c9e0a9029bbce075e2b5aae90010905aa4c64b188ac00000000\n489feae0e317b9255031710eadc238bb1ba3009fff0e86b303b0963e34a332b0\n\n```\n_* bitcoin-cli is not included_\n\u003cbr /\u003e\u003cbr /\u003e\n\n#### Emulated APIs as in bitcoind 0.16:\n```\n== Blockchain ==\n- getbestblockhash\n- getblock \"blockhash\" ( verbosity )\n- getblockchaininfo\n- getblockcount\n- getblockhash height\n- getblockheader \"hash\" ( verbose )\n\n- getmempoolinfo [ may be disabled, see help, --mempoolsize ]\n- getrawmempool [ may be disabled, see help, --mempoolsize ]\n\n- gettxout \"txid\" n ( include_mempool )\n- getrawtransaction \"txid\" ( verbose )\n- sendrawtransaction \"hexstring\" ( allowhighfees )\n\n- estimatefee nblocks\n- estimatesmartfee conf_target (\"estimate_mode\")\n\n- uptime\n- getpeerinfo\n- getnetworkinfo\n- validateaddress\n- getchaintxstats\n- getmininginfo\n- getnettotals\n```\n\n\n#### Requirements\n- An internet connection\n- **less than 500mb of disk space :-)**\n- Python \u003e= 3.5.2\n\n\n#### Limitations\n\n- Not fast as a full node: internet download is slower than a read from disk.\n- Doesn't help to keep the network healthy (I care about that, and this is really going to be addressed).\n- Privacy leaky if not behind Tor\n\n#### Roadmap\n \n- Maintenance web ui\n- Wallet APIs (electrum-servers based utxo management)\n- sPRUNED P2P network layer with cached blocks to offload the P2P network\n- Distribution\n- Network bandwidth reduction\n\n#### Support sPRUNED!\n\n- **Donate BTC to 3FVGopUDc6tyAP6t4P8f3GkYTJ5JD5tPwV** \n- Show your love. FOSS development is free, but time is scarce.\n\n#### Partecipate\n\n- spruned is a unique client, and could be adapted to any cryptocurrency. Contact me on Twitter for requests.\n- Run Electrum servers and full nodes.\n- Write extensive spruned documentation and guides.\n- Help improving spruned support to third-party applications. (ask missing APIs).\n- Report about your usage!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmempoolco%2Fspruned","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmempoolco%2Fspruned","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmempoolco%2Fspruned/lists"}