{"id":13436598,"url":"https://github.com/paritytech/parity-bitcoin","last_synced_at":"2025-05-16T15:07:25.872Z","repository":{"id":20343639,"uuid":"65720992","full_name":"paritytech/parity-bitcoin","owner":"paritytech","description":"The Parity Bitcoin client","archived":false,"fork":false,"pushed_at":"2023-06-14T16:13:51.000Z","size":18089,"stargazers_count":724,"open_issues_count":54,"forks_count":217,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-05-15T00:16:57.659Z","etag":null,"topics":["bitcoin","blockchain","client","node","parity","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paritytech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-15T09:30:15.000Z","updated_at":"2025-03-17T16:25:32.000Z","dependencies_parsed_at":"2024-10-27T19:14:05.637Z","dependency_job_id":"175861b4-9d7b-407c-8581-9d27a33f6472","html_url":"https://github.com/paritytech/parity-bitcoin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Fparity-bitcoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Fparity-bitcoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Fparity-bitcoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Fparity-bitcoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paritytech","download_url":"https://codeload.github.com/paritytech/parity-bitcoin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553958,"owners_count":22090417,"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","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","blockchain","client","node","parity","rust"],"created_at":"2024-07-31T03:00:50.595Z","updated_at":"2025-05-16T15:07:25.853Z","avatar_url":"https://github.com/paritytech.png","language":"Rust","readme":"# The Parity Bitcoin client.\n\n# THIS IS UNMAINTAINED HISTORICAL SOFTWARE\n\n[![Build Status][travis-image]][travis-url] [![Snap Status](https://build.snapcraft.io/badge/paritytech/parity-bitcoin.svg)](https://build.snapcraft.io/user/paritytech/parity-bitcoin)\n\nGitter [![Gitter https://gitter.im/paritytech/parity-bitcoin](https://badges.gitter.im/paritytech/parity-bitcoin.svg)](https://gitter.im/paritytech/parity-bitcoin)\n\n- [Installing from source](#installing-from-source)\n\n- [Installing the snap](#installing-the-snap)\n\n- [Running tests](#running-tests)\n\n- [Going online](#going-online)\n\n- [Importing bitcoind database](#importing-bitcoind-database)\n\n- [Command line interface](#command-line-interface)\n\n- [JSON-RPC](#json-rpc)\n\n- [Logging](#logging)\n\n- [Internal Documentation](#internal-documentation)\n\n- [Project Graph][graph]\n\n[graph]: ./tools/graph.svg\n[travis-image]: https://travis-ci.com/paritytech/parity-bitcoin.svg?token=DMFvZu71iaTbUYx9UypX\u0026branch=master\n[travis-url]: https://travis-ci.com/paritytech/parity-bitcoin\n[doc-url]: https://paritytech.github.io/parity-bitcoin/pbtc/index.html\n\n## Installing from source\n\nInstalling `pbtc` from source requires `rustc` and `cargo`.\n\nMinimal supported version is `rustc 1.23.0 (766bd11c8 2018-01-01)`\n\n#### Install rustc and cargo\n\nBoth `rustc` and `cargo` are a part of rust tool-chain.\n\nAn easy way to install the stable binaries for Linux and Mac is to run this in your shell:\n\n```\ncurl -sSf https://static.rust-lang.org/rustup.sh | sh\n```\n\nWindows binaries can be downloaded from [rust-lang website](https://www.rust-lang.org/en-US/downloads.html).\n\n#### Install C and C++ compilers\n\nYou will need the cc and gcc compilers to build some of the dependencies.\n\n```\nsudo apt-get update\nsudo apt-get install build-essential\n```\n\n#### Clone and build pbtc\n\nNow let's clone `pbtc` and enter it's directory:\n\n```\ngit clone https://github.com/paritytech/parity-bitcoin\ncd parity-bitcoin\n```\n\n`pbtc` can be build in two modes. `--debug` and `--release`. Debug is the default.\n\n```\n# builds pbtc in debug mode\ncargo build -p pbtc\n```\n\n```\n# builds pbtc in release mode\ncargo build -p pbtc --release\n```\n\n`pbtc` is now available at either `./target/debug/pbtc` or `./target/release/pbtc`.\n\n## Installing the snap\n\nIn any of the [supported Linux distros](https://snapcraft.io/docs/core/install):\n\n```\nsudo snap install parity-bitcoin --edge\n```\n\n## Running tests\n\n`pbtc` has internal unit tests and it conforms to external integration tests.\n\n#### Running unit tests\n\nAssuming that repository is already cloned, we can run unit tests with this command:\n\n```\ncargo test --all\n```\n\n#### Running external integration tests\n\nRunning integration tests is automated, as the regtests repository is one of the submodules. Let's download it first:\n\n```\ngit submodule update --init\n```\n\nNow we can run them using the command:\n\n```\n./tools/regtests.sh\n```\n\nIt is also possible to run regtests manually:\n\n```\n# let's start pbtc in regtest compatible mode\n./target/release/pbtc --btc --regtest\n\n# now in second shell window\ncd $HOME\ngit clone https://github.com/TheBlueMatt/test-scripts\ncd test-scripts\njava -jar pull-tests-f56eec3.jar\n\n```\n\n## Going online\n\nBy default parity connects to bitcoind-seednodes. Full list is available [here](./pbtc/seednodes.rs).\n\nBefore starting synchronization, you must decide - which fork to follow - Bitcoin Core (`--btc` flag) or Bitcoin Cash (`--bch` flag). On next start, passing the same flag is optional, as the database is already bound to selected fork and won't be synchronized using other verification rules.\n\nTo start syncing the main network, just start the client, passing selected fork flag. For example:\n\n```\n./target/release/pbtc --btc\n```\n\nTo start syncing the testnet:\n\n```\n./target/release/pbtc --btc --testnet\n```\n\nTo not print any syncing progress add `--quiet` flag:\n\n```\n./target/release/pbtc --btc --quiet\n```\n\n## Importing bitcoind database\n\nIt is possible to import existing `bitcoind` database:\n\n```\n# where $BITCOIND_DB is path to your bitcoind database, e.g., \"/Users/user/Library/Application Support\"\n./target/release/pbtc import \"$BITCOIND_DB/Bitcoin/blocks\"\n```\n\nBy default import verifies imported the blocks. You can disable this, by adding `--verification-level=none` flag.\n\n```\n./target/release/pbtc --btc --verification-level=none import \"$BITCOIND_DB/Bitcoin/blocks\"\n```\n\n## Command line interface\n\nFull list of CLI options, which is available under `pbtc --help`:\n\n```\npbtc 0.1.0\nParity Technologies \u003cinfo@parity.io\u003e\nParity Bitcoin client\n\nUSAGE:\n    pbtc [FLAGS] [OPTIONS] [SUBCOMMAND]\n\nFLAGS:\n        --bch             Use Bitcoin Cash verification rules (BCH).\n        --btc             Use Bitcoin Core verification rules (BTC).\n    -h, --help            Prints help information\n        --no-jsonrpc      Disable the JSON-RPC API server.\n    -q, --quiet           Do not show any synchronization information in the console.\n        --regtest         Use a private network for regression tests.\n        --testnet         Use the test network (Testnet3).\n    -V, --version         Prints version information\n\nOPTIONS:\n        --blocknotify \u003cCOMMAND\u003e            Execute COMMAND when the best block changes (%s in COMMAND is replaced by the block hash).\n    -c, --connect \u003cIP\u003e                     Connect only to the specified node.\n    -d, --data-dir \u003cPATH\u003e                  Specify the database and configuration directory PATH.\n        --db-cache \u003cSIZE\u003e                  Sets the database cache size.\n        --jsonrpc-apis \u003cAPIS\u003e              Specify the APIs available through the JSONRPC interface. APIS is a comma-delimited list of API names.\n        --jsonrpc-cors \u003cURL\u003e               Specify CORS header for JSON-RPC API responses.\n        --jsonrpc-hosts \u003cHOSTS\u003e            List of allowed Host header values.\n        --jsonrpc-interface \u003cINTERFACE\u003e    The hostname portion of the JSONRPC API server.\n        --jsonrpc-port \u003cPORT\u003e              Specify the PORT for the JSONRPC API server.\n        --only-net \u003cNET\u003e                   Only connect to nodes in network version \u003cNET\u003e (ipv4 or ipv6).\n        --port \u003cPORT\u003e                      Listen for connections on PORT.\n    -s, --seednode \u003cIP\u003e                    Connect to a seed-node to retrieve peer addresses, and disconnect.\n        --verification-edge \u003cBLOCK\u003e        Non-default verification-level is applied until a block with given hash is met.\n        --verification-level \u003cLEVEL\u003e       Sets the Blocks verification level to full (default), header (scripts are not verified), or none (no verification at all).\n\nSUBCOMMANDS:\n    help        Prints this message or the help of the given subcommand(s)\n    import      Import blocks from a Bitcoin Core database.\n    rollback    Rollback the database to given canonical-chain block.\n```\n\n## JSON-RPC\n\nThe JSON-RPC interface is served on port :8332 for mainnet and :18332 for testnet unless you specified otherwise. So if you are using testnet, you will need to change the port in the sample curl requests shown below.\n\n#### Network\n\nThe Parity-bitcoin `network` interface.\n\n##### addnode\n\nAdd the node.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"addnode\", \"params\": [\"127.0.0.1:8888\", \"add\"], \"id\":1 }' localhost:8332\n\nRemove the node.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"addnode\", \"params\": [\"127.0.0.1:8888\", \"remove\"], \"id\":1 }' localhost:8332\n\nConnect to the node.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"addnode\", \"params\": [\"127.0.0.1:8888\", \"onetry\"], \"id\":1 }' localhost:8332\n\n##### getaddednodeinfo\n\nQuery info for all added nodes.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"id\":\"1\", \"method\": \"getaddednodeinfo\", \"params\": [true] }' localhost:8332\n\nQuery info for the specified node.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"id\":\"1\", \"method\": \"getaddednodeinfo\", \"params\": [true, \"192.168.0.201\"] }' localhost:8332\n\n##### getconnectioncount\n\nGet the peer count.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"id\":\"1\", \"method\": \"getconnectioncount\", \"params\": [] }' localhost:8332\n\n#### Blockchain\n\nThe Parity-bitcoin `blockchain` data interface.\n\n##### getbestblockhash\n\nGet hash of best block.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"getbestblockhash\", \"params\": [], \"id\":1 }' localhost:8332\n\n##### getblockcount\n\nGet height of best block.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"getblockcount\", \"params\": [], \"id\":1 }' localhost:8332\n\n##### getblockhash\n\nGet hash of block at given height.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"getblockhash\", \"params\": [0], \"id\":1 }' localhost:8332\n\n##### getdifficulty\n\nGet proof-of-work difficulty as a multiple of the minimum difficulty\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"getdifficulty\", \"params\": [], \"id\":1 }' localhost:8332\n\n##### getblock\n\nGet information on given block.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"getblock\", \"params\": [\"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\"], \"id\":1 }' localhost:8332\n\n##### gettxout\n\nGet details about an unspent transaction output.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"gettxout\", \"params\": [\"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\", 0], \"id\":1 }' localhost:8332\n\n##### gettxoutsetinfo\n\nGet statistics about the unspent transaction output set.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"gettxoutsetinfo\", \"params\": [], \"id\":1 }' localhost:8332\n\n#### Miner\n\nThe Parity-bitcoin `miner` data interface.\n\n##### getblocktemplate\n\nGet block template for mining.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"getblocktemplate\", \"params\": [{\"capabilities\": [\"coinbasetxn\", \"workid\", \"coinbase/append\"]}], \"id\":1 }' localhost:8332\n\n#### Raw\n\nThe Parity-bitcoin `raw` data interface.\n\n\n##### getrawtransaction\n\nReturn the raw transaction data.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"getrawtransaction\", \"params\": [\"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\"], \"id\":1 }' localhost:8332\n\n##### decoderawtransaction\n\nReturn an object representing the serialized, hex-encoded transaction.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"decoderawtransaction\", \"params\": [\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000\"], \"id\":1 }' localhost:8332\n\n##### createrawtransaction\n\nCreate a transaction spending the given inputs and creating new outputs.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"createrawtransaction\", \"params\": [[{\"txid\":\"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\",\"vout\":0}],{\"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\":0.01}], \"id\":1 }' localhost:8332\n\n##### sendrawtransaction\n\nAdds transaction to the memory pool \u0026\u0026 relays it to the peers.\n\n    curl -H 'content-type: application/json' --data-binary '{\"jsonrpc\": \"2.0\", \"method\": \"sendrawtransaction\", \"params\": [\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000\"], \"id\":1 }' localhost:8332\n\n## Logging\n\nThis is a section only for developers and power users.\n\nYou can enable detailed client logging by setting the environment variable `RUST_LOG`, e.g.,\n\n```\nRUST_LOG=verification=info ./target/release/pbtc --btc\n```\n\n`pbtc` started with this environment variable will print all logs coming from `verification` module with verbosity `info` or higher. Available log levels are:\n\n- `error`\n- `warn`\n- `info`\n- `debug`\n- `trace`\n\nIt's also possible to start logging from multiple modules in the same time:\n\n```\nRUST_LOG=sync=trace,p2p=trace,verification=trace,db=trace ./target/release/pbtc --btc\n```\n\n## Internal documentation\n\nOnce released, `pbtc` documentation will be available [here][doc-url]. Meanwhile it's only possible to build it locally:\n\n```\ncd parity-bitcoin\n./tools/doc.sh\nopen target/doc/pbtc/index.html\n```\n","funding_links":[],"categories":["Applications","Blockchains","Rust","Bitcoin","应用","应用 Applications","开源项目","应用程序 Applications"],"sub_categories":["Cryptocurrencies","Blockchain","加密货币","加密货币 Cryptocurrencies","Rust区块链项目"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Fparity-bitcoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparitytech%2Fparity-bitcoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Fparity-bitcoin/lists"}