$ bitcoin_hashes
v0.18.0Hash functions used by the rust-bitcoin eccosystem
Latest Update Summary
Crate
Name: bitcoin_hashes New version: 0.17.0 Release date: 2023-10-14T20:30:14Z
Crate readme
Short description Library with support for de/serialization, parsing and executing on data-structures and network messages related to Bitcoin.
Long description This library supports de/serialization of Bitcoin protocol network messages, blocks, transactions, private keys, and addresses. It also offers BIP-0032 support and PSBT v0 de/serialization, although it should not be used for consensus code due to potential deviations from the Bitcoin Core reference implementation. The library is intended for use with Rust 1.74.0 or later and provides no-std support.
Features • De/serialization of Bitcoin protocol network messages • De/serialization of blocks and transactions • Script de/serialization • Private keys and address creation, de/serialization and validation with full BIP-0032 support • PSBT v0 de/serialization
Code Examples Basic usage
git clone git@github.com:rust-bitcoin/rust-bitcoin.git
cd rust-bitcoin
cargo build
Run tests
cargo test
No-std support
To build this project without the Rust standard library, use the --no-default-features flag or set default-features = false in your dependency declaration.
Building the docs
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --features="$FEATURES" -- -D rustdoc::broken-intra-doc-links
Run benchmarks
RUSTFLAGS='--cfg=bench' cargo +nightly bench
Links • https://crates.io/crates/bitcoin • https://github.com/rust-bitcoin/rust-bitcoin/blob/master/LICENSE • https://docs.rs/bitcoin • https://github.com/rust-bitcoin/rust-bitcoincore-rpc • https://gnusha.org/bitcoin-rust/ • https://github.com/rust-bitcoin/rust-bitcoin/pull/14 • https://github.com/rust-bitcoin/rust-bitcoin/pull/18 • https://github.com/rust-bitcoin/rust-bitcoin/pull/22 • https://github.com/rust-bitcoin/rust-bitcoin/pull/25 • https://github.com/rust-bitcoin/rust-bitcoin/pull/29 • https://github.com/rust-bitcoin/rust-bitcoin/pull/32 • https://github.com/rust-bitcoin/rust-bitcoin/pull/33 • https://github.com/rust-bitcoin/rust-bitcoin/pull/34 • https://github.com/rust-bitcoin/rust-bitcoin/pull/35 • https://github.com/rust-bitcoin/rust-bitcoin/pull/46 • https://github.com/rust-bitcoin/rust-bitcoin/pull/58 • https://github.com/rust-bitcoin/rust-bitcoin/pull/60 • https://github.com/rust-bitcoin/rust-bitcoin/pull/62 • https://github.com/rust-bitcoin/rust-bitcoin/pull/65 https://docs.rs/bitcoin_hashes/ https://api.github.com/repos/rust-bitcoin/rust-bitcoin/releases/125101316
Release info
Release version: 0.17.0
Release description
Version 0.17.0 introduces several significant updates and enhancements to the rust-bitcoin project. Key changes include replacing the use of time with std::time, strengthening the library by fixing vulnerabilities discovered through cargo audit, and adding new features like the GetAddr message. Additional changes include improved function sets in the script, such as to_p2wsh() and is_p2swsh(), and the introduction of new modules like bip143 for creating BIP143 signature hashes. The updates also include a more robust transaction structure, with the addition of the txid() method and improvements to existing methods, enhancing the library's utility for developers. The removal of deprecated functions, updates to documentation, and better handling of mem::uninitialized contribute to cleaner, more maintainable code. Notably, several contributions from new developers have also been acknowledged, which reflects a growing community around the project. For a complete list of contributions and code changes, see the full changelog.
Code Examples Fix vulnerabilities reported by cargo audit
// Ensuring vulnerabilities are addressed by running...
cargo audit
New GetAddr message example
let message = GetAddr::new();
// Now you can use message in your application
Implementation of txid() method
impl Transaction {
pub fn txid(&self) -> Txid {
// Calculate the transaction ID based on current transaction data
}
}
Patch update: 0.18.0 → 0.18.0
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add bitcoin_hashesOr add to Cargo.toml: bitcoin_hashes = "0.18.0"