{"id":13503699,"url":"https://github.com/rust-bitcoin/rust-bitcoin","last_synced_at":"2025-05-13T17:03:45.259Z","repository":{"id":18769223,"uuid":"21982089","full_name":"rust-bitcoin/rust-bitcoin","owner":"rust-bitcoin","description":"Rust Bitcoin library","archived":false,"fork":false,"pushed_at":"2025-05-06T13:42:38.000Z","size":16628,"stargazers_count":2334,"open_issues_count":469,"forks_count":808,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-05-06T16:12:42.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-bitcoin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2014-07-18T13:58:05.000Z","updated_at":"2025-05-06T15:51:48.000Z","dependencies_parsed_at":"2023-01-16T21:16:01.514Z","dependency_job_id":"d6e6747a-84dc-41d6-87fb-35414f26c49e","html_url":"https://github.com/rust-bitcoin/rust-bitcoin","commit_stats":{"total_commits":1942,"total_committers":120,"mean_commits":"16.183333333333334","dds":0.7059732234809475,"last_synced_commit":"84a075d03a2ea158430c0ef6bf0efb35a4c60b3f"},"previous_names":[],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-bitcoin%2Frust-bitcoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-bitcoin%2Frust-bitcoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-bitcoin%2Frust-bitcoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-bitcoin%2Frust-bitcoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-bitcoin","download_url":"https://codeload.github.com/rust-bitcoin/rust-bitcoin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990455,"owners_count":21995773,"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":[],"created_at":"2024-07-31T23:00:43.615Z","updated_at":"2025-05-13T17:03:45.189Z","avatar_url":"https://github.com/rust-bitcoin.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eRust Bitcoin\u003c/h1\u003e\n\n  \u003cimg alt=\"Rust Bitcoin logo by Hunter Trujillo, see license and source files under /logo\" src=\"./logo/rust-bitcoin.png\" width=\"300\" /\u003e\n\n  \u003cp\u003eLibrary with support for de/serialization, parsing and executing on data-structures\n    and network messages related to Bitcoin.\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://crates.io/crates/bitcoin\"\u003e\u003cimg alt=\"Crate Info\" src=\"https://img.shields.io/crates/v/bitcoin.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rust-bitcoin/rust-bitcoin/blob/master/LICENSE\"\u003e\u003cimg alt=\"CC0 1.0 Universal Licensed\" src=\"https://img.shields.io/badge/license-CC0--1.0-blue.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/rust-bitcoin/rust-bitcoin/actions?query=workflow%3AContinuous%20integration\"\u003e\u003cimg alt=\"CI Status\" src=\"https://github.com/rust-bitcoin/rust-bitcoin/workflows/Continuous%20integration/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/bitcoin\"\u003e\u003cimg alt=\"API Docs\" src=\"https://img.shields.io/badge/docs.rs-bitcoin-green\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html\"\u003e\u003cimg alt=\"Rustc Version 1.63.0+\" src=\"https://img.shields.io/badge/rustc-1.63.0%2B-lightgrey.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://gnusha.org/bitcoin-rust/\"\u003e\u003cimg alt=\"Chat on IRC\" src=\"https://img.shields.io/badge/irc-%23bitcoin--rust%20on%20libera.chat-blue\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/model-checking/kani\"\u003e\u003cimg alt=\"kani\" src=\"https://github.com/rust-bitcoin/rust-bitcoin/workflows/Kani%20CI/badge.svg\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n[Documentation](https://docs.rs/bitcoin/)\n\nSupports (or should support)\n\n* De/serialization of Bitcoin protocol network messages\n* De/serialization of blocks and transactions\n* Script de/serialization\n* Private keys and address creation, de/serialization and validation (including full BIP32 support)\n* PSBT v0 de/serialization and all but the Input Finalizer role. Use [rust-miniscript](https://docs.rs/miniscript/latest/miniscript/psbt/index.html) to finalize.\n\nFor JSONRPC interaction with Bitcoin Core, it is recommended to use\n[rust-bitcoincore-rpc](https://github.com/rust-bitcoin/rust-bitcoincore-rpc).\n\nIt is recommended to always use [cargo-crev](https://github.com/crev-dev/cargo-crev) to verify the\ntrustworthiness of each of your dependencies, including this one.\n\n## Known limitations\n\n### Consensus\n\nThis library **must not** be used for consensus code (i.e. fully validating blockchain data). It\ntechnically supports doing this, but doing so is very ill-advised because there are many deviations,\nknown and unknown, between this library and the Bitcoin Core reference implementation. In a\nconsensus based cryptocurrency, such as Bitcoin, it is critical that all parties are using the same\nrules to validate data, and this library is simply unable to implement the same rules as Core.\n\nGiven the complexity of both C++ and Rust, it is unlikely that this will ever be fixed, and there\nare no plans to do so. Of course, patches to fix specific consensus incompatibilities are welcome.\n\n### Support for 16-bit pointer sizes\n\n16-bit pointer sizes are not supported, and we can't promise they will be. If you care about them\nplease let us know, so we can know how large the interest is and possibly decide to support them.\n\n### Semver compliance\n\nWe try hard to maintain strict semver compliance with our releases. This codebase includes some\npublic functions marked unstable (e.g., `pub fn foo__unstable()`). These functions do not adhere to\nsemver rules; use them at your own discretion.\n\n\n## Documentation\n\nCurrently can be found on [docs.rs/bitcoin](https://docs.rs/bitcoin/). Patches to add usage examples\nand to expand on existing docs would be extremely appreciated.\n\n## Contributing\n\nContributions are generally welcome. If you intend to make larger changes please discuss them in an\nissue before PRing them to avoid duplicate work and architectural mismatches. If you have any\nquestions or ideas you want to discuss, please join us in\n[#bitcoin-rust](https://web.libera.chat/?channel=#bitcoin-rust) on\n[libera.chat](https://libera.chat).\n\nFor more information, please see [`CONTRIBUTING.md`](./CONTRIBUTING.md).\n\n## Minimum Supported Rust Version (MSRV)\n\nThis library should compile with any combination of features on **Rust 1.63.0**.\n\nUse `Cargo-minimal.lock` to build the MSRV by copying to `Cargo.lock` and building.\n\n## External dependencies\n\nWe integrate with a few external libraries, most notably `serde`. These\nare available via feature flags. To ensure compatibility and MSRV stability, we\nprovide two lock files as a means of inspecting compatible versions:\n`Cargo-minimal.lock` containing minimal versions of dependencies and\n`Cargo-recent.lock` containing recent versions of dependencies tested in our CI.\n\nWe do not provide any guarantees about the content of these lock files outside\nof \"our CI didn't fail with these versions\". Specifically, we do not guarantee\nthat the committed hashes are free from malware. It is your responsibility to\nreview them.\n\n## Installing Rust\n\nRust can be installed using your package manager of choice or [rustup.rs](https://rustup.rs). The\nformer way is considered more secure since it typically doesn't involve trust in the CA system. But\nyou should be aware that the version of Rust shipped by your distribution might be out of date.\nGenerally this isn't a problem for `rust-bitcoin` since we support much older versions than the\ncurrent stable one (see MSRV section).\n\n## Building\n\nThe library can be built and tested using [`cargo`](https://github.com/rust-lang/cargo/):\n\n```\ngit clone git@github.com:rust-bitcoin/rust-bitcoin.git\ncd rust-bitcoin\ncargo build\n```\n\nYou can run tests with:\n\n```\ncargo test\n```\n\nPlease refer to the [`cargo` documentation](https://doc.rust-lang.org/stable/cargo/) for more\ndetailed instructions.\n\n### No-std support\n\nThe `std` cargo feature is enabled by default. To build this project without the Rust standard\nlibrary, use the `--no-default-features` flag or set `default-features = false` in your dependency\ndeclaration when adding it to your project.\n\nFor embedded device examples, see [`bitcoin/embedded`](https://github.com/rust-bitcoin/rust-bitcoin/tree/master/bitcoin/embedded)\nor [`hashes/embedded`](https://github.com/rust-bitcoin/rust-bitcoin/tree/master/hashes/embedded).\n\n### Just\n\nWe support [`just`](https://just.systems/man/en/) for running dev workflow commands. Run `just` from\nyour shell to see a list of available sub-commands.\n\n### Building the docs\n\nWe build docs with the nightly toolchain, you may wish to use the following shell alias to check\nyour documentation changes build correctly.\n\n```\nalias build-docs='RUSTDOCFLAGS=\"--cfg docsrs\" cargo +nightly rustdoc --features=\"$FEATURES\" -- -D rustdoc::broken-intra-doc-links'\n```\n\n## Testing\n\nUnit and integration tests are available for those interested, along with benchmarks. For project\ndevelopers, especially new contributors looking for something to work on, we do:\n\n- Fuzz testing with [`Honggfuzz`](https://github.com/rust-fuzz/honggfuzz-rs)\n- Mutation testing with [`cargo-mutants`](https://github.com/sourcefrog/cargo-mutants)\n- Code verification with [`Kani`](https://github.com/model-checking/kani)\n\nThere are always more tests to write and more bugs to find. PRs are extremely welcomed.\nPlease consider testing code as a first-class citizen. We definitely do take PRs\nimproving and cleaning up test code.\n\n### Unit/Integration tests\n\nRun as for any other Rust project `cargo test --all-features`.\n\n### Benchmarks\n\nWe use a custom Rust compiler configuration conditional to guard the bench mark code. To run the\nbench marks use: `RUSTFLAGS='--cfg=bench' cargo +nightly bench`.\n\n### Mutation tests\n\nWe are doing mutation testing with [cargo-mutants](https://github.com/sourcefrog/cargo-mutants). To run\nthese tests first install with `cargo install --locked cargo-mutants` then run with `cargo mutants --in-place --no-shuffle`.\nNote that running these mutation tests will take on the order of 10's of minutes.\n\n### Code verification\n\nWe have started using [kani](https://github.com/model-checking/kani), install with `cargo install --locked kani-verifier`\n (no need to run `cargo kani setup`). Run the tests with `cargo kani`.\n\n## Pull Requests\n\nEvery PR needs at least two reviews to get merged. During the review phase, maintainers and\ncontributors are likely to leave comments and request changes. Please try to address them, otherwise\nyour PR might get closed without merging after a longer time of inactivity. If your PR isn't ready\nfor review yet please mark it by prefixing the title with `WIP: `.\n\n### CI Pipeline\n\nThe CI pipeline requires approval before being run on each MR.\n\nIn order to speed up the review process the CI pipeline can be run locally using\n[act](https://github.com/nektos/act). The `fuzz` and `Cross` jobs will be skipped when using `act`\ndue to caching being unsupported at this time. We do not *actively* support `act` but will merge PRs\nfixing `act` issues.\n\n### Githooks\n\nTo assist devs in catching errors _before_ running CI we provide some githooks. Copy the hooks in `githooks/`\nto your githooks folder or run `just githooks-install` to copy them all.\n\n## Policy on Altcoins/Altchains\n\nSince the altcoin landscape includes projects which [frequently appear and disappear, and are poorly\ndesigned anyway](https://download.wpsoftware.net/bitcoin/alts.pdf) we do not support any altcoins.\nSupporting Bitcoin properly is already difficult enough, and we do not want to increase the\nmaintenance burden and decrease API stability by adding support for other coins.\n\nOur code is public domain so by all means fork it and go wild :)\n\n\n## Release Notes\n\nRelease notes are done per crate, see:\n\n- [`bitcoin` CHANGELOG](bitcoin/CHANGELOG.md)\n- [`addresses` CHANGELOG](addresses/CHANGELOG.md)\n- [`base58` CHANGELOG](base58/CHANGELOG.md)\n- [`hashes` CHANGELOG](hashes/CHANGELOG.md)\n- [`internals` CHANGELOG](internals/CHANGELOG.md)\n- [`io` CHANGELOG](io/CHANGELOG.md)\n- [`primitives` CHANGELOG](primitives/CHANGELOG.md)\n- [`units` CHANGELOG](units/CHANGELOG.md)\n\n\n## Licensing\n\nThe code in this project is licensed under the [Creative Commons CC0 1.0 Universal license](LICENSE).\nWe use the [SPDX license list](https://spdx.org/licenses/) and [SPDX IDs](https://spdx.dev/ids/).\n","funding_links":[],"categories":["Awesome Rust Bitcoin","Rust","Applications","Rust Libraries","Development Tools","应用程序 Applications","区块链"],"sub_categories":["Rust Bitcoin Cookbook","Blockchain","Cryptocurrencies","加密货币 Cryptocurrencies"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-bitcoin%2Frust-bitcoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-bitcoin%2Frust-bitcoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-bitcoin%2Frust-bitcoin/lists"}