From 5d8aa9406980c71e74e3d5b6ec40c45a354717ee Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Mon, 17 Jun 2024 19:10:23 +0000 Subject: [PATCH 1/7] Move merkle_tree hash types Currently we are defining the two merkle tree hash types in the `block` module, a better home for them is the `merkle_tree` module. This is an API breaking change because the types were public in the `block` module, however the change should/could be unnoticeable to users if they use the crate level re-export - which is maintained. --- bitcoin/src/bip152.rs | 2 +- bitcoin/src/blockdata/block.rs | 19 +++---------------- bitcoin/src/consensus/encode.rs | 3 ++- bitcoin/src/lib.rs | 4 ++-- bitcoin/src/merkle_tree/block.rs | 3 ++- bitcoin/src/merkle_tree/mod.rs | 21 ++++++++++++++++++++- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/bitcoin/src/bip152.rs b/bitcoin/src/bip152.rs index 766a82e0e..e11bac45c 100644 --- a/bitcoin/src/bip152.rs +++ b/bitcoin/src/bip152.rs @@ -374,10 +374,10 @@ mod test { use hex::FromHex; use super::*; - use crate::blockdata::block::TxMerkleNode; use crate::blockdata::locktime::absolute; use crate::blockdata::transaction; use crate::consensus::encode::{deserialize, serialize}; + use crate::merkle_tree::TxMerkleNode; use crate::{Amount, CompactTarget, OutPoint, ScriptBuf, Sequence, TxIn, TxOut, Txid, Witness}; fn dummy_tx(nonce: &[u8]) -> Transaction { diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs index 68c2eae7b..5f36ce0bb 100644 --- a/bitcoin/src/blockdata/block.rs +++ b/bitcoin/src/blockdata/block.rs @@ -14,34 +14,21 @@ use io::{BufRead, Write}; use super::Weight; use crate::blockdata::script; -use crate::blockdata::transaction::{Transaction, Txid, Wtxid}; +use crate::blockdata::transaction::{Transaction, Wtxid}; use crate::consensus::{encode, Decodable, Encodable, Params}; use crate::internal_macros::{impl_consensus_encoding, impl_hashencode}; +use crate::merkle_tree::{self, TxMerkleNode, WitnessMerkleNode}; use crate::pow::{CompactTarget, Target, Work}; use crate::prelude::*; -use crate::{merkle_tree, VarInt}; +use crate::VarInt; hashes::hash_newtype! { /// A bitcoin block hash. pub struct BlockHash(sha256d::Hash); - /// A hash of the Merkle tree branch or root for transactions. - pub struct TxMerkleNode(sha256d::Hash); - /// A hash corresponding to the Merkle tree root for witness data. - pub struct WitnessMerkleNode(sha256d::Hash); /// A hash corresponding to the witness structure commitment in the coinbase transaction. pub struct WitnessCommitment(sha256d::Hash); } impl_hashencode!(BlockHash); -impl_hashencode!(TxMerkleNode); -impl_hashencode!(WitnessMerkleNode); - -impl From for TxMerkleNode { - fn from(txid: Txid) -> Self { Self::from_byte_array(txid.to_byte_array()) } -} - -impl From for WitnessMerkleNode { - fn from(wtxid: Wtxid) -> Self { Self::from_byte_array(wtxid.to_byte_array()) } -} /// Bitcoin block header. /// diff --git a/bitcoin/src/consensus/encode.rs b/bitcoin/src/consensus/encode.rs index beed6e5b2..7380805ef 100644 --- a/bitcoin/src/consensus/encode.rs +++ b/bitcoin/src/consensus/encode.rs @@ -23,9 +23,10 @@ use io::{BufRead, Cursor, Read, Write}; use crate::bip152::{PrefilledTransaction, ShortId}; use crate::bip158::{FilterHash, FilterHeader}; -use crate::blockdata::block::{self, BlockHash, TxMerkleNode}; +use crate::blockdata::block::{self, BlockHash}; use crate::blockdata::transaction::{Transaction, TxIn, TxOut}; use crate::consensus::{DecodeError, IterReader}; +use crate::merkle_tree::TxMerkleNode; #[cfg(feature = "std")] use crate::p2p::{ address::{AddrV2Message, Address}, diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index 1d03fef81..5fdbe4fb1 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -116,7 +116,7 @@ pub use crate::{ amount::{Amount, Denomination, SignedAmount}, bip158::{FilterHash, FilterHeader}, bip32::XKeyIdentifier, - blockdata::block::{self, Block, BlockHash, TxMerkleNode, WitnessMerkleNode, WitnessCommitment}, + blockdata::block::{self, Block, BlockHash, WitnessCommitment}, blockdata::constants, blockdata::fee_rate::FeeRate, blockdata::locktime::{self, absolute, relative}, @@ -132,7 +132,7 @@ pub use crate::{ crypto::ecdsa, crypto::key::{self, PrivateKey, PubkeyHash, PublicKey, CompressedPublicKey, WPubkeyHash, XOnlyPublicKey}, crypto::sighash::{self, LegacySighash, SegwitV0Sighash, TapSighash, TapSighashTag}, - merkle_tree::MerkleBlock, + merkle_tree::{MerkleBlock, TxMerkleNode, WitnessMerkleNode}, network::{Network, NetworkKind}, pow::{CompactTarget, Target, Work}, psbt::Psbt, diff --git a/bitcoin/src/merkle_tree/block.rs b/bitcoin/src/merkle_tree/block.rs index fbd6f92ff..8f090edef 100644 --- a/bitcoin/src/merkle_tree/block.rs +++ b/bitcoin/src/merkle_tree/block.rs @@ -14,10 +14,11 @@ use core::fmt; use io::{BufRead, Write}; use self::MerkleBlockError::*; -use crate::blockdata::block::{self, Block, TxMerkleNode}; +use crate::blockdata::block::{self, Block}; use crate::blockdata::transaction::{Transaction, Txid}; use crate::blockdata::weight::Weight; use crate::consensus::encode::{self, Decodable, Encodable, MAX_VEC_SIZE}; +use crate::merkle_tree::TxMerkleNode; use crate::prelude::*; /// Data structure that represents a block header paired to a partial merkle tree. diff --git a/bitcoin/src/merkle_tree/mod.rs b/bitcoin/src/merkle_tree/mod.rs index d91a81e48..4ef118d6d 100644 --- a/bitcoin/src/merkle_tree/mod.rs +++ b/bitcoin/src/merkle_tree/mod.rs @@ -18,16 +18,35 @@ mod block; use core::cmp::min; use core::iter; -use hashes::Hash; +use hashes::{sha256d, Hash}; use io::Write; use crate::consensus::encode::Encodable; +use crate::internal_macros::impl_hashencode; use crate::prelude::*; +use crate::{Txid, Wtxid}; #[rustfmt::skip] #[doc(inline)] pub use self::block::{MerkleBlock, MerkleBlockError, PartialMerkleTree}; +hashes::hash_newtype! { + /// A hash of the Merkle tree branch or root for transactions. + pub struct TxMerkleNode(sha256d::Hash); + /// A hash corresponding to the Merkle tree root for witness data. + pub struct WitnessMerkleNode(sha256d::Hash); +} +impl_hashencode!(TxMerkleNode); +impl_hashencode!(WitnessMerkleNode); + +impl From for TxMerkleNode { + fn from(txid: Txid) -> Self { Self::from_byte_array(txid.to_byte_array()) } +} + +impl From for WitnessMerkleNode { + fn from(wtxid: Wtxid) -> Self { Self::from_byte_array(wtxid.to_byte_array()) } +} + /// Calculates the merkle root of a list of *hashes*, inline (in place) in `hashes`. /// /// In most cases, you'll want to use [`calculate_root`] instead. Please note, calling this function From 04353901ba3cf7c0a123711a1fbb40870805093d Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Sat, 15 Jun 2024 13:06:23 +0000 Subject: [PATCH 2/7] api changes after moving the hashes These are pretty noisy but it's just a move. --- api/bitcoin/all-features.txt | 328 +++++++++++++++---------------- api/bitcoin/default-features.txt | 300 ++++++++++++++-------------- api/bitcoin/no-features.txt | 300 ++++++++++++++-------------- 3 files changed, 461 insertions(+), 467 deletions(-) diff --git a/api/bitcoin/all-features.txt b/api/bitcoin/all-features.txt index def5dc3db..025ba6c5f 100644 --- a/api/bitcoin/all-features.txt +++ b/api/bitcoin/all-features.txt @@ -145,10 +145,8 @@ impl bitcoin::bip32::Xpub impl bitcoin::blockdata::block::Block impl bitcoin::blockdata::block::BlockHash impl bitcoin::blockdata::block::Header -impl bitcoin::blockdata::block::TxMerkleNode impl bitcoin::blockdata::block::Version impl bitcoin::blockdata::block::WitnessCommitment -impl bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::blockdata::constants::ChainHash impl bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -198,11 +196,11 @@ impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec -impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec +impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec @@ -219,9 +217,7 @@ impl bitcoin::consensus::encode::Decodable for bitcoin::bip158::FilterHeader impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Block impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::BlockHash impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Header -impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::TxMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Version -impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::script::ScriptBuf impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::transaction::OutPoint @@ -236,6 +232,8 @@ impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::witness::Witn impl bitcoin::consensus::encode::Decodable for bitcoin::consensus::encode::CheckedData impl bitcoin::consensus::encode::Decodable for bitcoin::consensus::encode::VarInt impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::p2p::Magic impl bitcoin::consensus::encode::Decodable for bitcoin::p2p::ServiceFlags impl bitcoin::consensus::encode::Decodable for bitcoin::p2p::address::AddrV2 @@ -299,11 +297,11 @@ impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec -impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec +impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec @@ -320,9 +318,7 @@ impl bitcoin::consensus::encode::Encodable for bitcoin::bip158::FilterHeader impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Block impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::BlockHash impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Header -impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::TxMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Version -impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::script::Script impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::script::ScriptBuf @@ -338,6 +334,8 @@ impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::witness::Witn impl bitcoin::consensus::encode::Encodable for bitcoin::consensus::encode::CheckedData impl bitcoin::consensus::encode::Encodable for bitcoin::consensus::encode::VarInt impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::p2p::Magic impl bitcoin::consensus::encode::Encodable for bitcoin::p2p::ServiceFlags impl bitcoin::consensus::encode::Encodable for bitcoin::p2p::address::AddrV2 @@ -394,6 +392,8 @@ impl bitcoin::key::TapTweak for bitcoin::key::UntweakedPublicKey impl bitcoin::key::TweakedKeypair impl bitcoin::key::TweakedPublicKey impl bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::network::Network impl bitcoin::network::NetworkKind impl bitcoin::p2p::Magic @@ -449,13 +449,13 @@ impl bitcoin_hashes::Hash for bitcoin::bip158::FilterHash impl bitcoin_hashes::Hash for bitcoin::bip158::FilterHeader impl bitcoin_hashes::Hash for bitcoin::bip32::XKeyIdentifier impl bitcoin_hashes::Hash for bitcoin::blockdata::block::BlockHash -impl bitcoin_hashes::Hash for bitcoin::blockdata::block::TxMerkleNode impl bitcoin_hashes::Hash for bitcoin::blockdata::block::WitnessCommitment -impl bitcoin_hashes::Hash for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin_hashes::Hash for bitcoin::blockdata::script::ScriptHash impl bitcoin_hashes::Hash for bitcoin::blockdata::script::WScriptHash impl bitcoin_hashes::Hash for bitcoin::blockdata::transaction::Txid impl bitcoin_hashes::Hash for bitcoin::blockdata::transaction::Wtxid +impl bitcoin_hashes::Hash for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin_hashes::Hash for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin_hashes::Hash for bitcoin::taproot::TapLeafHash impl bitcoin_hashes::Hash for bitcoin::taproot::TapNodeHash impl bitcoin_hashes::Hash for bitcoin::taproot::TapTweakHash @@ -468,13 +468,13 @@ impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::bip158: impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::bip158::FilterHeader impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::bip32::XKeyIdentifier impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::blockdata::block::BlockHash -impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::blockdata::block::TxMerkleNode impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::blockdata::block::WitnessCommitment -impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::blockdata::script::ScriptHash impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::blockdata::script::WScriptHash impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::blockdata::transaction::Txid impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::blockdata::transaction::Wtxid +impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::taproot::TapLeafHash impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::taproot::TapNodeHash impl bitcoin_hashes::serde_macros::serde_details::SerdeHash for bitcoin::taproot::TapTweakHash @@ -500,15 +500,15 @@ impl core::borrow::Borrow<[u8]> for bitcoin::bip32::ChainCode impl core::borrow::Borrow<[u8]> for bitcoin::bip32::Fingerprint impl core::borrow::Borrow<[u8]> for bitcoin::bip32::XKeyIdentifier impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::BlockHash -impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::TxMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::WitnessCommitment -impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::constants::ChainHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::script::ScriptHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::script::WScriptHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::transaction::Txid impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::transaction::Wtxid impl core::borrow::Borrow<[u8]> for bitcoin::ecdsa::SerializedSignature +impl core::borrow::Borrow<[u8]> for bitcoin::merkle_tree::TxMerkleNode +impl core::borrow::Borrow<[u8]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::p2p::Magic impl core::borrow::Borrow<[u8]> for bitcoin::taproot::TapLeafHash impl core::borrow::Borrow<[u8]> for bitcoin::taproot::TapNodeHash @@ -578,11 +578,9 @@ impl core::clone::Clone for bitcoin::blockdata::block::Bip34Error impl core::clone::Clone for bitcoin::blockdata::block::Block impl core::clone::Clone for bitcoin::blockdata::block::BlockHash impl core::clone::Clone for bitcoin::blockdata::block::Header -impl core::clone::Clone for bitcoin::blockdata::block::TxMerkleNode impl core::clone::Clone for bitcoin::blockdata::block::ValidationError impl core::clone::Clone for bitcoin::blockdata::block::Version impl core::clone::Clone for bitcoin::blockdata::block::WitnessCommitment -impl core::clone::Clone for bitcoin::blockdata::block::WitnessMerkleNode impl core::clone::Clone for bitcoin::blockdata::constants::ChainHash impl core::clone::Clone for bitcoin::blockdata::locktime::absolute::LockTime impl core::clone::Clone for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -643,6 +641,8 @@ impl core::clone::Clone for bitcoin::key::TweakedPublicKey impl core::clone::Clone for bitcoin::key::UncompressedPublicKeyError impl core::clone::Clone for bitcoin::merkle_tree::MerkleBlockError impl core::clone::Clone for bitcoin::merkle_tree::PartialMerkleTree +impl core::clone::Clone for bitcoin::merkle_tree::TxMerkleNode +impl core::clone::Clone for bitcoin::merkle_tree::WitnessMerkleNode impl core::clone::Clone for bitcoin::network::Network impl core::clone::Clone for bitcoin::network::NetworkKind impl core::clone::Clone for bitcoin::network::ParseNetworkError @@ -778,11 +778,9 @@ impl core::cmp::Eq for bitcoin::blockdata::block::Bip34Error impl core::cmp::Eq for bitcoin::blockdata::block::Block impl core::cmp::Eq for bitcoin::blockdata::block::BlockHash impl core::cmp::Eq for bitcoin::blockdata::block::Header -impl core::cmp::Eq for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::Eq for bitcoin::blockdata::block::ValidationError impl core::cmp::Eq for bitcoin::blockdata::block::Version impl core::cmp::Eq for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::Eq for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::Eq for bitcoin::blockdata::constants::ChainHash impl core::cmp::Eq for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::Eq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -843,6 +841,8 @@ impl core::cmp::Eq for bitcoin::key::TweakedPublicKey impl core::cmp::Eq for bitcoin::key::UncompressedPublicKeyError impl core::cmp::Eq for bitcoin::merkle_tree::MerkleBlockError impl core::cmp::Eq for bitcoin::merkle_tree::PartialMerkleTree +impl core::cmp::Eq for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::Eq for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::Eq for bitcoin::network::Network impl core::cmp::Eq for bitcoin::network::NetworkKind impl core::cmp::Eq for bitcoin::network::ParseNetworkError @@ -958,10 +958,8 @@ impl core::cmp::Ord for bitcoin::bip32::XKeyIdentifier impl core::cmp::Ord for bitcoin::bip32::Xpub impl core::cmp::Ord for bitcoin::blockdata::block::BlockHash impl core::cmp::Ord for bitcoin::blockdata::block::Header -impl core::cmp::Ord for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::Ord for bitcoin::blockdata::block::Version impl core::cmp::Ord for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::Ord for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::Ord for bitcoin::blockdata::constants::ChainHash impl core::cmp::Ord for bitcoin::blockdata::opcodes::ClassifyContext impl core::cmp::Ord for bitcoin::blockdata::script::PushBytes @@ -985,6 +983,8 @@ impl core::cmp::Ord for bitcoin::consensus::encode::VarInt impl core::cmp::Ord for bitcoin::key::SortKey impl core::cmp::Ord for bitcoin::key::TweakedKeypair impl core::cmp::Ord for bitcoin::key::TweakedPublicKey +impl core::cmp::Ord for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::Ord for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::Ord for bitcoin::network::Network impl core::cmp::Ord for bitcoin::network::NetworkKind impl core::cmp::Ord for bitcoin::p2p::Magic @@ -1067,11 +1067,9 @@ impl core::cmp::PartialEq for bitcoin::blockdata::block::Bip34Error impl core::cmp::PartialEq for bitcoin::blockdata::block::Block impl core::cmp::PartialEq for bitcoin::blockdata::block::BlockHash impl core::cmp::PartialEq for bitcoin::blockdata::block::Header -impl core::cmp::PartialEq for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::PartialEq for bitcoin::blockdata::block::ValidationError impl core::cmp::PartialEq for bitcoin::blockdata::block::Version impl core::cmp::PartialEq for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::PartialEq for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::PartialEq for bitcoin::blockdata::constants::ChainHash impl core::cmp::PartialEq for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::PartialEq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -1132,6 +1130,8 @@ impl core::cmp::PartialEq for bitcoin::key::TweakedPublicKey impl core::cmp::PartialEq for bitcoin::key::UncompressedPublicKeyError impl core::cmp::PartialEq for bitcoin::merkle_tree::MerkleBlockError impl core::cmp::PartialEq for bitcoin::merkle_tree::PartialMerkleTree +impl core::cmp::PartialEq for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::PartialEq for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::PartialEq for bitcoin::network::Network impl core::cmp::PartialEq for bitcoin::network::NetworkKind impl core::cmp::PartialEq for bitcoin::network::ParseNetworkError @@ -1251,10 +1251,8 @@ impl core::cmp::PartialOrd for bitcoin::bip32::XKeyIdentifier impl core::cmp::PartialOrd for bitcoin::bip32::Xpub impl core::cmp::PartialOrd for bitcoin::blockdata::block::BlockHash impl core::cmp::PartialOrd for bitcoin::blockdata::block::Header -impl core::cmp::PartialOrd for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::PartialOrd for bitcoin::blockdata::block::Version impl core::cmp::PartialOrd for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::PartialOrd for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::PartialOrd for bitcoin::blockdata::constants::ChainHash impl core::cmp::PartialOrd for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::PartialOrd for bitcoin::blockdata::locktime::relative::LockTime @@ -1280,6 +1278,8 @@ impl core::cmp::PartialOrd for bitcoin::consensus::encode::VarInt impl core::cmp::PartialOrd for bitcoin::key::SortKey impl core::cmp::PartialOrd for bitcoin::key::TweakedKeypair impl core::cmp::PartialOrd for bitcoin::key::TweakedPublicKey +impl core::cmp::PartialOrd for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::PartialOrd for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::PartialOrd for bitcoin::network::Network impl core::cmp::PartialOrd for bitcoin::network::NetworkKind impl core::cmp::PartialOrd for bitcoin::p2p::Magic @@ -1425,13 +1425,13 @@ impl core::convert::AsRef<[u8; 32]> for bitcoin::bip158::FilterHash impl core::convert::AsRef<[u8; 32]> for bitcoin::bip158::FilterHeader impl core::convert::AsRef<[u8; 32]> for bitcoin::bip32::ChainCode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::BlockHash -impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::TxMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::constants::ChainHash impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::script::WScriptHash impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::transaction::Txid impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::transaction::Wtxid +impl core::convert::AsRef<[u8; 32]> for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::AsRef<[u8; 32]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapLeafHash impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapNodeHash impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapTweakHash @@ -1450,9 +1450,7 @@ impl core::convert::AsRef<[u8]> for bitcoin::bip32::ChainCode impl core::convert::AsRef<[u8]> for bitcoin::bip32::Fingerprint impl core::convert::AsRef<[u8]> for bitcoin::bip32::XKeyIdentifier impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::BlockHash -impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::TxMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::blockdata::constants::ChainHash impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::PushBytes impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::Script @@ -1462,6 +1460,8 @@ impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::WScriptHash impl core::convert::AsRef<[u8]> for bitcoin::blockdata::transaction::Txid impl core::convert::AsRef<[u8]> for bitcoin::blockdata::transaction::Wtxid impl core::convert::AsRef<[u8]> for bitcoin::ecdsa::SerializedSignature +impl core::convert::AsRef<[u8]> for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::AsRef<[u8]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::p2p::Magic impl core::convert::AsRef<[u8]> for bitcoin::taproot::TapLeafHash impl core::convert::AsRef<[u8]> for bitcoin::taproot::TapNodeHash @@ -1816,9 +1816,7 @@ impl core::convert::From for bitcoin::bip32::XKeyIdentifie impl core::convert::From for bitcoin::blockdata::block::BlockHash impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::blockdata::block::BlockHash -impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::blockdata::transaction::Sequence impl core::convert::From for alloc::vec::Vec impl core::convert::From for alloc::borrow::Cow<'_, bitcoin::blockdata::script::Script> @@ -1843,9 +1841,9 @@ impl core::convert::From for impl core::convert::From for u32 impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid -impl core::convert::From for bitcoin::blockdata::block::TxMerkleNode +impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin::blockdata::block::WitnessMerkleNode +impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::psbt::Error impl core::convert::From for bitcoin::consensus::validation::TxVerifyError @@ -1855,6 +1853,8 @@ impl core::convert::From for bitc impl core::convert::From for bitcoin::key::TweakedPublicKey impl core::convert::From for secp256k1::key::Keypair impl core::convert::From for secp256k1::key::XOnlyPublicKey +impl core::convert::From for bitcoin_hashes::sha256d::Hash +impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for &'static bitcoin::consensus::params::Params impl core::convert::From for bitcoin::address::KnownHrp impl core::convert::From for bitcoin::consensus::params::Params @@ -1890,11 +1890,11 @@ impl core::convert::From for bitcoin::SegwitV0Sig impl core::convert::From for bitcoin::bip158::FilterHash impl core::convert::From for bitcoin::bip158::FilterHeader impl core::convert::From for bitcoin::blockdata::block::BlockHash -impl core::convert::From for bitcoin::blockdata::block::TxMerkleNode impl core::convert::From for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::From for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid +impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From> for bitcoin::TapSighash impl core::convert::From> for bitcoin::taproot::TapNodeHash impl core::convert::From> for bitcoin::taproot::TapLeafHash @@ -2132,11 +2132,9 @@ impl core::fmt::Debug for bitcoin::blockdata::block::Bip34Error impl core::fmt::Debug for bitcoin::blockdata::block::Block impl core::fmt::Debug for bitcoin::blockdata::block::BlockHash impl core::fmt::Debug for bitcoin::blockdata::block::Header -impl core::fmt::Debug for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::Debug for bitcoin::blockdata::block::ValidationError impl core::fmt::Debug for bitcoin::blockdata::block::Version impl core::fmt::Debug for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::Debug for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::Debug for bitcoin::blockdata::constants::ChainHash impl core::fmt::Debug for bitcoin::blockdata::locktime::absolute::LockTime impl core::fmt::Debug for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2201,6 +2199,8 @@ impl core::fmt::Debug for bitcoin::key::TweakedPublicKey impl core::fmt::Debug for bitcoin::key::UncompressedPublicKeyError impl core::fmt::Debug for bitcoin::merkle_tree::MerkleBlockError impl core::fmt::Debug for bitcoin::merkle_tree::PartialMerkleTree +impl core::fmt::Debug for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::Debug for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::Debug for bitcoin::network::Network impl core::fmt::Debug for bitcoin::network::NetworkKind impl core::fmt::Debug for bitcoin::network::ParseNetworkError @@ -2325,10 +2325,8 @@ impl core::fmt::Display for bitcoin::bip32::Xpriv impl core::fmt::Display for bitcoin::bip32::Xpub impl core::fmt::Display for bitcoin::blockdata::block::Bip34Error impl core::fmt::Display for bitcoin::blockdata::block::BlockHash -impl core::fmt::Display for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::Display for bitcoin::blockdata::block::ValidationError impl core::fmt::Display for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::Display for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::Display for bitcoin::blockdata::constants::ChainHash impl core::fmt::Display for bitcoin::blockdata::locktime::absolute::LockTime impl core::fmt::Display for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2375,6 +2373,8 @@ impl core::fmt::Display for bitcoin::key::ParsePublicKeyError impl core::fmt::Display for bitcoin::key::TweakedPublicKey impl core::fmt::Display for bitcoin::key::UncompressedPublicKeyError impl core::fmt::Display for bitcoin::merkle_tree::MerkleBlockError +impl core::fmt::Display for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::Display for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::Display for bitcoin::network::Network impl core::fmt::Display for bitcoin::network::ParseNetworkError impl core::fmt::Display for bitcoin::network::UnknownChainHashError @@ -2430,9 +2430,7 @@ impl core::fmt::LowerHex for bitcoin::bip32::ChainCode impl core::fmt::LowerHex for bitcoin::bip32::Fingerprint impl core::fmt::LowerHex for bitcoin::bip32::XKeyIdentifier impl core::fmt::LowerHex for bitcoin::blockdata::block::BlockHash -impl core::fmt::LowerHex for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::LowerHex for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::LowerHex for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::LowerHex for bitcoin::blockdata::constants::ChainHash impl core::fmt::LowerHex for bitcoin::blockdata::script::Script impl core::fmt::LowerHex for bitcoin::blockdata::script::ScriptBuf @@ -2443,6 +2441,8 @@ impl core::fmt::LowerHex for bitcoin::blockdata::transaction::Txid impl core::fmt::LowerHex for bitcoin::blockdata::transaction::Wtxid impl core::fmt::LowerHex for bitcoin::ecdsa::SerializedSignature impl core::fmt::LowerHex for bitcoin::key::TweakedPublicKey +impl core::fmt::LowerHex for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::LowerHex for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::LowerHex for bitcoin::p2p::Magic impl core::fmt::LowerHex for bitcoin::p2p::ServiceFlags impl core::fmt::LowerHex for bitcoin::pow::CompactTarget @@ -2465,9 +2465,7 @@ impl core::fmt::UpperHex for bitcoin::bip32::ChainCode impl core::fmt::UpperHex for bitcoin::bip32::Fingerprint impl core::fmt::UpperHex for bitcoin::bip32::XKeyIdentifier impl core::fmt::UpperHex for bitcoin::blockdata::block::BlockHash -impl core::fmt::UpperHex for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::UpperHex for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::UpperHex for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::UpperHex for bitcoin::blockdata::constants::ChainHash impl core::fmt::UpperHex for bitcoin::blockdata::script::Script impl core::fmt::UpperHex for bitcoin::blockdata::script::ScriptBuf @@ -2477,6 +2475,8 @@ impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Sequence impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Txid impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Wtxid impl core::fmt::UpperHex for bitcoin::ecdsa::SerializedSignature +impl core::fmt::UpperHex for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::UpperHex for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::UpperHex for bitcoin::p2p::Magic impl core::fmt::UpperHex for bitcoin::p2p::ServiceFlags impl core::fmt::UpperHex for bitcoin::pow::CompactTarget @@ -2517,10 +2517,8 @@ impl core::hash::Hash for bitcoin::bip32::XKeyIdentifier impl core::hash::Hash for bitcoin::bip32::Xpub impl core::hash::Hash for bitcoin::blockdata::block::BlockHash impl core::hash::Hash for bitcoin::blockdata::block::Header -impl core::hash::Hash for bitcoin::blockdata::block::TxMerkleNode impl core::hash::Hash for bitcoin::blockdata::block::Version impl core::hash::Hash for bitcoin::blockdata::block::WitnessCommitment -impl core::hash::Hash for bitcoin::blockdata::block::WitnessMerkleNode impl core::hash::Hash for bitcoin::blockdata::constants::ChainHash impl core::hash::Hash for bitcoin::blockdata::locktime::absolute::LockTime impl core::hash::Hash for bitcoin::blockdata::locktime::relative::LockTime @@ -2547,6 +2545,8 @@ impl core::hash::Hash for bitcoin::ecdsa::Signature impl core::hash::Hash for bitcoin::key::SortKey impl core::hash::Hash for bitcoin::key::TweakedKeypair impl core::hash::Hash for bitcoin::key::TweakedPublicKey +impl core::hash::Hash for bitcoin::merkle_tree::TxMerkleNode +impl core::hash::Hash for bitcoin::merkle_tree::WitnessMerkleNode impl core::hash::Hash for bitcoin::network::Network impl core::hash::Hash for bitcoin::network::NetworkKind impl core::hash::Hash for bitcoin::p2p::Magic @@ -2627,10 +2627,8 @@ impl core::marker::Copy for bitcoin::bip32::Xpriv impl core::marker::Copy for bitcoin::bip32::Xpub impl core::marker::Copy for bitcoin::blockdata::block::BlockHash impl core::marker::Copy for bitcoin::blockdata::block::Header -impl core::marker::Copy for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Copy for bitcoin::blockdata::block::Version impl core::marker::Copy for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Copy for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Copy for bitcoin::blockdata::constants::ChainHash impl core::marker::Copy for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Copy for bitcoin::blockdata::locktime::relative::LockTime @@ -2653,6 +2651,8 @@ impl core::marker::Copy for bitcoin::ecdsa::Signature impl core::marker::Copy for bitcoin::key::SortKey impl core::marker::Copy for bitcoin::key::TweakedKeypair impl core::marker::Copy for bitcoin::key::TweakedPublicKey +impl core::marker::Copy for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Copy for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Copy for bitcoin::network::Network impl core::marker::Copy for bitcoin::network::NetworkKind impl core::marker::Copy for bitcoin::p2p::Magic @@ -2729,11 +2729,9 @@ impl core::marker::Freeze for bitcoin::blockdata::block::Bip34Error impl core::marker::Freeze for bitcoin::blockdata::block::Block impl core::marker::Freeze for bitcoin::blockdata::block::BlockHash impl core::marker::Freeze for bitcoin::blockdata::block::Header -impl core::marker::Freeze for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Freeze for bitcoin::blockdata::block::ValidationError impl core::marker::Freeze for bitcoin::blockdata::block::Version impl core::marker::Freeze for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Freeze for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Freeze for bitcoin::blockdata::constants::ChainHash impl core::marker::Freeze for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Freeze for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2800,6 +2798,8 @@ impl core::marker::Freeze for bitcoin::key::TweakedPublicKey impl core::marker::Freeze for bitcoin::key::UncompressedPublicKeyError impl core::marker::Freeze for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Freeze for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Freeze for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Freeze for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Freeze for bitcoin::network::Network impl core::marker::Freeze for bitcoin::network::NetworkKind impl core::marker::Freeze for bitcoin::network::ParseNetworkError @@ -2941,11 +2941,9 @@ impl core::marker::Send for bitcoin::blockdata::block::Bip34Error impl core::marker::Send for bitcoin::blockdata::block::Block impl core::marker::Send for bitcoin::blockdata::block::BlockHash impl core::marker::Send for bitcoin::blockdata::block::Header -impl core::marker::Send for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Send for bitcoin::blockdata::block::ValidationError impl core::marker::Send for bitcoin::blockdata::block::Version impl core::marker::Send for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Send for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Send for bitcoin::blockdata::constants::ChainHash impl core::marker::Send for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Send for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3012,6 +3010,8 @@ impl core::marker::Send for bitcoin::key::TweakedPublicKey impl core::marker::Send for bitcoin::key::UncompressedPublicKeyError impl core::marker::Send for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Send for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Send for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Send for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Send for bitcoin::network::Network impl core::marker::Send for bitcoin::network::NetworkKind impl core::marker::Send for bitcoin::network::ParseNetworkError @@ -3150,11 +3150,9 @@ impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Bip34Error impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Block impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::BlockHash impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Header -impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::TxMerkleNode impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::ValidationError impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Version impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::StructuralPartialEq for bitcoin::blockdata::constants::ChainHash impl core::marker::StructuralPartialEq for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::StructuralPartialEq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3214,6 +3212,8 @@ impl core::marker::StructuralPartialEq for bitcoin::key::TweakedPublicKey impl core::marker::StructuralPartialEq for bitcoin::key::UncompressedPublicKeyError impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::MerkleBlockError impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::StructuralPartialEq for bitcoin::network::Network impl core::marker::StructuralPartialEq for bitcoin::network::NetworkKind impl core::marker::StructuralPartialEq for bitcoin::network::ParseNetworkError @@ -3349,11 +3349,9 @@ impl core::marker::Sync for bitcoin::blockdata::block::Bip34Error impl core::marker::Sync for bitcoin::blockdata::block::Block impl core::marker::Sync for bitcoin::blockdata::block::BlockHash impl core::marker::Sync for bitcoin::blockdata::block::Header -impl core::marker::Sync for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Sync for bitcoin::blockdata::block::ValidationError impl core::marker::Sync for bitcoin::blockdata::block::Version impl core::marker::Sync for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Sync for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Sync for bitcoin::blockdata::constants::ChainHash impl core::marker::Sync for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Sync for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3420,6 +3418,8 @@ impl core::marker::Sync for bitcoin::key::TweakedPublicKey impl core::marker::Sync for bitcoin::key::UncompressedPublicKeyError impl core::marker::Sync for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Sync for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Sync for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Sync for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Sync for bitcoin::network::Network impl core::marker::Sync for bitcoin::network::NetworkKind impl core::marker::Sync for bitcoin::network::ParseNetworkError @@ -3561,11 +3561,9 @@ impl core::marker::Unpin for bitcoin::blockdata::block::Bip34Error impl core::marker::Unpin for bitcoin::blockdata::block::Block impl core::marker::Unpin for bitcoin::blockdata::block::BlockHash impl core::marker::Unpin for bitcoin::blockdata::block::Header -impl core::marker::Unpin for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Unpin for bitcoin::blockdata::block::ValidationError impl core::marker::Unpin for bitcoin::blockdata::block::Version impl core::marker::Unpin for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Unpin for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Unpin for bitcoin::blockdata::constants::ChainHash impl core::marker::Unpin for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Unpin for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3632,6 +3630,8 @@ impl core::marker::Unpin for bitcoin::key::TweakedPublicKey impl core::marker::Unpin for bitcoin::key::UncompressedPublicKeyError impl core::marker::Unpin for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Unpin for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Unpin for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Unpin for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Unpin for bitcoin::network::Network impl core::marker::Unpin for bitcoin::network::NetworkKind impl core::marker::Unpin for bitcoin::network::ParseNetworkError @@ -3804,11 +3804,9 @@ impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Bip3 impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Block impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::BlockHash impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Header -impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::TxMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::ValidationError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Version impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::WitnessCommitment -impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::WitnessMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::constants::ChainHash impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::locktime::absolute::LockTime impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3873,6 +3871,8 @@ impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::key::TweakedPublicKey impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::key::UncompressedPublicKeyError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::MerkleBlockError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::PartialMerkleTree +impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::TxMerkleNode +impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::WitnessMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::Network impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::NetworkKind impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::ParseNetworkError @@ -4011,11 +4011,9 @@ impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Bip34Er impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Block impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::BlockHash impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Header -impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::TxMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::ValidationError impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Version impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::WitnessCommitment -impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::WitnessMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::constants::ChainHash impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::locktime::absolute::LockTime impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -4080,6 +4078,8 @@ impl core::panic::unwind_safe::UnwindSafe for bitcoin::key::TweakedPublicKey impl core::panic::unwind_safe::UnwindSafe for bitcoin::key::UncompressedPublicKeyError impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::MerkleBlockError impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::PartialMerkleTree +impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::TxMerkleNode +impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::WitnessMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::Network impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::NetworkKind impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::ParseNetworkError @@ -4191,9 +4191,7 @@ impl core::str::traits::FromStr for bitcoin::bip32::XKeyIdentifier impl core::str::traits::FromStr for bitcoin::bip32::Xpriv impl core::str::traits::FromStr for bitcoin::bip32::Xpub impl core::str::traits::FromStr for bitcoin::blockdata::block::BlockHash -impl core::str::traits::FromStr for bitcoin::blockdata::block::TxMerkleNode impl core::str::traits::FromStr for bitcoin::blockdata::block::WitnessCommitment -impl core::str::traits::FromStr for bitcoin::blockdata::block::WitnessMerkleNode impl core::str::traits::FromStr for bitcoin::blockdata::constants::ChainHash impl core::str::traits::FromStr for bitcoin::blockdata::locktime::absolute::LockTime impl core::str::traits::FromStr for bitcoin::blockdata::script::ScriptHash @@ -4204,6 +4202,8 @@ impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Sequence impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Txid impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Wtxid impl core::str::traits::FromStr for bitcoin::ecdsa::Signature +impl core::str::traits::FromStr for bitcoin::merkle_tree::TxMerkleNode +impl core::str::traits::FromStr for bitcoin::merkle_tree::WitnessMerkleNode impl core::str::traits::FromStr for bitcoin::network::Network impl core::str::traits::FromStr for bitcoin::p2p::Magic impl core::str::traits::FromStr for bitcoin::p2p::message::CommandString @@ -4238,10 +4238,8 @@ impl serde::ser::Serialize for bitcoin::bip32::Xpub impl serde::ser::Serialize for bitcoin::blockdata::block::Block impl serde::ser::Serialize for bitcoin::blockdata::block::BlockHash impl serde::ser::Serialize for bitcoin::blockdata::block::Header -impl serde::ser::Serialize for bitcoin::blockdata::block::TxMerkleNode impl serde::ser::Serialize for bitcoin::blockdata::block::Version impl serde::ser::Serialize for bitcoin::blockdata::block::WitnessCommitment -impl serde::ser::Serialize for bitcoin::blockdata::block::WitnessMerkleNode impl serde::ser::Serialize for bitcoin::blockdata::constants::ChainHash impl serde::ser::Serialize for bitcoin::blockdata::locktime::absolute::LockTime impl serde::ser::Serialize for bitcoin::blockdata::locktime::relative::LockTime @@ -4262,6 +4260,8 @@ impl serde::ser::Serialize for bitcoin::blockdata::witness::Witness impl serde::ser::Serialize for bitcoin::ecdsa::Signature impl serde::ser::Serialize for bitcoin::key::TweakedKeypair impl serde::ser::Serialize for bitcoin::key::TweakedPublicKey +impl serde::ser::Serialize for bitcoin::merkle_tree::TxMerkleNode +impl serde::ser::Serialize for bitcoin::merkle_tree::WitnessMerkleNode impl serde::ser::Serialize for bitcoin::network::Network impl serde::ser::Serialize for bitcoin::pow::CompactTarget impl serde::ser::Serialize for bitcoin::pow::Target @@ -4682,10 +4682,8 @@ impl<'de> serde::de::Deserialize<'de> for bitcoin::bip32::Xpub impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::block::Block impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::block::BlockHash impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::block::Header -impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::block::TxMerkleNode impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::block::Version impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::block::WitnessCommitment -impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::block::WitnessMerkleNode impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::constants::ChainHash impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::locktime::absolute::LockTime impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::locktime::relative::LockTime @@ -4704,6 +4702,8 @@ impl<'de> serde::de::Deserialize<'de> for bitcoin::blockdata::witness::Witness impl<'de> serde::de::Deserialize<'de> for bitcoin::ecdsa::Signature impl<'de> serde::de::Deserialize<'de> for bitcoin::key::TweakedKeypair impl<'de> serde::de::Deserialize<'de> for bitcoin::key::TweakedPublicKey +impl<'de> serde::de::Deserialize<'de> for bitcoin::merkle_tree::TxMerkleNode +impl<'de> serde::de::Deserialize<'de> for bitcoin::merkle_tree::WitnessMerkleNode impl<'de> serde::de::Deserialize<'de> for bitcoin::network::Network impl<'de> serde::de::Deserialize<'de> for bitcoin::pow::CompactTarget impl<'de> serde::de::Deserialize<'de> for bitcoin::pow::Target @@ -4843,13 +4843,13 @@ impl> core::ops::index::Index for bit impl> core::ops::index::Index for bitcoin::bip158::FilterHeader impl> core::ops::index::Index for bitcoin::bip32::XKeyIdentifier impl> core::ops::index::Index for bitcoin::blockdata::block::BlockHash -impl> core::ops::index::Index for bitcoin::blockdata::block::TxMerkleNode impl> core::ops::index::Index for bitcoin::blockdata::block::WitnessCommitment -impl> core::ops::index::Index for bitcoin::blockdata::block::WitnessMerkleNode impl> core::ops::index::Index for bitcoin::blockdata::script::ScriptHash impl> core::ops::index::Index for bitcoin::blockdata::script::WScriptHash impl> core::ops::index::Index for bitcoin::blockdata::transaction::Txid impl> core::ops::index::Index for bitcoin::blockdata::transaction::Wtxid +impl> core::ops::index::Index for bitcoin::merkle_tree::TxMerkleNode +impl> core::ops::index::Index for bitcoin::merkle_tree::WitnessMerkleNode impl> core::ops::index::Index for bitcoin::taproot::TapLeafHash impl> core::ops::index::Index for bitcoin::taproot::TapNodeHash impl> core::ops::index::Index for bitcoin::taproot::TapTweakHash @@ -5083,7 +5083,7 @@ pub bitcoin::block::Bip34Error::Unsupported pub bitcoin::block::Block::header: bitcoin::blockdata::block::Header pub bitcoin::block::Block::txdata: alloc::vec::Vec pub bitcoin::block::Header::bits: bitcoin::pow::CompactTarget -pub bitcoin::block::Header::merkle_root: bitcoin::blockdata::block::TxMerkleNode +pub bitcoin::block::Header::merkle_root: bitcoin::merkle_tree::TxMerkleNode pub bitcoin::block::Header::nonce: u32 pub bitcoin::block::Header::prev_blockhash: bitcoin::blockdata::block::BlockHash pub bitcoin::block::Header::time: u32 @@ -5097,7 +5097,7 @@ pub bitcoin::blockdata::block::Bip34Error::Unsupported pub bitcoin::blockdata::block::Block::header: bitcoin::blockdata::block::Header pub bitcoin::blockdata::block::Block::txdata: alloc::vec::Vec pub bitcoin::blockdata::block::Header::bits: bitcoin::pow::CompactTarget -pub bitcoin::blockdata::block::Header::merkle_root: bitcoin::blockdata::block::TxMerkleNode +pub bitcoin::blockdata::block::Header::merkle_root: bitcoin::merkle_tree::TxMerkleNode pub bitcoin::blockdata::block::Header::nonce: u32 pub bitcoin::blockdata::block::Header::prev_blockhash: bitcoin::blockdata::block::BlockHash pub bitcoin::blockdata::block::Header::time: u32 @@ -5718,18 +5718,12 @@ pub const bitcoin::blockdata::block::BlockHash::DISPLAY_BACKWARD: bool pub const bitcoin::blockdata::block::BlockHash::LEN: usize pub const bitcoin::blockdata::block::BlockHash::N: usize pub const bitcoin::blockdata::block::Header::SIZE: usize -pub const bitcoin::blockdata::block::TxMerkleNode::DISPLAY_BACKWARD: bool -pub const bitcoin::blockdata::block::TxMerkleNode::LEN: usize -pub const bitcoin::blockdata::block::TxMerkleNode::N: usize pub const bitcoin::blockdata::block::Version::NO_SOFT_FORK_SIGNALLING: Self pub const bitcoin::blockdata::block::Version::ONE: Self pub const bitcoin::blockdata::block::Version::TWO: Self pub const bitcoin::blockdata::block::WitnessCommitment::DISPLAY_BACKWARD: bool pub const bitcoin::blockdata::block::WitnessCommitment::LEN: usize pub const bitcoin::blockdata::block::WitnessCommitment::N: usize -pub const bitcoin::blockdata::block::WitnessMerkleNode::DISPLAY_BACKWARD: bool -pub const bitcoin::blockdata::block::WitnessMerkleNode::LEN: usize -pub const bitcoin::blockdata::block::WitnessMerkleNode::N: usize pub const bitcoin::blockdata::constants::COINBASE_MATURITY: u32 = 100u32 pub const bitcoin::blockdata::constants::ChainHash::BITCOIN: Self pub const bitcoin::blockdata::constants::ChainHash::REGTEST: Self @@ -6057,6 +6051,12 @@ pub const bitcoin::constants::SCRIPT_ADDRESS_PREFIX_TEST: u8 = 196u8 pub const bitcoin::constants::SUBSIDY_HALVING_INTERVAL: u32 = 210_000u32 pub const bitcoin::constants::TARGET_BLOCK_SPACING: u32 = 600u32 pub const bitcoin::constants::WITNESS_SCALE_FACTOR: units::weight::WITNESS_SCALE_FACTOR +pub const bitcoin::merkle_tree::TxMerkleNode::DISPLAY_BACKWARD: bool +pub const bitcoin::merkle_tree::TxMerkleNode::LEN: usize +pub const bitcoin::merkle_tree::TxMerkleNode::N: usize +pub const bitcoin::merkle_tree::WitnessMerkleNode::DISPLAY_BACKWARD: bool +pub const bitcoin::merkle_tree::WitnessMerkleNode::LEN: usize +pub const bitcoin::merkle_tree::WitnessMerkleNode::N: usize pub const bitcoin::opcodes::all::OP_0NOTEQUAL: _ pub const bitcoin::opcodes::all::OP_1ADD: _ pub const bitcoin::opcodes::all::OP_1SUB: _ @@ -6840,8 +6840,6 @@ pub fn alloc::vec::Vec::consensus_decode_f pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result -pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result @@ -6850,6 +6848,8 @@ pub fn alloc::vec::Vec::consensus_decode pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result +pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result @@ -7613,8 +7613,8 @@ pub fn bitcoin::blockdata::block::Block::check_merkle_root(&self) -> bool pub fn bitcoin::blockdata::block::Block::check_witness_commitment(&self) -> bool pub fn bitcoin::blockdata::block::Block::clone(&self) -> bitcoin::blockdata::block::Block pub fn bitcoin::blockdata::block::Block::coinbase(&self) -> core::option::Option<&bitcoin::blockdata::transaction::Transaction> -pub fn bitcoin::blockdata::block::Block::compute_merkle_root(&self) -> core::option::Option -pub fn bitcoin::blockdata::block::Block::compute_witness_commitment(witness_root: &bitcoin::blockdata::block::WitnessMerkleNode, witness_reserved_value: &[u8]) -> bitcoin::blockdata::block::WitnessCommitment +pub fn bitcoin::blockdata::block::Block::compute_merkle_root(&self) -> core::option::Option +pub fn bitcoin::blockdata::block::Block::compute_witness_commitment(witness_root: &bitcoin::merkle_tree::WitnessMerkleNode, witness_reserved_value: &[u8]) -> bitcoin::blockdata::block::WitnessCommitment pub fn bitcoin::blockdata::block::Block::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::blockdata::block::Block::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn bitcoin::blockdata::block::Block::consensus_encode(&self, r: &mut R) -> core::result::Result @@ -7624,7 +7624,7 @@ pub fn bitcoin::blockdata::block::Block::fmt(&self, f: &mut core::fmt::Formatter pub fn bitcoin::blockdata::block::Block::serialize<__S>(&self, __serializer: __S) -> core::result::Result<<__S as serde::ser::Serializer>::Ok, <__S as serde::ser::Serializer>::Error> where __S: serde::ser::Serializer pub fn bitcoin::blockdata::block::Block::total_size(&self) -> usize pub fn bitcoin::blockdata::block::Block::weight(&self) -> bitcoin_units::weight::Weight -pub fn bitcoin::blockdata::block::Block::witness_root(&self) -> core::option::Option +pub fn bitcoin::blockdata::block::Block::witness_root(&self) -> core::option::Option pub fn bitcoin::blockdata::block::BlockHash::all_zeros() -> Self pub fn bitcoin::blockdata::block::BlockHash::as_byte_array(&self) -> &::Bytes pub fn bitcoin::blockdata::block::BlockHash::as_byte_array(&self) -> &Self::Bytes @@ -7679,40 +7679,6 @@ pub fn bitcoin::blockdata::block::Header::serialize<__S>(&self, __serializer: __ pub fn bitcoin::blockdata::block::Header::target(&self) -> bitcoin::pow::Target pub fn bitcoin::blockdata::block::Header::validate_pow(&self, required_target: bitcoin::pow::Target) -> core::result::Result pub fn bitcoin::blockdata::block::Header::work(&self) -> bitcoin::pow::Work -pub fn bitcoin::blockdata::block::TxMerkleNode::all_zeros() -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::as_byte_array(&self) -> &::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::as_byte_array(&self) -> &Self::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::TxMerkleNode::as_ref(&self) -> &[u8; 32] -pub fn bitcoin::blockdata::block::TxMerkleNode::as_ref(&self) -> &[u8] -pub fn bitcoin::blockdata::block::TxMerkleNode::borrow(&self) -> &[u8] -pub fn bitcoin::blockdata::block::TxMerkleNode::clone(&self) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::cmp(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> core::cmp::Ordering -pub fn bitcoin::blockdata::block::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::deserialize>(d: D) -> core::result::Result::Error> -pub fn bitcoin::blockdata::block::TxMerkleNode::engine() -> ::Engine -pub fn bitcoin::blockdata::block::TxMerkleNode::eq(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> bool -pub fn bitcoin::blockdata::block::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_engine(e: ::Engine) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::from_slice_delegated(sl: &[u8]) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::from_str(s: &str) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::hash(data: &[u8]) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) -pub fn bitcoin::blockdata::block::TxMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator -pub fn bitcoin::blockdata::block::TxMerkleNode::index(&self, index: I) -> &Self::Output -pub fn bitcoin::blockdata::block::TxMerkleNode::partial_cmp(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> core::option::Option -pub fn bitcoin::blockdata::block::TxMerkleNode::serialize(&self, s: S) -> core::result::Result<::Ok, ::Error> -pub fn bitcoin::blockdata::block::TxMerkleNode::to_byte_array(self) -> ::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::to_byte_array(self) -> Self::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::blockdata::block::ValidationError::clone(&self) -> bitcoin::blockdata::block::ValidationError pub fn bitcoin::blockdata::block::ValidationError::eq(&self, other: &bitcoin::blockdata::block::ValidationError) -> bool pub fn bitcoin::blockdata::block::ValidationError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -7762,40 +7728,6 @@ pub fn bitcoin::blockdata::block::WitnessCommitment::serialize ::Bytes pub fn bitcoin::blockdata::block::WitnessCommitment::to_byte_array(self) -> Self::Bytes pub fn bitcoin::blockdata::block::WitnessCommitment::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::WitnessMerkleNode::all_zeros() -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_byte_array(&self) -> &::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_byte_array(&self) -> &Self::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_ref(&self) -> &[u8; 32] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_ref(&self) -> &[u8] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::borrow(&self) -> &[u8] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::clone(&self) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::cmp(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> core::cmp::Ordering -pub fn bitcoin::blockdata::block::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::deserialize>(d: D) -> core::result::Result::Error> -pub fn bitcoin::blockdata::block::WitnessMerkleNode::engine() -> ::Engine -pub fn bitcoin::blockdata::block::WitnessMerkleNode::eq(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> bool -pub fn bitcoin::blockdata::block::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_engine(e: ::Engine) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_slice_delegated(sl: &[u8]) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_str(s: &str) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash(data: &[u8]) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator -pub fn bitcoin::blockdata::block::WitnessMerkleNode::index(&self, index: I) -> &Self::Output -pub fn bitcoin::blockdata::block::WitnessMerkleNode::partial_cmp(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> core::option::Option -pub fn bitcoin::blockdata::block::WitnessMerkleNode::serialize(&self, s: S) -> core::result::Result<::Ok, ::Error> -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_byte_array(self) -> ::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::blockdata::constants::ChainHash::as_byte_array(&self) -> &[u8; 32] pub fn bitcoin::blockdata::constants::ChainHash::as_bytes(&self) -> &[u8] pub fn bitcoin::blockdata::constants::ChainHash::as_mut(&mut self) -> &mut [u8; 32] @@ -8910,11 +8842,79 @@ pub fn bitcoin::merkle_tree::PartialMerkleTree::clone(&self) -> bitcoin::merkle_ pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::eq(&self, other: &bitcoin::merkle_tree::PartialMerkleTree) -> bool -pub fn bitcoin::merkle_tree::PartialMerkleTree::extract_matches(&self, matches: &mut alloc::vec::Vec, indexes: &mut alloc::vec::Vec) -> core::result::Result +pub fn bitcoin::merkle_tree::PartialMerkleTree::extract_matches(&self, matches: &mut alloc::vec::Vec, indexes: &mut alloc::vec::Vec) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::from_txids(txids: &[bitcoin::blockdata::transaction::Txid], matches: &[bool]) -> Self -pub fn bitcoin::merkle_tree::PartialMerkleTree::hashes(&self) -> &alloc::vec::Vec +pub fn bitcoin::merkle_tree::PartialMerkleTree::hashes(&self) -> &alloc::vec::Vec pub fn bitcoin::merkle_tree::PartialMerkleTree::num_transactions(&self) -> u32 +pub fn bitcoin::merkle_tree::TxMerkleNode::all_zeros() -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::as_byte_array(&self) -> &::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::as_byte_array(&self) -> &Self::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8; 32] +pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8] +pub fn bitcoin::merkle_tree::TxMerkleNode::borrow(&self) -> &[u8] +pub fn bitcoin::merkle_tree::TxMerkleNode::clone(&self) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::deserialize>(d: D) -> core::result::Result::Error> +pub fn bitcoin::merkle_tree::TxMerkleNode::engine() -> ::Engine +pub fn bitcoin::merkle_tree::TxMerkleNode::eq(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> bool +pub fn bitcoin::merkle_tree::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::from_slice_delegated(sl: &[u8]) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::from_str(s: &str) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::hash(data: &[u8]) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn bitcoin::merkle_tree::TxMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator +pub fn bitcoin::merkle_tree::TxMerkleNode::index(&self, index: I) -> &Self::Output +pub fn bitcoin::merkle_tree::TxMerkleNode::partial_cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::option::Option +pub fn bitcoin::merkle_tree::TxMerkleNode::serialize(&self, s: S) -> core::result::Result<::Ok, ::Error> +pub fn bitcoin::merkle_tree::TxMerkleNode::to_byte_array(self) -> ::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::to_byte_array(self) -> Self::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::WitnessMerkleNode::all_zeros() -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_byte_array(&self) -> &::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_byte_array(&self) -> &Self::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8; 32] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::borrow(&self) -> &[u8] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::clone(&self) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::deserialize>(d: D) -> core::result::Result::Error> +pub fn bitcoin::merkle_tree::WitnessMerkleNode::engine() -> ::Engine +pub fn bitcoin::merkle_tree::WitnessMerkleNode::eq(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> bool +pub fn bitcoin::merkle_tree::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_slice_delegated(sl: &[u8]) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_str(s: &str) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash(data: &[u8]) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator +pub fn bitcoin::merkle_tree::WitnessMerkleNode::index(&self, index: I) -> &Self::Output +pub fn bitcoin::merkle_tree::WitnessMerkleNode::partial_cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::option::Option +pub fn bitcoin::merkle_tree::WitnessMerkleNode::serialize(&self, s: S) -> core::result::Result<::Ok, ::Error> +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> ::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write, I: core::iter::traits::iterator::Iterator pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params @@ -10009,11 +10009,11 @@ pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::SegwitV0Sighash) - pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::bip158::FilterHash) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::bip158::FilterHeader) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::BlockHash) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::TxMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::WitnessCommitment) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::WitnessMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::transaction::Txid) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::transaction::Wtxid) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::merkle_tree::TxMerkleNode) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::merkle_tree::WitnessMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::TapSighash) -> bitcoin_hashes::sha256t::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::taproot::TapNodeHash) -> bitcoin_hashes::sha256t::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::taproot::TapLeafHash) -> bitcoin_hashes::sha256t::Hash @@ -10218,17 +10218,13 @@ pub struct bitcoin::bip32::Xpub pub struct bitcoin::block::Block pub struct bitcoin::block::BlockHash(_) pub struct bitcoin::block::Header -pub struct bitcoin::block::TxMerkleNode(_) pub struct bitcoin::block::Version(_) pub struct bitcoin::block::WitnessCommitment(_) -pub struct bitcoin::block::WitnessMerkleNode(_) pub struct bitcoin::blockdata::block::Block pub struct bitcoin::blockdata::block::BlockHash(_) pub struct bitcoin::blockdata::block::Header -pub struct bitcoin::blockdata::block::TxMerkleNode(_) pub struct bitcoin::blockdata::block::Version(_) pub struct bitcoin::blockdata::block::WitnessCommitment(_) -pub struct bitcoin::blockdata::block::WitnessMerkleNode(_) pub struct bitcoin::blockdata::constants::ChainHash(_) pub struct bitcoin::blockdata::locktime::relative::DisabledLockTimeError(_) pub struct bitcoin::blockdata::opcodes::Opcode @@ -10290,6 +10286,8 @@ pub struct bitcoin::key::WPubkeyHash(_) pub struct bitcoin::locktime::relative::DisabledLockTimeError(_) pub struct bitcoin::merkle_tree::MerkleBlock pub struct bitcoin::merkle_tree::PartialMerkleTree +pub struct bitcoin::merkle_tree::TxMerkleNode(_) +pub struct bitcoin::merkle_tree::WitnessMerkleNode(_) pub struct bitcoin::opcodes::Opcode pub struct bitcoin::p2p::Address pub struct bitcoin::p2p::Magic(_) @@ -10484,18 +10482,10 @@ pub type bitcoin::blockdata::block::BlockHash::Bytes = ::Engine pub type bitcoin::blockdata::block::BlockHash::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::block::BlockHash::Output = >::Output -pub type bitcoin::blockdata::block::TxMerkleNode::Bytes = ::Bytes -pub type bitcoin::blockdata::block::TxMerkleNode::Engine = ::Engine -pub type bitcoin::blockdata::block::TxMerkleNode::Err = hex_conservative::error::HexToArrayError -pub type bitcoin::blockdata::block::TxMerkleNode::Output = >::Output pub type bitcoin::blockdata::block::WitnessCommitment::Bytes = ::Bytes pub type bitcoin::blockdata::block::WitnessCommitment::Engine = ::Engine pub type bitcoin::blockdata::block::WitnessCommitment::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::block::WitnessCommitment::Output = >::Output -pub type bitcoin::blockdata::block::WitnessMerkleNode::Bytes = ::Bytes -pub type bitcoin::blockdata::block::WitnessMerkleNode::Engine = ::Engine -pub type bitcoin::blockdata::block::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError -pub type bitcoin::blockdata::block::WitnessMerkleNode::Output = >::Output pub type bitcoin::blockdata::constants::ChainHash::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::constants::ChainHash::Error = core::array::TryFromSliceError pub type bitcoin::blockdata::constants::ChainHash::Output = <[u8] as core::ops::index::Index>::Output @@ -10558,6 +10548,14 @@ pub type bitcoin::key::UntweakedKeypair::TweakedKey = bitcoin::key::TweakedKeypa pub type bitcoin::key::UntweakedPublicKey = secp256k1::key::XOnlyPublicKey pub type bitcoin::key::UntweakedPublicKey::TweakedAux = (bitcoin::key::TweakedPublicKey, secp256k1::key::Parity) pub type bitcoin::key::UntweakedPublicKey::TweakedKey = bitcoin::key::TweakedPublicKey +pub type bitcoin::merkle_tree::TxMerkleNode::Bytes = ::Bytes +pub type bitcoin::merkle_tree::TxMerkleNode::Engine = ::Engine +pub type bitcoin::merkle_tree::TxMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::TxMerkleNode::Output = >::Output +pub type bitcoin::merkle_tree::WitnessMerkleNode::Bytes = ::Bytes +pub type bitcoin::merkle_tree::WitnessMerkleNode::Engine = ::Engine +pub type bitcoin::merkle_tree::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::WitnessMerkleNode::Output = >::Output pub type bitcoin::network::Network::Err = bitcoin::network::ParseNetworkError pub type bitcoin::network::Network::Error = bitcoin::network::UnknownChainHashError pub type bitcoin::network::Network::Error = bitcoin::p2p::UnknownMagicError diff --git a/api/bitcoin/default-features.txt b/api/bitcoin/default-features.txt index 5608366b8..a5a976f46 100644 --- a/api/bitcoin/default-features.txt +++ b/api/bitcoin/default-features.txt @@ -138,10 +138,8 @@ impl bitcoin::bip32::Xpub impl bitcoin::blockdata::block::Block impl bitcoin::blockdata::block::BlockHash impl bitcoin::blockdata::block::Header -impl bitcoin::blockdata::block::TxMerkleNode impl bitcoin::blockdata::block::Version impl bitcoin::blockdata::block::WitnessCommitment -impl bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::blockdata::constants::ChainHash impl bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -191,11 +189,11 @@ impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec -impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec +impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec @@ -212,9 +210,7 @@ impl bitcoin::consensus::encode::Decodable for bitcoin::bip158::FilterHeader impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Block impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::BlockHash impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Header -impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::TxMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Version -impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::script::ScriptBuf impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::transaction::OutPoint @@ -229,6 +225,8 @@ impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::witness::Witn impl bitcoin::consensus::encode::Decodable for bitcoin::consensus::encode::CheckedData impl bitcoin::consensus::encode::Decodable for bitcoin::consensus::encode::VarInt impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::p2p::Magic impl bitcoin::consensus::encode::Decodable for bitcoin::p2p::ServiceFlags impl bitcoin::consensus::encode::Decodable for bitcoin::p2p::address::AddrV2 @@ -292,11 +290,11 @@ impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec -impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec +impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec @@ -313,9 +311,7 @@ impl bitcoin::consensus::encode::Encodable for bitcoin::bip158::FilterHeader impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Block impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::BlockHash impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Header -impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::TxMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Version -impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::script::Script impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::script::ScriptBuf @@ -331,6 +327,8 @@ impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::witness::Witn impl bitcoin::consensus::encode::Encodable for bitcoin::consensus::encode::CheckedData impl bitcoin::consensus::encode::Encodable for bitcoin::consensus::encode::VarInt impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::p2p::Magic impl bitcoin::consensus::encode::Encodable for bitcoin::p2p::ServiceFlags impl bitcoin::consensus::encode::Encodable for bitcoin::p2p::address::AddrV2 @@ -385,6 +383,8 @@ impl bitcoin::key::TapTweak for bitcoin::key::UntweakedPublicKey impl bitcoin::key::TweakedKeypair impl bitcoin::key::TweakedPublicKey impl bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::network::Network impl bitcoin::network::NetworkKind impl bitcoin::p2p::Magic @@ -440,13 +440,13 @@ impl bitcoin_hashes::Hash for bitcoin::bip158::FilterHash impl bitcoin_hashes::Hash for bitcoin::bip158::FilterHeader impl bitcoin_hashes::Hash for bitcoin::bip32::XKeyIdentifier impl bitcoin_hashes::Hash for bitcoin::blockdata::block::BlockHash -impl bitcoin_hashes::Hash for bitcoin::blockdata::block::TxMerkleNode impl bitcoin_hashes::Hash for bitcoin::blockdata::block::WitnessCommitment -impl bitcoin_hashes::Hash for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin_hashes::Hash for bitcoin::blockdata::script::ScriptHash impl bitcoin_hashes::Hash for bitcoin::blockdata::script::WScriptHash impl bitcoin_hashes::Hash for bitcoin::blockdata::transaction::Txid impl bitcoin_hashes::Hash for bitcoin::blockdata::transaction::Wtxid +impl bitcoin_hashes::Hash for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin_hashes::Hash for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin_hashes::Hash for bitcoin::taproot::TapLeafHash impl bitcoin_hashes::Hash for bitcoin::taproot::TapNodeHash impl bitcoin_hashes::Hash for bitcoin::taproot::TapTweakHash @@ -472,15 +472,15 @@ impl core::borrow::Borrow<[u8]> for bitcoin::bip32::ChainCode impl core::borrow::Borrow<[u8]> for bitcoin::bip32::Fingerprint impl core::borrow::Borrow<[u8]> for bitcoin::bip32::XKeyIdentifier impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::BlockHash -impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::TxMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::WitnessCommitment -impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::constants::ChainHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::script::ScriptHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::script::WScriptHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::transaction::Txid impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::transaction::Wtxid impl core::borrow::Borrow<[u8]> for bitcoin::ecdsa::SerializedSignature +impl core::borrow::Borrow<[u8]> for bitcoin::merkle_tree::TxMerkleNode +impl core::borrow::Borrow<[u8]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::p2p::Magic impl core::borrow::Borrow<[u8]> for bitcoin::taproot::TapLeafHash impl core::borrow::Borrow<[u8]> for bitcoin::taproot::TapNodeHash @@ -550,11 +550,9 @@ impl core::clone::Clone for bitcoin::blockdata::block::Bip34Error impl core::clone::Clone for bitcoin::blockdata::block::Block impl core::clone::Clone for bitcoin::blockdata::block::BlockHash impl core::clone::Clone for bitcoin::blockdata::block::Header -impl core::clone::Clone for bitcoin::blockdata::block::TxMerkleNode impl core::clone::Clone for bitcoin::blockdata::block::ValidationError impl core::clone::Clone for bitcoin::blockdata::block::Version impl core::clone::Clone for bitcoin::blockdata::block::WitnessCommitment -impl core::clone::Clone for bitcoin::blockdata::block::WitnessMerkleNode impl core::clone::Clone for bitcoin::blockdata::constants::ChainHash impl core::clone::Clone for bitcoin::blockdata::locktime::absolute::LockTime impl core::clone::Clone for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -611,6 +609,8 @@ impl core::clone::Clone for bitcoin::key::TweakedPublicKey impl core::clone::Clone for bitcoin::key::UncompressedPublicKeyError impl core::clone::Clone for bitcoin::merkle_tree::MerkleBlockError impl core::clone::Clone for bitcoin::merkle_tree::PartialMerkleTree +impl core::clone::Clone for bitcoin::merkle_tree::TxMerkleNode +impl core::clone::Clone for bitcoin::merkle_tree::WitnessMerkleNode impl core::clone::Clone for bitcoin::network::Network impl core::clone::Clone for bitcoin::network::NetworkKind impl core::clone::Clone for bitcoin::network::ParseNetworkError @@ -746,11 +746,9 @@ impl core::cmp::Eq for bitcoin::blockdata::block::Bip34Error impl core::cmp::Eq for bitcoin::blockdata::block::Block impl core::cmp::Eq for bitcoin::blockdata::block::BlockHash impl core::cmp::Eq for bitcoin::blockdata::block::Header -impl core::cmp::Eq for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::Eq for bitcoin::blockdata::block::ValidationError impl core::cmp::Eq for bitcoin::blockdata::block::Version impl core::cmp::Eq for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::Eq for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::Eq for bitcoin::blockdata::constants::ChainHash impl core::cmp::Eq for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::Eq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -807,6 +805,8 @@ impl core::cmp::Eq for bitcoin::key::TweakedPublicKey impl core::cmp::Eq for bitcoin::key::UncompressedPublicKeyError impl core::cmp::Eq for bitcoin::merkle_tree::MerkleBlockError impl core::cmp::Eq for bitcoin::merkle_tree::PartialMerkleTree +impl core::cmp::Eq for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::Eq for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::Eq for bitcoin::network::Network impl core::cmp::Eq for bitcoin::network::NetworkKind impl core::cmp::Eq for bitcoin::network::ParseNetworkError @@ -922,10 +922,8 @@ impl core::cmp::Ord for bitcoin::bip32::XKeyIdentifier impl core::cmp::Ord for bitcoin::bip32::Xpub impl core::cmp::Ord for bitcoin::blockdata::block::BlockHash impl core::cmp::Ord for bitcoin::blockdata::block::Header -impl core::cmp::Ord for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::Ord for bitcoin::blockdata::block::Version impl core::cmp::Ord for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::Ord for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::Ord for bitcoin::blockdata::constants::ChainHash impl core::cmp::Ord for bitcoin::blockdata::opcodes::ClassifyContext impl core::cmp::Ord for bitcoin::blockdata::script::PushBytes @@ -949,6 +947,8 @@ impl core::cmp::Ord for bitcoin::consensus::encode::VarInt impl core::cmp::Ord for bitcoin::key::SortKey impl core::cmp::Ord for bitcoin::key::TweakedKeypair impl core::cmp::Ord for bitcoin::key::TweakedPublicKey +impl core::cmp::Ord for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::Ord for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::Ord for bitcoin::network::Network impl core::cmp::Ord for bitcoin::network::NetworkKind impl core::cmp::Ord for bitcoin::p2p::Magic @@ -1031,11 +1031,9 @@ impl core::cmp::PartialEq for bitcoin::blockdata::block::Bip34Error impl core::cmp::PartialEq for bitcoin::blockdata::block::Block impl core::cmp::PartialEq for bitcoin::blockdata::block::BlockHash impl core::cmp::PartialEq for bitcoin::blockdata::block::Header -impl core::cmp::PartialEq for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::PartialEq for bitcoin::blockdata::block::ValidationError impl core::cmp::PartialEq for bitcoin::blockdata::block::Version impl core::cmp::PartialEq for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::PartialEq for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::PartialEq for bitcoin::blockdata::constants::ChainHash impl core::cmp::PartialEq for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::PartialEq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -1092,6 +1090,8 @@ impl core::cmp::PartialEq for bitcoin::key::TweakedPublicKey impl core::cmp::PartialEq for bitcoin::key::UncompressedPublicKeyError impl core::cmp::PartialEq for bitcoin::merkle_tree::MerkleBlockError impl core::cmp::PartialEq for bitcoin::merkle_tree::PartialMerkleTree +impl core::cmp::PartialEq for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::PartialEq for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::PartialEq for bitcoin::network::Network impl core::cmp::PartialEq for bitcoin::network::NetworkKind impl core::cmp::PartialEq for bitcoin::network::ParseNetworkError @@ -1211,10 +1211,8 @@ impl core::cmp::PartialOrd for bitcoin::bip32::XKeyIdentifier impl core::cmp::PartialOrd for bitcoin::bip32::Xpub impl core::cmp::PartialOrd for bitcoin::blockdata::block::BlockHash impl core::cmp::PartialOrd for bitcoin::blockdata::block::Header -impl core::cmp::PartialOrd for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::PartialOrd for bitcoin::blockdata::block::Version impl core::cmp::PartialOrd for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::PartialOrd for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::PartialOrd for bitcoin::blockdata::constants::ChainHash impl core::cmp::PartialOrd for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::PartialOrd for bitcoin::blockdata::locktime::relative::LockTime @@ -1240,6 +1238,8 @@ impl core::cmp::PartialOrd for bitcoin::consensus::encode::VarInt impl core::cmp::PartialOrd for bitcoin::key::SortKey impl core::cmp::PartialOrd for bitcoin::key::TweakedKeypair impl core::cmp::PartialOrd for bitcoin::key::TweakedPublicKey +impl core::cmp::PartialOrd for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::PartialOrd for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::PartialOrd for bitcoin::network::Network impl core::cmp::PartialOrd for bitcoin::network::NetworkKind impl core::cmp::PartialOrd for bitcoin::p2p::Magic @@ -1385,13 +1385,13 @@ impl core::convert::AsRef<[u8; 32]> for bitcoin::bip158::FilterHash impl core::convert::AsRef<[u8; 32]> for bitcoin::bip158::FilterHeader impl core::convert::AsRef<[u8; 32]> for bitcoin::bip32::ChainCode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::BlockHash -impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::TxMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::constants::ChainHash impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::script::WScriptHash impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::transaction::Txid impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::transaction::Wtxid +impl core::convert::AsRef<[u8; 32]> for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::AsRef<[u8; 32]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapLeafHash impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapNodeHash impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapTweakHash @@ -1410,9 +1410,7 @@ impl core::convert::AsRef<[u8]> for bitcoin::bip32::ChainCode impl core::convert::AsRef<[u8]> for bitcoin::bip32::Fingerprint impl core::convert::AsRef<[u8]> for bitcoin::bip32::XKeyIdentifier impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::BlockHash -impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::TxMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::blockdata::constants::ChainHash impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::PushBytes impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::Script @@ -1422,6 +1420,8 @@ impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::WScriptHash impl core::convert::AsRef<[u8]> for bitcoin::blockdata::transaction::Txid impl core::convert::AsRef<[u8]> for bitcoin::blockdata::transaction::Wtxid impl core::convert::AsRef<[u8]> for bitcoin::ecdsa::SerializedSignature +impl core::convert::AsRef<[u8]> for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::AsRef<[u8]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::p2p::Magic impl core::convert::AsRef<[u8]> for bitcoin::taproot::TapLeafHash impl core::convert::AsRef<[u8]> for bitcoin::taproot::TapNodeHash @@ -1776,9 +1776,7 @@ impl core::convert::From for bitcoin::bip32::XKeyIdentifie impl core::convert::From for bitcoin::blockdata::block::BlockHash impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::blockdata::block::BlockHash -impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::blockdata::transaction::Sequence impl core::convert::From for alloc::vec::Vec impl core::convert::From for alloc::borrow::Cow<'_, bitcoin::blockdata::script::Script> @@ -1803,9 +1801,9 @@ impl core::convert::From for impl core::convert::From for u32 impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid -impl core::convert::From for bitcoin::blockdata::block::TxMerkleNode +impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin::blockdata::block::WitnessMerkleNode +impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::psbt::Error impl core::convert::From for bitcoin::key::ParsePublicKeyError @@ -1814,6 +1812,8 @@ impl core::convert::From for bitc impl core::convert::From for bitcoin::key::TweakedPublicKey impl core::convert::From for secp256k1::key::Keypair impl core::convert::From for secp256k1::key::XOnlyPublicKey +impl core::convert::From for bitcoin_hashes::sha256d::Hash +impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for &'static bitcoin::consensus::params::Params impl core::convert::From for bitcoin::address::KnownHrp impl core::convert::From for bitcoin::consensus::params::Params @@ -1849,11 +1849,11 @@ impl core::convert::From for bitcoin::SegwitV0Sig impl core::convert::From for bitcoin::bip158::FilterHash impl core::convert::From for bitcoin::bip158::FilterHeader impl core::convert::From for bitcoin::blockdata::block::BlockHash -impl core::convert::From for bitcoin::blockdata::block::TxMerkleNode impl core::convert::From for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::From for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid +impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From> for bitcoin::TapSighash impl core::convert::From> for bitcoin::taproot::TapNodeHash impl core::convert::From> for bitcoin::taproot::TapLeafHash @@ -2086,11 +2086,9 @@ impl core::fmt::Debug for bitcoin::blockdata::block::Bip34Error impl core::fmt::Debug for bitcoin::blockdata::block::Block impl core::fmt::Debug for bitcoin::blockdata::block::BlockHash impl core::fmt::Debug for bitcoin::blockdata::block::Header -impl core::fmt::Debug for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::Debug for bitcoin::blockdata::block::ValidationError impl core::fmt::Debug for bitcoin::blockdata::block::Version impl core::fmt::Debug for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::Debug for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::Debug for bitcoin::blockdata::constants::ChainHash impl core::fmt::Debug for bitcoin::blockdata::locktime::absolute::LockTime impl core::fmt::Debug for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2151,6 +2149,8 @@ impl core::fmt::Debug for bitcoin::key::TweakedPublicKey impl core::fmt::Debug for bitcoin::key::UncompressedPublicKeyError impl core::fmt::Debug for bitcoin::merkle_tree::MerkleBlockError impl core::fmt::Debug for bitcoin::merkle_tree::PartialMerkleTree +impl core::fmt::Debug for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::Debug for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::Debug for bitcoin::network::Network impl core::fmt::Debug for bitcoin::network::NetworkKind impl core::fmt::Debug for bitcoin::network::ParseNetworkError @@ -2274,10 +2274,8 @@ impl core::fmt::Display for bitcoin::bip32::Xpriv impl core::fmt::Display for bitcoin::bip32::Xpub impl core::fmt::Display for bitcoin::blockdata::block::Bip34Error impl core::fmt::Display for bitcoin::blockdata::block::BlockHash -impl core::fmt::Display for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::Display for bitcoin::blockdata::block::ValidationError impl core::fmt::Display for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::Display for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::Display for bitcoin::blockdata::constants::ChainHash impl core::fmt::Display for bitcoin::blockdata::locktime::absolute::LockTime impl core::fmt::Display for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2322,6 +2320,8 @@ impl core::fmt::Display for bitcoin::key::ParsePublicKeyError impl core::fmt::Display for bitcoin::key::TweakedPublicKey impl core::fmt::Display for bitcoin::key::UncompressedPublicKeyError impl core::fmt::Display for bitcoin::merkle_tree::MerkleBlockError +impl core::fmt::Display for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::Display for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::Display for bitcoin::network::Network impl core::fmt::Display for bitcoin::network::ParseNetworkError impl core::fmt::Display for bitcoin::network::UnknownChainHashError @@ -2374,9 +2374,7 @@ impl core::fmt::LowerHex for bitcoin::bip32::ChainCode impl core::fmt::LowerHex for bitcoin::bip32::Fingerprint impl core::fmt::LowerHex for bitcoin::bip32::XKeyIdentifier impl core::fmt::LowerHex for bitcoin::blockdata::block::BlockHash -impl core::fmt::LowerHex for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::LowerHex for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::LowerHex for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::LowerHex for bitcoin::blockdata::constants::ChainHash impl core::fmt::LowerHex for bitcoin::blockdata::script::Script impl core::fmt::LowerHex for bitcoin::blockdata::script::ScriptBuf @@ -2387,6 +2385,8 @@ impl core::fmt::LowerHex for bitcoin::blockdata::transaction::Txid impl core::fmt::LowerHex for bitcoin::blockdata::transaction::Wtxid impl core::fmt::LowerHex for bitcoin::ecdsa::SerializedSignature impl core::fmt::LowerHex for bitcoin::key::TweakedPublicKey +impl core::fmt::LowerHex for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::LowerHex for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::LowerHex for bitcoin::p2p::Magic impl core::fmt::LowerHex for bitcoin::p2p::ServiceFlags impl core::fmt::LowerHex for bitcoin::pow::CompactTarget @@ -2409,9 +2409,7 @@ impl core::fmt::UpperHex for bitcoin::bip32::ChainCode impl core::fmt::UpperHex for bitcoin::bip32::Fingerprint impl core::fmt::UpperHex for bitcoin::bip32::XKeyIdentifier impl core::fmt::UpperHex for bitcoin::blockdata::block::BlockHash -impl core::fmt::UpperHex for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::UpperHex for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::UpperHex for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::UpperHex for bitcoin::blockdata::constants::ChainHash impl core::fmt::UpperHex for bitcoin::blockdata::script::Script impl core::fmt::UpperHex for bitcoin::blockdata::script::ScriptBuf @@ -2421,6 +2419,8 @@ impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Sequence impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Txid impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Wtxid impl core::fmt::UpperHex for bitcoin::ecdsa::SerializedSignature +impl core::fmt::UpperHex for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::UpperHex for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::UpperHex for bitcoin::p2p::Magic impl core::fmt::UpperHex for bitcoin::p2p::ServiceFlags impl core::fmt::UpperHex for bitcoin::pow::CompactTarget @@ -2461,10 +2461,8 @@ impl core::hash::Hash for bitcoin::bip32::XKeyIdentifier impl core::hash::Hash for bitcoin::bip32::Xpub impl core::hash::Hash for bitcoin::blockdata::block::BlockHash impl core::hash::Hash for bitcoin::blockdata::block::Header -impl core::hash::Hash for bitcoin::blockdata::block::TxMerkleNode impl core::hash::Hash for bitcoin::blockdata::block::Version impl core::hash::Hash for bitcoin::blockdata::block::WitnessCommitment -impl core::hash::Hash for bitcoin::blockdata::block::WitnessMerkleNode impl core::hash::Hash for bitcoin::blockdata::constants::ChainHash impl core::hash::Hash for bitcoin::blockdata::locktime::absolute::LockTime impl core::hash::Hash for bitcoin::blockdata::locktime::relative::LockTime @@ -2491,6 +2489,8 @@ impl core::hash::Hash for bitcoin::ecdsa::Signature impl core::hash::Hash for bitcoin::key::SortKey impl core::hash::Hash for bitcoin::key::TweakedKeypair impl core::hash::Hash for bitcoin::key::TweakedPublicKey +impl core::hash::Hash for bitcoin::merkle_tree::TxMerkleNode +impl core::hash::Hash for bitcoin::merkle_tree::WitnessMerkleNode impl core::hash::Hash for bitcoin::network::Network impl core::hash::Hash for bitcoin::network::NetworkKind impl core::hash::Hash for bitcoin::p2p::Magic @@ -2571,10 +2571,8 @@ impl core::marker::Copy for bitcoin::bip32::Xpriv impl core::marker::Copy for bitcoin::bip32::Xpub impl core::marker::Copy for bitcoin::blockdata::block::BlockHash impl core::marker::Copy for bitcoin::blockdata::block::Header -impl core::marker::Copy for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Copy for bitcoin::blockdata::block::Version impl core::marker::Copy for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Copy for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Copy for bitcoin::blockdata::constants::ChainHash impl core::marker::Copy for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Copy for bitcoin::blockdata::locktime::relative::LockTime @@ -2597,6 +2595,8 @@ impl core::marker::Copy for bitcoin::ecdsa::Signature impl core::marker::Copy for bitcoin::key::SortKey impl core::marker::Copy for bitcoin::key::TweakedKeypair impl core::marker::Copy for bitcoin::key::TweakedPublicKey +impl core::marker::Copy for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Copy for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Copy for bitcoin::network::Network impl core::marker::Copy for bitcoin::network::NetworkKind impl core::marker::Copy for bitcoin::p2p::Magic @@ -2673,11 +2673,9 @@ impl core::marker::Freeze for bitcoin::blockdata::block::Bip34Error impl core::marker::Freeze for bitcoin::blockdata::block::Block impl core::marker::Freeze for bitcoin::blockdata::block::BlockHash impl core::marker::Freeze for bitcoin::blockdata::block::Header -impl core::marker::Freeze for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Freeze for bitcoin::blockdata::block::ValidationError impl core::marker::Freeze for bitcoin::blockdata::block::Version impl core::marker::Freeze for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Freeze for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Freeze for bitcoin::blockdata::constants::ChainHash impl core::marker::Freeze for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Freeze for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2738,6 +2736,8 @@ impl core::marker::Freeze for bitcoin::key::TweakedPublicKey impl core::marker::Freeze for bitcoin::key::UncompressedPublicKeyError impl core::marker::Freeze for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Freeze for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Freeze for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Freeze for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Freeze for bitcoin::network::Network impl core::marker::Freeze for bitcoin::network::NetworkKind impl core::marker::Freeze for bitcoin::network::ParseNetworkError @@ -2878,11 +2878,9 @@ impl core::marker::Send for bitcoin::blockdata::block::Bip34Error impl core::marker::Send for bitcoin::blockdata::block::Block impl core::marker::Send for bitcoin::blockdata::block::BlockHash impl core::marker::Send for bitcoin::blockdata::block::Header -impl core::marker::Send for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Send for bitcoin::blockdata::block::ValidationError impl core::marker::Send for bitcoin::blockdata::block::Version impl core::marker::Send for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Send for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Send for bitcoin::blockdata::constants::ChainHash impl core::marker::Send for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Send for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2943,6 +2941,8 @@ impl core::marker::Send for bitcoin::key::TweakedPublicKey impl core::marker::Send for bitcoin::key::UncompressedPublicKeyError impl core::marker::Send for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Send for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Send for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Send for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Send for bitcoin::network::Network impl core::marker::Send for bitcoin::network::NetworkKind impl core::marker::Send for bitcoin::network::ParseNetworkError @@ -3080,11 +3080,9 @@ impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Bip34Error impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Block impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::BlockHash impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Header -impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::TxMerkleNode impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::ValidationError impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Version impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::StructuralPartialEq for bitcoin::blockdata::constants::ChainHash impl core::marker::StructuralPartialEq for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::StructuralPartialEq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3140,6 +3138,8 @@ impl core::marker::StructuralPartialEq for bitcoin::key::TweakedPublicKey impl core::marker::StructuralPartialEq for bitcoin::key::UncompressedPublicKeyError impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::MerkleBlockError impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::StructuralPartialEq for bitcoin::network::Network impl core::marker::StructuralPartialEq for bitcoin::network::NetworkKind impl core::marker::StructuralPartialEq for bitcoin::network::ParseNetworkError @@ -3275,11 +3275,9 @@ impl core::marker::Sync for bitcoin::blockdata::block::Bip34Error impl core::marker::Sync for bitcoin::blockdata::block::Block impl core::marker::Sync for bitcoin::blockdata::block::BlockHash impl core::marker::Sync for bitcoin::blockdata::block::Header -impl core::marker::Sync for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Sync for bitcoin::blockdata::block::ValidationError impl core::marker::Sync for bitcoin::blockdata::block::Version impl core::marker::Sync for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Sync for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Sync for bitcoin::blockdata::constants::ChainHash impl core::marker::Sync for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Sync for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3340,6 +3338,8 @@ impl core::marker::Sync for bitcoin::key::TweakedPublicKey impl core::marker::Sync for bitcoin::key::UncompressedPublicKeyError impl core::marker::Sync for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Sync for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Sync for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Sync for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Sync for bitcoin::network::Network impl core::marker::Sync for bitcoin::network::NetworkKind impl core::marker::Sync for bitcoin::network::ParseNetworkError @@ -3480,11 +3480,9 @@ impl core::marker::Unpin for bitcoin::blockdata::block::Bip34Error impl core::marker::Unpin for bitcoin::blockdata::block::Block impl core::marker::Unpin for bitcoin::blockdata::block::BlockHash impl core::marker::Unpin for bitcoin::blockdata::block::Header -impl core::marker::Unpin for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Unpin for bitcoin::blockdata::block::ValidationError impl core::marker::Unpin for bitcoin::blockdata::block::Version impl core::marker::Unpin for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Unpin for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Unpin for bitcoin::blockdata::constants::ChainHash impl core::marker::Unpin for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Unpin for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3545,6 +3543,8 @@ impl core::marker::Unpin for bitcoin::key::TweakedPublicKey impl core::marker::Unpin for bitcoin::key::UncompressedPublicKeyError impl core::marker::Unpin for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Unpin for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Unpin for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Unpin for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Unpin for bitcoin::network::Network impl core::marker::Unpin for bitcoin::network::NetworkKind impl core::marker::Unpin for bitcoin::network::ParseNetworkError @@ -3716,11 +3716,9 @@ impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Bip3 impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Block impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::BlockHash impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Header -impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::TxMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::ValidationError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Version impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::WitnessCommitment -impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::WitnessMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::constants::ChainHash impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::locktime::absolute::LockTime impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3779,6 +3777,8 @@ impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::key::TweakedPublicKey impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::key::UncompressedPublicKeyError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::MerkleBlockError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::PartialMerkleTree +impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::TxMerkleNode +impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::WitnessMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::Network impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::NetworkKind impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::ParseNetworkError @@ -3917,11 +3917,9 @@ impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Bip34Er impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Block impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::BlockHash impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Header -impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::TxMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::ValidationError impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Version impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::WitnessCommitment -impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::WitnessMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::constants::ChainHash impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::locktime::absolute::LockTime impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3980,6 +3978,8 @@ impl core::panic::unwind_safe::UnwindSafe for bitcoin::key::TweakedPublicKey impl core::panic::unwind_safe::UnwindSafe for bitcoin::key::UncompressedPublicKeyError impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::MerkleBlockError impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::PartialMerkleTree +impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::TxMerkleNode +impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::WitnessMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::Network impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::NetworkKind impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::ParseNetworkError @@ -4091,9 +4091,7 @@ impl core::str::traits::FromStr for bitcoin::bip32::XKeyIdentifier impl core::str::traits::FromStr for bitcoin::bip32::Xpriv impl core::str::traits::FromStr for bitcoin::bip32::Xpub impl core::str::traits::FromStr for bitcoin::blockdata::block::BlockHash -impl core::str::traits::FromStr for bitcoin::blockdata::block::TxMerkleNode impl core::str::traits::FromStr for bitcoin::blockdata::block::WitnessCommitment -impl core::str::traits::FromStr for bitcoin::blockdata::block::WitnessMerkleNode impl core::str::traits::FromStr for bitcoin::blockdata::constants::ChainHash impl core::str::traits::FromStr for bitcoin::blockdata::locktime::absolute::LockTime impl core::str::traits::FromStr for bitcoin::blockdata::script::ScriptHash @@ -4104,6 +4102,8 @@ impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Sequence impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Txid impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Wtxid impl core::str::traits::FromStr for bitcoin::ecdsa::Signature +impl core::str::traits::FromStr for bitcoin::merkle_tree::TxMerkleNode +impl core::str::traits::FromStr for bitcoin::merkle_tree::WitnessMerkleNode impl core::str::traits::FromStr for bitcoin::network::Network impl core::str::traits::FromStr for bitcoin::p2p::Magic impl core::str::traits::FromStr for bitcoin::p2p::message::CommandString @@ -4572,13 +4572,13 @@ impl> core::ops::index::Index for bit impl> core::ops::index::Index for bitcoin::bip158::FilterHeader impl> core::ops::index::Index for bitcoin::bip32::XKeyIdentifier impl> core::ops::index::Index for bitcoin::blockdata::block::BlockHash -impl> core::ops::index::Index for bitcoin::blockdata::block::TxMerkleNode impl> core::ops::index::Index for bitcoin::blockdata::block::WitnessCommitment -impl> core::ops::index::Index for bitcoin::blockdata::block::WitnessMerkleNode impl> core::ops::index::Index for bitcoin::blockdata::script::ScriptHash impl> core::ops::index::Index for bitcoin::blockdata::script::WScriptHash impl> core::ops::index::Index for bitcoin::blockdata::transaction::Txid impl> core::ops::index::Index for bitcoin::blockdata::transaction::Wtxid +impl> core::ops::index::Index for bitcoin::merkle_tree::TxMerkleNode +impl> core::ops::index::Index for bitcoin::merkle_tree::WitnessMerkleNode impl> core::ops::index::Index for bitcoin::taproot::TapLeafHash impl> core::ops::index::Index for bitcoin::taproot::TapNodeHash impl> core::ops::index::Index for bitcoin::taproot::TapTweakHash @@ -4809,7 +4809,7 @@ pub bitcoin::block::Bip34Error::Unsupported pub bitcoin::block::Block::header: bitcoin::blockdata::block::Header pub bitcoin::block::Block::txdata: alloc::vec::Vec pub bitcoin::block::Header::bits: bitcoin::pow::CompactTarget -pub bitcoin::block::Header::merkle_root: bitcoin::blockdata::block::TxMerkleNode +pub bitcoin::block::Header::merkle_root: bitcoin::merkle_tree::TxMerkleNode pub bitcoin::block::Header::nonce: u32 pub bitcoin::block::Header::prev_blockhash: bitcoin::blockdata::block::BlockHash pub bitcoin::block::Header::time: u32 @@ -4823,7 +4823,7 @@ pub bitcoin::blockdata::block::Bip34Error::Unsupported pub bitcoin::blockdata::block::Block::header: bitcoin::blockdata::block::Header pub bitcoin::blockdata::block::Block::txdata: alloc::vec::Vec pub bitcoin::blockdata::block::Header::bits: bitcoin::pow::CompactTarget -pub bitcoin::blockdata::block::Header::merkle_root: bitcoin::blockdata::block::TxMerkleNode +pub bitcoin::blockdata::block::Header::merkle_root: bitcoin::merkle_tree::TxMerkleNode pub bitcoin::blockdata::block::Header::nonce: u32 pub bitcoin::blockdata::block::Header::prev_blockhash: bitcoin::blockdata::block::BlockHash pub bitcoin::blockdata::block::Header::time: u32 @@ -5427,15 +5427,11 @@ pub const bitcoin::bip32::XKeyIdentifier::LEN: usize pub const bitcoin::blockdata::block::BlockHash::DISPLAY_BACKWARD: bool pub const bitcoin::blockdata::block::BlockHash::LEN: usize pub const bitcoin::blockdata::block::Header::SIZE: usize -pub const bitcoin::blockdata::block::TxMerkleNode::DISPLAY_BACKWARD: bool -pub const bitcoin::blockdata::block::TxMerkleNode::LEN: usize pub const bitcoin::blockdata::block::Version::NO_SOFT_FORK_SIGNALLING: Self pub const bitcoin::blockdata::block::Version::ONE: Self pub const bitcoin::blockdata::block::Version::TWO: Self pub const bitcoin::blockdata::block::WitnessCommitment::DISPLAY_BACKWARD: bool pub const bitcoin::blockdata::block::WitnessCommitment::LEN: usize -pub const bitcoin::blockdata::block::WitnessMerkleNode::DISPLAY_BACKWARD: bool -pub const bitcoin::blockdata::block::WitnessMerkleNode::LEN: usize pub const bitcoin::blockdata::constants::COINBASE_MATURITY: u32 = 100u32 pub const bitcoin::blockdata::constants::ChainHash::BITCOIN: Self pub const bitcoin::blockdata::constants::ChainHash::REGTEST: Self @@ -5759,6 +5755,10 @@ pub const bitcoin::constants::SCRIPT_ADDRESS_PREFIX_TEST: u8 = 196u8 pub const bitcoin::constants::SUBSIDY_HALVING_INTERVAL: u32 = 210_000u32 pub const bitcoin::constants::TARGET_BLOCK_SPACING: u32 = 600u32 pub const bitcoin::constants::WITNESS_SCALE_FACTOR: units::weight::WITNESS_SCALE_FACTOR +pub const bitcoin::merkle_tree::TxMerkleNode::DISPLAY_BACKWARD: bool +pub const bitcoin::merkle_tree::TxMerkleNode::LEN: usize +pub const bitcoin::merkle_tree::WitnessMerkleNode::DISPLAY_BACKWARD: bool +pub const bitcoin::merkle_tree::WitnessMerkleNode::LEN: usize pub const bitcoin::opcodes::all::OP_0NOTEQUAL: _ pub const bitcoin::opcodes::all::OP_1ADD: _ pub const bitcoin::opcodes::all::OP_1SUB: _ @@ -6534,8 +6534,6 @@ pub fn alloc::vec::Vec::consensus_decode_f pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result -pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result @@ -6544,6 +6542,8 @@ pub fn alloc::vec::Vec::consensus_decode pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result +pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result @@ -7256,8 +7256,8 @@ pub fn bitcoin::blockdata::block::Block::check_merkle_root(&self) -> bool pub fn bitcoin::blockdata::block::Block::check_witness_commitment(&self) -> bool pub fn bitcoin::blockdata::block::Block::clone(&self) -> bitcoin::blockdata::block::Block pub fn bitcoin::blockdata::block::Block::coinbase(&self) -> core::option::Option<&bitcoin::blockdata::transaction::Transaction> -pub fn bitcoin::blockdata::block::Block::compute_merkle_root(&self) -> core::option::Option -pub fn bitcoin::blockdata::block::Block::compute_witness_commitment(witness_root: &bitcoin::blockdata::block::WitnessMerkleNode, witness_reserved_value: &[u8]) -> bitcoin::blockdata::block::WitnessCommitment +pub fn bitcoin::blockdata::block::Block::compute_merkle_root(&self) -> core::option::Option +pub fn bitcoin::blockdata::block::Block::compute_witness_commitment(witness_root: &bitcoin::merkle_tree::WitnessMerkleNode, witness_reserved_value: &[u8]) -> bitcoin::blockdata::block::WitnessCommitment pub fn bitcoin::blockdata::block::Block::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::blockdata::block::Block::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn bitcoin::blockdata::block::Block::consensus_encode(&self, r: &mut R) -> core::result::Result @@ -7265,7 +7265,7 @@ pub fn bitcoin::blockdata::block::Block::eq(&self, other: &bitcoin::blockdata::b pub fn bitcoin::blockdata::block::Block::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::blockdata::block::Block::total_size(&self) -> usize pub fn bitcoin::blockdata::block::Block::weight(&self) -> bitcoin_units::weight::Weight -pub fn bitcoin::blockdata::block::Block::witness_root(&self) -> core::option::Option +pub fn bitcoin::blockdata::block::Block::witness_root(&self) -> core::option::Option pub fn bitcoin::blockdata::block::BlockHash::all_zeros() -> Self pub fn bitcoin::blockdata::block::BlockHash::as_byte_array(&self) -> &::Bytes pub fn bitcoin::blockdata::block::BlockHash::as_byte_array(&self) -> &Self::Bytes @@ -7315,37 +7315,6 @@ pub fn bitcoin::blockdata::block::Header::partial_cmp(&self, other: &bitcoin::bl pub fn bitcoin::blockdata::block::Header::target(&self) -> bitcoin::pow::Target pub fn bitcoin::blockdata::block::Header::validate_pow(&self, required_target: bitcoin::pow::Target) -> core::result::Result pub fn bitcoin::blockdata::block::Header::work(&self) -> bitcoin::pow::Work -pub fn bitcoin::blockdata::block::TxMerkleNode::all_zeros() -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::as_byte_array(&self) -> &::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::as_byte_array(&self) -> &Self::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::TxMerkleNode::as_ref(&self) -> &[u8; 32] -pub fn bitcoin::blockdata::block::TxMerkleNode::as_ref(&self) -> &[u8] -pub fn bitcoin::blockdata::block::TxMerkleNode::borrow(&self) -> &[u8] -pub fn bitcoin::blockdata::block::TxMerkleNode::clone(&self) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::cmp(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> core::cmp::Ordering -pub fn bitcoin::blockdata::block::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::engine() -> ::Engine -pub fn bitcoin::blockdata::block::TxMerkleNode::eq(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> bool -pub fn bitcoin::blockdata::block::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_engine(e: ::Engine) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::from_str(s: &str) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::hash(data: &[u8]) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) -pub fn bitcoin::blockdata::block::TxMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator -pub fn bitcoin::blockdata::block::TxMerkleNode::index(&self, index: I) -> &Self::Output -pub fn bitcoin::blockdata::block::TxMerkleNode::partial_cmp(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> core::option::Option -pub fn bitcoin::blockdata::block::TxMerkleNode::to_byte_array(self) -> ::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::to_byte_array(self) -> Self::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::blockdata::block::ValidationError::clone(&self) -> bitcoin::blockdata::block::ValidationError pub fn bitcoin::blockdata::block::ValidationError::eq(&self, other: &bitcoin::blockdata::block::ValidationError) -> bool pub fn bitcoin::blockdata::block::ValidationError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -7390,37 +7359,6 @@ pub fn bitcoin::blockdata::block::WitnessCommitment::partial_cmp(&self, other: & pub fn bitcoin::blockdata::block::WitnessCommitment::to_byte_array(self) -> ::Bytes pub fn bitcoin::blockdata::block::WitnessCommitment::to_byte_array(self) -> Self::Bytes pub fn bitcoin::blockdata::block::WitnessCommitment::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::WitnessMerkleNode::all_zeros() -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_byte_array(&self) -> &::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_byte_array(&self) -> &Self::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_ref(&self) -> &[u8; 32] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_ref(&self) -> &[u8] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::borrow(&self) -> &[u8] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::clone(&self) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::cmp(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> core::cmp::Ordering -pub fn bitcoin::blockdata::block::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::engine() -> ::Engine -pub fn bitcoin::blockdata::block::WitnessMerkleNode::eq(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> bool -pub fn bitcoin::blockdata::block::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_engine(e: ::Engine) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_str(s: &str) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash(data: &[u8]) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator -pub fn bitcoin::blockdata::block::WitnessMerkleNode::index(&self, index: I) -> &Self::Output -pub fn bitcoin::blockdata::block::WitnessMerkleNode::partial_cmp(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> core::option::Option -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_byte_array(self) -> ::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::blockdata::constants::ChainHash::as_byte_array(&self) -> &[u8; 32] pub fn bitcoin::blockdata::constants::ChainHash::as_bytes(&self) -> &[u8] pub fn bitcoin::blockdata::constants::ChainHash::as_mut(&mut self) -> &mut [u8; 32] @@ -8448,11 +8386,73 @@ pub fn bitcoin::merkle_tree::PartialMerkleTree::clone(&self) -> bitcoin::merkle_ pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::eq(&self, other: &bitcoin::merkle_tree::PartialMerkleTree) -> bool -pub fn bitcoin::merkle_tree::PartialMerkleTree::extract_matches(&self, matches: &mut alloc::vec::Vec, indexes: &mut alloc::vec::Vec) -> core::result::Result +pub fn bitcoin::merkle_tree::PartialMerkleTree::extract_matches(&self, matches: &mut alloc::vec::Vec, indexes: &mut alloc::vec::Vec) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::from_txids(txids: &[bitcoin::blockdata::transaction::Txid], matches: &[bool]) -> Self -pub fn bitcoin::merkle_tree::PartialMerkleTree::hashes(&self) -> &alloc::vec::Vec +pub fn bitcoin::merkle_tree::PartialMerkleTree::hashes(&self) -> &alloc::vec::Vec pub fn bitcoin::merkle_tree::PartialMerkleTree::num_transactions(&self) -> u32 +pub fn bitcoin::merkle_tree::TxMerkleNode::all_zeros() -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::as_byte_array(&self) -> &::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::as_byte_array(&self) -> &Self::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8; 32] +pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8] +pub fn bitcoin::merkle_tree::TxMerkleNode::borrow(&self) -> &[u8] +pub fn bitcoin::merkle_tree::TxMerkleNode::clone(&self) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::engine() -> ::Engine +pub fn bitcoin::merkle_tree::TxMerkleNode::eq(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> bool +pub fn bitcoin::merkle_tree::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::from_str(s: &str) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::hash(data: &[u8]) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn bitcoin::merkle_tree::TxMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator +pub fn bitcoin::merkle_tree::TxMerkleNode::index(&self, index: I) -> &Self::Output +pub fn bitcoin::merkle_tree::TxMerkleNode::partial_cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::option::Option +pub fn bitcoin::merkle_tree::TxMerkleNode::to_byte_array(self) -> ::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::to_byte_array(self) -> Self::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::WitnessMerkleNode::all_zeros() -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_byte_array(&self) -> &::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_byte_array(&self) -> &Self::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8; 32] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::borrow(&self) -> &[u8] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::clone(&self) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::engine() -> ::Engine +pub fn bitcoin::merkle_tree::WitnessMerkleNode::eq(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> bool +pub fn bitcoin::merkle_tree::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_str(s: &str) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash(data: &[u8]) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator +pub fn bitcoin::merkle_tree::WitnessMerkleNode::index(&self, index: I) -> &Self::Output +pub fn bitcoin::merkle_tree::WitnessMerkleNode::partial_cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::option::Option +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> ::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write, I: core::iter::traits::iterator::Iterator pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params @@ -9493,11 +9493,11 @@ pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::SegwitV0Sighash) - pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::bip158::FilterHash) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::bip158::FilterHeader) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::BlockHash) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::TxMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::WitnessCommitment) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::WitnessMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::transaction::Txid) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::transaction::Wtxid) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::merkle_tree::TxMerkleNode) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::merkle_tree::WitnessMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::TapSighash) -> bitcoin_hashes::sha256t::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::taproot::TapNodeHash) -> bitcoin_hashes::sha256t::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::taproot::TapLeafHash) -> bitcoin_hashes::sha256t::Hash @@ -9698,17 +9698,13 @@ pub struct bitcoin::bip32::Xpub pub struct bitcoin::block::Block pub struct bitcoin::block::BlockHash(_) pub struct bitcoin::block::Header -pub struct bitcoin::block::TxMerkleNode(_) pub struct bitcoin::block::Version(_) pub struct bitcoin::block::WitnessCommitment(_) -pub struct bitcoin::block::WitnessMerkleNode(_) pub struct bitcoin::blockdata::block::Block pub struct bitcoin::blockdata::block::BlockHash(_) pub struct bitcoin::blockdata::block::Header -pub struct bitcoin::blockdata::block::TxMerkleNode(_) pub struct bitcoin::blockdata::block::Version(_) pub struct bitcoin::blockdata::block::WitnessCommitment(_) -pub struct bitcoin::blockdata::block::WitnessMerkleNode(_) pub struct bitcoin::blockdata::constants::ChainHash(_) pub struct bitcoin::blockdata::locktime::relative::DisabledLockTimeError(_) pub struct bitcoin::blockdata::opcodes::Opcode @@ -9764,6 +9760,8 @@ pub struct bitcoin::key::WPubkeyHash(_) pub struct bitcoin::locktime::relative::DisabledLockTimeError(_) pub struct bitcoin::merkle_tree::MerkleBlock pub struct bitcoin::merkle_tree::PartialMerkleTree +pub struct bitcoin::merkle_tree::TxMerkleNode(_) +pub struct bitcoin::merkle_tree::WitnessMerkleNode(_) pub struct bitcoin::opcodes::Opcode pub struct bitcoin::p2p::Address pub struct bitcoin::p2p::Magic(_) @@ -9953,18 +9951,10 @@ pub type bitcoin::blockdata::block::BlockHash::Bytes = ::Engine pub type bitcoin::blockdata::block::BlockHash::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::block::BlockHash::Output = >::Output -pub type bitcoin::blockdata::block::TxMerkleNode::Bytes = ::Bytes -pub type bitcoin::blockdata::block::TxMerkleNode::Engine = ::Engine -pub type bitcoin::blockdata::block::TxMerkleNode::Err = hex_conservative::error::HexToArrayError -pub type bitcoin::blockdata::block::TxMerkleNode::Output = >::Output pub type bitcoin::blockdata::block::WitnessCommitment::Bytes = ::Bytes pub type bitcoin::blockdata::block::WitnessCommitment::Engine = ::Engine pub type bitcoin::blockdata::block::WitnessCommitment::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::block::WitnessCommitment::Output = >::Output -pub type bitcoin::blockdata::block::WitnessMerkleNode::Bytes = ::Bytes -pub type bitcoin::blockdata::block::WitnessMerkleNode::Engine = ::Engine -pub type bitcoin::blockdata::block::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError -pub type bitcoin::blockdata::block::WitnessMerkleNode::Output = >::Output pub type bitcoin::blockdata::constants::ChainHash::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::constants::ChainHash::Error = core::array::TryFromSliceError pub type bitcoin::blockdata::constants::ChainHash::Output = <[u8] as core::ops::index::Index>::Output @@ -10018,6 +10008,14 @@ pub type bitcoin::key::UntweakedKeypair::TweakedKey = bitcoin::key::TweakedKeypa pub type bitcoin::key::UntweakedPublicKey = secp256k1::key::XOnlyPublicKey pub type bitcoin::key::UntweakedPublicKey::TweakedAux = (bitcoin::key::TweakedPublicKey, secp256k1::key::Parity) pub type bitcoin::key::UntweakedPublicKey::TweakedKey = bitcoin::key::TweakedPublicKey +pub type bitcoin::merkle_tree::TxMerkleNode::Bytes = ::Bytes +pub type bitcoin::merkle_tree::TxMerkleNode::Engine = ::Engine +pub type bitcoin::merkle_tree::TxMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::TxMerkleNode::Output = >::Output +pub type bitcoin::merkle_tree::WitnessMerkleNode::Bytes = ::Bytes +pub type bitcoin::merkle_tree::WitnessMerkleNode::Engine = ::Engine +pub type bitcoin::merkle_tree::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::WitnessMerkleNode::Output = >::Output pub type bitcoin::network::Network::Err = bitcoin::network::ParseNetworkError pub type bitcoin::network::Network::Error = bitcoin::network::UnknownChainHashError pub type bitcoin::network::Network::Error = bitcoin::p2p::UnknownMagicError diff --git a/api/bitcoin/no-features.txt b/api/bitcoin/no-features.txt index ec683c86e..3b0cecd81 100644 --- a/api/bitcoin/no-features.txt +++ b/api/bitcoin/no-features.txt @@ -136,10 +136,8 @@ impl bitcoin::bip32::Xpub impl bitcoin::blockdata::block::Block impl bitcoin::blockdata::block::BlockHash impl bitcoin::blockdata::block::Header -impl bitcoin::blockdata::block::TxMerkleNode impl bitcoin::blockdata::block::Version impl bitcoin::blockdata::block::WitnessCommitment -impl bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::blockdata::constants::ChainHash impl bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -188,11 +186,11 @@ impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec -impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec +impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec impl bitcoin::consensus::encode::Decodable for alloc::vec::Vec @@ -207,9 +205,7 @@ impl bitcoin::consensus::encode::Decodable for bitcoin::bip158::FilterHeader impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Block impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::BlockHash impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Header -impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::TxMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::Version -impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::script::ScriptBuf impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::transaction::OutPoint @@ -224,6 +220,8 @@ impl bitcoin::consensus::encode::Decodable for bitcoin::blockdata::witness::Witn impl bitcoin::consensus::encode::Decodable for bitcoin::consensus::encode::CheckedData impl bitcoin::consensus::encode::Decodable for bitcoin::consensus::encode::VarInt impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::consensus::encode::Decodable for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::consensus::encode::Decodable for bitcoin::p2p::Magic impl bitcoin::consensus::encode::Decodable for bitcoin::p2p::ServiceFlags impl bitcoin::consensus::encode::Decodable for bitcoin::pow::CompactTarget @@ -262,11 +260,11 @@ impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec -impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec +impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec impl bitcoin::consensus::encode::Encodable for alloc::vec::Vec @@ -281,9 +279,7 @@ impl bitcoin::consensus::encode::Encodable for bitcoin::bip158::FilterHeader impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Block impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::BlockHash impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Header -impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::TxMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::Version -impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::locktime::absolute::LockTime impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::script::Script impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::script::ScriptBuf @@ -299,6 +295,8 @@ impl bitcoin::consensus::encode::Encodable for bitcoin::blockdata::witness::Witn impl bitcoin::consensus::encode::Encodable for bitcoin::consensus::encode::CheckedData impl bitcoin::consensus::encode::Encodable for bitcoin::consensus::encode::VarInt impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::consensus::encode::Encodable for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::consensus::encode::Encodable for bitcoin::p2p::Magic impl bitcoin::consensus::encode::Encodable for bitcoin::p2p::ServiceFlags impl bitcoin::consensus::encode::Encodable for bitcoin::pow::CompactTarget @@ -328,6 +326,8 @@ impl bitcoin::key::TapTweak for bitcoin::key::UntweakedPublicKey impl bitcoin::key::TweakedKeypair impl bitcoin::key::TweakedPublicKey impl bitcoin::merkle_tree::PartialMerkleTree +impl bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::network::Network impl bitcoin::network::NetworkKind impl bitcoin::p2p::Magic @@ -371,13 +371,13 @@ impl bitcoin_hashes::Hash for bitcoin::bip158::FilterHash impl bitcoin_hashes::Hash for bitcoin::bip158::FilterHeader impl bitcoin_hashes::Hash for bitcoin::bip32::XKeyIdentifier impl bitcoin_hashes::Hash for bitcoin::blockdata::block::BlockHash -impl bitcoin_hashes::Hash for bitcoin::blockdata::block::TxMerkleNode impl bitcoin_hashes::Hash for bitcoin::blockdata::block::WitnessCommitment -impl bitcoin_hashes::Hash for bitcoin::blockdata::block::WitnessMerkleNode impl bitcoin_hashes::Hash for bitcoin::blockdata::script::ScriptHash impl bitcoin_hashes::Hash for bitcoin::blockdata::script::WScriptHash impl bitcoin_hashes::Hash for bitcoin::blockdata::transaction::Txid impl bitcoin_hashes::Hash for bitcoin::blockdata::transaction::Wtxid +impl bitcoin_hashes::Hash for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin_hashes::Hash for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin_hashes::Hash for bitcoin::taproot::TapLeafHash impl bitcoin_hashes::Hash for bitcoin::taproot::TapNodeHash impl bitcoin_hashes::Hash for bitcoin::taproot::TapTweakHash @@ -403,15 +403,15 @@ impl core::borrow::Borrow<[u8]> for bitcoin::bip32::ChainCode impl core::borrow::Borrow<[u8]> for bitcoin::bip32::Fingerprint impl core::borrow::Borrow<[u8]> for bitcoin::bip32::XKeyIdentifier impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::BlockHash -impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::TxMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::WitnessCommitment -impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::constants::ChainHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::script::ScriptHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::script::WScriptHash impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::transaction::Txid impl core::borrow::Borrow<[u8]> for bitcoin::blockdata::transaction::Wtxid impl core::borrow::Borrow<[u8]> for bitcoin::ecdsa::SerializedSignature +impl core::borrow::Borrow<[u8]> for bitcoin::merkle_tree::TxMerkleNode +impl core::borrow::Borrow<[u8]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::borrow::Borrow<[u8]> for bitcoin::p2p::Magic impl core::borrow::Borrow<[u8]> for bitcoin::taproot::TapLeafHash impl core::borrow::Borrow<[u8]> for bitcoin::taproot::TapNodeHash @@ -481,11 +481,9 @@ impl core::clone::Clone for bitcoin::blockdata::block::Bip34Error impl core::clone::Clone for bitcoin::blockdata::block::Block impl core::clone::Clone for bitcoin::blockdata::block::BlockHash impl core::clone::Clone for bitcoin::blockdata::block::Header -impl core::clone::Clone for bitcoin::blockdata::block::TxMerkleNode impl core::clone::Clone for bitcoin::blockdata::block::ValidationError impl core::clone::Clone for bitcoin::blockdata::block::Version impl core::clone::Clone for bitcoin::blockdata::block::WitnessCommitment -impl core::clone::Clone for bitcoin::blockdata::block::WitnessMerkleNode impl core::clone::Clone for bitcoin::blockdata::constants::ChainHash impl core::clone::Clone for bitcoin::blockdata::locktime::absolute::LockTime impl core::clone::Clone for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -542,6 +540,8 @@ impl core::clone::Clone for bitcoin::key::TweakedPublicKey impl core::clone::Clone for bitcoin::key::UncompressedPublicKeyError impl core::clone::Clone for bitcoin::merkle_tree::MerkleBlockError impl core::clone::Clone for bitcoin::merkle_tree::PartialMerkleTree +impl core::clone::Clone for bitcoin::merkle_tree::TxMerkleNode +impl core::clone::Clone for bitcoin::merkle_tree::WitnessMerkleNode impl core::clone::Clone for bitcoin::network::Network impl core::clone::Clone for bitcoin::network::NetworkKind impl core::clone::Clone for bitcoin::network::ParseNetworkError @@ -649,11 +649,9 @@ impl core::cmp::Eq for bitcoin::blockdata::block::Bip34Error impl core::cmp::Eq for bitcoin::blockdata::block::Block impl core::cmp::Eq for bitcoin::blockdata::block::BlockHash impl core::cmp::Eq for bitcoin::blockdata::block::Header -impl core::cmp::Eq for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::Eq for bitcoin::blockdata::block::ValidationError impl core::cmp::Eq for bitcoin::blockdata::block::Version impl core::cmp::Eq for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::Eq for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::Eq for bitcoin::blockdata::constants::ChainHash impl core::cmp::Eq for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::Eq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -710,6 +708,8 @@ impl core::cmp::Eq for bitcoin::key::TweakedPublicKey impl core::cmp::Eq for bitcoin::key::UncompressedPublicKeyError impl core::cmp::Eq for bitcoin::merkle_tree::MerkleBlockError impl core::cmp::Eq for bitcoin::merkle_tree::PartialMerkleTree +impl core::cmp::Eq for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::Eq for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::Eq for bitcoin::network::Network impl core::cmp::Eq for bitcoin::network::NetworkKind impl core::cmp::Eq for bitcoin::network::ParseNetworkError @@ -797,10 +797,8 @@ impl core::cmp::Ord for bitcoin::bip32::XKeyIdentifier impl core::cmp::Ord for bitcoin::bip32::Xpub impl core::cmp::Ord for bitcoin::blockdata::block::BlockHash impl core::cmp::Ord for bitcoin::blockdata::block::Header -impl core::cmp::Ord for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::Ord for bitcoin::blockdata::block::Version impl core::cmp::Ord for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::Ord for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::Ord for bitcoin::blockdata::constants::ChainHash impl core::cmp::Ord for bitcoin::blockdata::opcodes::ClassifyContext impl core::cmp::Ord for bitcoin::blockdata::script::PushBytes @@ -824,6 +822,8 @@ impl core::cmp::Ord for bitcoin::consensus::encode::VarInt impl core::cmp::Ord for bitcoin::key::SortKey impl core::cmp::Ord for bitcoin::key::TweakedKeypair impl core::cmp::Ord for bitcoin::key::TweakedPublicKey +impl core::cmp::Ord for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::Ord for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::Ord for bitcoin::network::Network impl core::cmp::Ord for bitcoin::network::NetworkKind impl core::cmp::Ord for bitcoin::p2p::Magic @@ -901,11 +901,9 @@ impl core::cmp::PartialEq for bitcoin::blockdata::block::Bip34Error impl core::cmp::PartialEq for bitcoin::blockdata::block::Block impl core::cmp::PartialEq for bitcoin::blockdata::block::BlockHash impl core::cmp::PartialEq for bitcoin::blockdata::block::Header -impl core::cmp::PartialEq for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::PartialEq for bitcoin::blockdata::block::ValidationError impl core::cmp::PartialEq for bitcoin::blockdata::block::Version impl core::cmp::PartialEq for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::PartialEq for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::PartialEq for bitcoin::blockdata::constants::ChainHash impl core::cmp::PartialEq for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::PartialEq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -962,6 +960,8 @@ impl core::cmp::PartialEq for bitcoin::key::TweakedPublicKey impl core::cmp::PartialEq for bitcoin::key::UncompressedPublicKeyError impl core::cmp::PartialEq for bitcoin::merkle_tree::MerkleBlockError impl core::cmp::PartialEq for bitcoin::merkle_tree::PartialMerkleTree +impl core::cmp::PartialEq for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::PartialEq for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::PartialEq for bitcoin::network::Network impl core::cmp::PartialEq for bitcoin::network::NetworkKind impl core::cmp::PartialEq for bitcoin::network::ParseNetworkError @@ -1053,10 +1053,8 @@ impl core::cmp::PartialOrd for bitcoin::bip32::XKeyIdentifier impl core::cmp::PartialOrd for bitcoin::bip32::Xpub impl core::cmp::PartialOrd for bitcoin::blockdata::block::BlockHash impl core::cmp::PartialOrd for bitcoin::blockdata::block::Header -impl core::cmp::PartialOrd for bitcoin::blockdata::block::TxMerkleNode impl core::cmp::PartialOrd for bitcoin::blockdata::block::Version impl core::cmp::PartialOrd for bitcoin::blockdata::block::WitnessCommitment -impl core::cmp::PartialOrd for bitcoin::blockdata::block::WitnessMerkleNode impl core::cmp::PartialOrd for bitcoin::blockdata::constants::ChainHash impl core::cmp::PartialOrd for bitcoin::blockdata::locktime::absolute::LockTime impl core::cmp::PartialOrd for bitcoin::blockdata::locktime::relative::LockTime @@ -1082,6 +1080,8 @@ impl core::cmp::PartialOrd for bitcoin::consensus::encode::VarInt impl core::cmp::PartialOrd for bitcoin::key::SortKey impl core::cmp::PartialOrd for bitcoin::key::TweakedKeypair impl core::cmp::PartialOrd for bitcoin::key::TweakedPublicKey +impl core::cmp::PartialOrd for bitcoin::merkle_tree::TxMerkleNode +impl core::cmp::PartialOrd for bitcoin::merkle_tree::WitnessMerkleNode impl core::cmp::PartialOrd for bitcoin::network::Network impl core::cmp::PartialOrd for bitcoin::network::NetworkKind impl core::cmp::PartialOrd for bitcoin::p2p::Magic @@ -1222,13 +1222,13 @@ impl core::convert::AsRef<[u8; 32]> for bitcoin::bip158::FilterHash impl core::convert::AsRef<[u8; 32]> for bitcoin::bip158::FilterHeader impl core::convert::AsRef<[u8; 32]> for bitcoin::bip32::ChainCode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::BlockHash -impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::TxMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::constants::ChainHash impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::script::WScriptHash impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::transaction::Txid impl core::convert::AsRef<[u8; 32]> for bitcoin::blockdata::transaction::Wtxid +impl core::convert::AsRef<[u8; 32]> for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::AsRef<[u8; 32]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapLeafHash impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapNodeHash impl core::convert::AsRef<[u8; 32]> for bitcoin::taproot::TapTweakHash @@ -1247,9 +1247,7 @@ impl core::convert::AsRef<[u8]> for bitcoin::bip32::ChainCode impl core::convert::AsRef<[u8]> for bitcoin::bip32::Fingerprint impl core::convert::AsRef<[u8]> for bitcoin::bip32::XKeyIdentifier impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::BlockHash -impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::TxMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::AsRef<[u8]> for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::blockdata::constants::ChainHash impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::PushBytes impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::Script @@ -1259,6 +1257,8 @@ impl core::convert::AsRef<[u8]> for bitcoin::blockdata::script::WScriptHash impl core::convert::AsRef<[u8]> for bitcoin::blockdata::transaction::Txid impl core::convert::AsRef<[u8]> for bitcoin::blockdata::transaction::Wtxid impl core::convert::AsRef<[u8]> for bitcoin::ecdsa::SerializedSignature +impl core::convert::AsRef<[u8]> for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::AsRef<[u8]> for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::AsRef<[u8]> for bitcoin::p2p::Magic impl core::convert::AsRef<[u8]> for bitcoin::taproot::TapLeafHash impl core::convert::AsRef<[u8]> for bitcoin::taproot::TapNodeHash @@ -1612,9 +1612,7 @@ impl core::convert::From for bitcoin::bip32::XKeyIdentifie impl core::convert::From for bitcoin::blockdata::block::BlockHash impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::blockdata::block::BlockHash -impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::blockdata::transaction::Sequence impl core::convert::From for alloc::vec::Vec impl core::convert::From for alloc::borrow::Cow<'_, bitcoin::blockdata::script::Script> @@ -1639,9 +1637,9 @@ impl core::convert::From for impl core::convert::From for u32 impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid -impl core::convert::From for bitcoin::blockdata::block::TxMerkleNode +impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin::blockdata::block::WitnessMerkleNode +impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::psbt::Error impl core::convert::From for bitcoin::key::ParsePublicKeyError @@ -1650,6 +1648,8 @@ impl core::convert::From for bitc impl core::convert::From for bitcoin::key::TweakedPublicKey impl core::convert::From for secp256k1::key::Keypair impl core::convert::From for secp256k1::key::XOnlyPublicKey +impl core::convert::From for bitcoin_hashes::sha256d::Hash +impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for &'static bitcoin::consensus::params::Params impl core::convert::From for bitcoin::address::KnownHrp impl core::convert::From for bitcoin::consensus::params::Params @@ -1685,11 +1685,11 @@ impl core::convert::From for bitcoin::SegwitV0Sig impl core::convert::From for bitcoin::bip158::FilterHash impl core::convert::From for bitcoin::bip158::FilterHeader impl core::convert::From for bitcoin::blockdata::block::BlockHash -impl core::convert::From for bitcoin::blockdata::block::TxMerkleNode impl core::convert::From for bitcoin::blockdata::block::WitnessCommitment -impl core::convert::From for bitcoin::blockdata::block::WitnessMerkleNode impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid +impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode +impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From> for bitcoin::TapSighash impl core::convert::From> for bitcoin::taproot::TapNodeHash impl core::convert::From> for bitcoin::taproot::TapLeafHash @@ -1845,11 +1845,9 @@ impl core::fmt::Debug for bitcoin::blockdata::block::Bip34Error impl core::fmt::Debug for bitcoin::blockdata::block::Block impl core::fmt::Debug for bitcoin::blockdata::block::BlockHash impl core::fmt::Debug for bitcoin::blockdata::block::Header -impl core::fmt::Debug for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::Debug for bitcoin::blockdata::block::ValidationError impl core::fmt::Debug for bitcoin::blockdata::block::Version impl core::fmt::Debug for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::Debug for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::Debug for bitcoin::blockdata::constants::ChainHash impl core::fmt::Debug for bitcoin::blockdata::locktime::absolute::LockTime impl core::fmt::Debug for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -1910,6 +1908,8 @@ impl core::fmt::Debug for bitcoin::key::TweakedPublicKey impl core::fmt::Debug for bitcoin::key::UncompressedPublicKeyError impl core::fmt::Debug for bitcoin::merkle_tree::MerkleBlockError impl core::fmt::Debug for bitcoin::merkle_tree::PartialMerkleTree +impl core::fmt::Debug for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::Debug for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::Debug for bitcoin::network::Network impl core::fmt::Debug for bitcoin::network::NetworkKind impl core::fmt::Debug for bitcoin::network::ParseNetworkError @@ -2005,10 +2005,8 @@ impl core::fmt::Display for bitcoin::bip32::Xpriv impl core::fmt::Display for bitcoin::bip32::Xpub impl core::fmt::Display for bitcoin::blockdata::block::Bip34Error impl core::fmt::Display for bitcoin::blockdata::block::BlockHash -impl core::fmt::Display for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::Display for bitcoin::blockdata::block::ValidationError impl core::fmt::Display for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::Display for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::Display for bitcoin::blockdata::constants::ChainHash impl core::fmt::Display for bitcoin::blockdata::locktime::absolute::LockTime impl core::fmt::Display for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2053,6 +2051,8 @@ impl core::fmt::Display for bitcoin::key::ParsePublicKeyError impl core::fmt::Display for bitcoin::key::TweakedPublicKey impl core::fmt::Display for bitcoin::key::UncompressedPublicKeyError impl core::fmt::Display for bitcoin::merkle_tree::MerkleBlockError +impl core::fmt::Display for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::Display for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::Display for bitcoin::network::Network impl core::fmt::Display for bitcoin::network::ParseNetworkError impl core::fmt::Display for bitcoin::network::UnknownChainHashError @@ -2102,9 +2102,7 @@ impl core::fmt::LowerHex for bitcoin::bip32::ChainCode impl core::fmt::LowerHex for bitcoin::bip32::Fingerprint impl core::fmt::LowerHex for bitcoin::bip32::XKeyIdentifier impl core::fmt::LowerHex for bitcoin::blockdata::block::BlockHash -impl core::fmt::LowerHex for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::LowerHex for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::LowerHex for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::LowerHex for bitcoin::blockdata::constants::ChainHash impl core::fmt::LowerHex for bitcoin::blockdata::script::Script impl core::fmt::LowerHex for bitcoin::blockdata::script::ScriptBuf @@ -2115,6 +2113,8 @@ impl core::fmt::LowerHex for bitcoin::blockdata::transaction::Txid impl core::fmt::LowerHex for bitcoin::blockdata::transaction::Wtxid impl core::fmt::LowerHex for bitcoin::ecdsa::SerializedSignature impl core::fmt::LowerHex for bitcoin::key::TweakedPublicKey +impl core::fmt::LowerHex for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::LowerHex for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::LowerHex for bitcoin::p2p::Magic impl core::fmt::LowerHex for bitcoin::p2p::ServiceFlags impl core::fmt::LowerHex for bitcoin::pow::CompactTarget @@ -2137,9 +2137,7 @@ impl core::fmt::UpperHex for bitcoin::bip32::ChainCode impl core::fmt::UpperHex for bitcoin::bip32::Fingerprint impl core::fmt::UpperHex for bitcoin::bip32::XKeyIdentifier impl core::fmt::UpperHex for bitcoin::blockdata::block::BlockHash -impl core::fmt::UpperHex for bitcoin::blockdata::block::TxMerkleNode impl core::fmt::UpperHex for bitcoin::blockdata::block::WitnessCommitment -impl core::fmt::UpperHex for bitcoin::blockdata::block::WitnessMerkleNode impl core::fmt::UpperHex for bitcoin::blockdata::constants::ChainHash impl core::fmt::UpperHex for bitcoin::blockdata::script::Script impl core::fmt::UpperHex for bitcoin::blockdata::script::ScriptBuf @@ -2149,6 +2147,8 @@ impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Sequence impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Txid impl core::fmt::UpperHex for bitcoin::blockdata::transaction::Wtxid impl core::fmt::UpperHex for bitcoin::ecdsa::SerializedSignature +impl core::fmt::UpperHex for bitcoin::merkle_tree::TxMerkleNode +impl core::fmt::UpperHex for bitcoin::merkle_tree::WitnessMerkleNode impl core::fmt::UpperHex for bitcoin::p2p::Magic impl core::fmt::UpperHex for bitcoin::p2p::ServiceFlags impl core::fmt::UpperHex for bitcoin::pow::CompactTarget @@ -2189,10 +2189,8 @@ impl core::hash::Hash for bitcoin::bip32::XKeyIdentifier impl core::hash::Hash for bitcoin::bip32::Xpub impl core::hash::Hash for bitcoin::blockdata::block::BlockHash impl core::hash::Hash for bitcoin::blockdata::block::Header -impl core::hash::Hash for bitcoin::blockdata::block::TxMerkleNode impl core::hash::Hash for bitcoin::blockdata::block::Version impl core::hash::Hash for bitcoin::blockdata::block::WitnessCommitment -impl core::hash::Hash for bitcoin::blockdata::block::WitnessMerkleNode impl core::hash::Hash for bitcoin::blockdata::constants::ChainHash impl core::hash::Hash for bitcoin::blockdata::locktime::absolute::LockTime impl core::hash::Hash for bitcoin::blockdata::locktime::relative::LockTime @@ -2219,6 +2217,8 @@ impl core::hash::Hash for bitcoin::ecdsa::Signature impl core::hash::Hash for bitcoin::key::SortKey impl core::hash::Hash for bitcoin::key::TweakedKeypair impl core::hash::Hash for bitcoin::key::TweakedPublicKey +impl core::hash::Hash for bitcoin::merkle_tree::TxMerkleNode +impl core::hash::Hash for bitcoin::merkle_tree::WitnessMerkleNode impl core::hash::Hash for bitcoin::network::Network impl core::hash::Hash for bitcoin::network::NetworkKind impl core::hash::Hash for bitcoin::p2p::Magic @@ -2291,10 +2291,8 @@ impl core::marker::Copy for bitcoin::bip32::Xpriv impl core::marker::Copy for bitcoin::bip32::Xpub impl core::marker::Copy for bitcoin::blockdata::block::BlockHash impl core::marker::Copy for bitcoin::blockdata::block::Header -impl core::marker::Copy for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Copy for bitcoin::blockdata::block::Version impl core::marker::Copy for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Copy for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Copy for bitcoin::blockdata::constants::ChainHash impl core::marker::Copy for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Copy for bitcoin::blockdata::locktime::relative::LockTime @@ -2317,6 +2315,8 @@ impl core::marker::Copy for bitcoin::ecdsa::Signature impl core::marker::Copy for bitcoin::key::SortKey impl core::marker::Copy for bitcoin::key::TweakedKeypair impl core::marker::Copy for bitcoin::key::TweakedPublicKey +impl core::marker::Copy for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Copy for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Copy for bitcoin::network::Network impl core::marker::Copy for bitcoin::network::NetworkKind impl core::marker::Copy for bitcoin::p2p::Magic @@ -2388,11 +2388,9 @@ impl core::marker::Freeze for bitcoin::blockdata::block::Bip34Error impl core::marker::Freeze for bitcoin::blockdata::block::Block impl core::marker::Freeze for bitcoin::blockdata::block::BlockHash impl core::marker::Freeze for bitcoin::blockdata::block::Header -impl core::marker::Freeze for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Freeze for bitcoin::blockdata::block::ValidationError impl core::marker::Freeze for bitcoin::blockdata::block::Version impl core::marker::Freeze for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Freeze for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Freeze for bitcoin::blockdata::constants::ChainHash impl core::marker::Freeze for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Freeze for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2453,6 +2451,8 @@ impl core::marker::Freeze for bitcoin::key::TweakedPublicKey impl core::marker::Freeze for bitcoin::key::UncompressedPublicKeyError impl core::marker::Freeze for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Freeze for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Freeze for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Freeze for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Freeze for bitcoin::network::Network impl core::marker::Freeze for bitcoin::network::NetworkKind impl core::marker::Freeze for bitcoin::network::ParseNetworkError @@ -2565,11 +2565,9 @@ impl core::marker::Send for bitcoin::blockdata::block::Bip34Error impl core::marker::Send for bitcoin::blockdata::block::Block impl core::marker::Send for bitcoin::blockdata::block::BlockHash impl core::marker::Send for bitcoin::blockdata::block::Header -impl core::marker::Send for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Send for bitcoin::blockdata::block::ValidationError impl core::marker::Send for bitcoin::blockdata::block::Version impl core::marker::Send for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Send for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Send for bitcoin::blockdata::constants::ChainHash impl core::marker::Send for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Send for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2630,6 +2628,8 @@ impl core::marker::Send for bitcoin::key::TweakedPublicKey impl core::marker::Send for bitcoin::key::UncompressedPublicKeyError impl core::marker::Send for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Send for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Send for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Send for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Send for bitcoin::network::Network impl core::marker::Send for bitcoin::network::NetworkKind impl core::marker::Send for bitcoin::network::ParseNetworkError @@ -2739,11 +2739,9 @@ impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Bip34Error impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Block impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::BlockHash impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Header -impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::TxMerkleNode impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::ValidationError impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::Version impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::StructuralPartialEq for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::StructuralPartialEq for bitcoin::blockdata::constants::ChainHash impl core::marker::StructuralPartialEq for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::StructuralPartialEq for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2799,6 +2797,8 @@ impl core::marker::StructuralPartialEq for bitcoin::key::TweakedPublicKey impl core::marker::StructuralPartialEq for bitcoin::key::UncompressedPublicKeyError impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::MerkleBlockError impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::StructuralPartialEq for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::StructuralPartialEq for bitcoin::network::Network impl core::marker::StructuralPartialEq for bitcoin::network::NetworkKind impl core::marker::StructuralPartialEq for bitcoin::network::ParseNetworkError @@ -2906,11 +2906,9 @@ impl core::marker::Sync for bitcoin::blockdata::block::Bip34Error impl core::marker::Sync for bitcoin::blockdata::block::Block impl core::marker::Sync for bitcoin::blockdata::block::BlockHash impl core::marker::Sync for bitcoin::blockdata::block::Header -impl core::marker::Sync for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Sync for bitcoin::blockdata::block::ValidationError impl core::marker::Sync for bitcoin::blockdata::block::Version impl core::marker::Sync for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Sync for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Sync for bitcoin::blockdata::constants::ChainHash impl core::marker::Sync for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Sync for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -2971,6 +2969,8 @@ impl core::marker::Sync for bitcoin::key::TweakedPublicKey impl core::marker::Sync for bitcoin::key::UncompressedPublicKeyError impl core::marker::Sync for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Sync for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Sync for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Sync for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Sync for bitcoin::network::Network impl core::marker::Sync for bitcoin::network::NetworkKind impl core::marker::Sync for bitcoin::network::ParseNetworkError @@ -3083,11 +3083,9 @@ impl core::marker::Unpin for bitcoin::blockdata::block::Bip34Error impl core::marker::Unpin for bitcoin::blockdata::block::Block impl core::marker::Unpin for bitcoin::blockdata::block::BlockHash impl core::marker::Unpin for bitcoin::blockdata::block::Header -impl core::marker::Unpin for bitcoin::blockdata::block::TxMerkleNode impl core::marker::Unpin for bitcoin::blockdata::block::ValidationError impl core::marker::Unpin for bitcoin::blockdata::block::Version impl core::marker::Unpin for bitcoin::blockdata::block::WitnessCommitment -impl core::marker::Unpin for bitcoin::blockdata::block::WitnessMerkleNode impl core::marker::Unpin for bitcoin::blockdata::constants::ChainHash impl core::marker::Unpin for bitcoin::blockdata::locktime::absolute::LockTime impl core::marker::Unpin for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3148,6 +3146,8 @@ impl core::marker::Unpin for bitcoin::key::TweakedPublicKey impl core::marker::Unpin for bitcoin::key::UncompressedPublicKeyError impl core::marker::Unpin for bitcoin::merkle_tree::MerkleBlockError impl core::marker::Unpin for bitcoin::merkle_tree::PartialMerkleTree +impl core::marker::Unpin for bitcoin::merkle_tree::TxMerkleNode +impl core::marker::Unpin for bitcoin::merkle_tree::WitnessMerkleNode impl core::marker::Unpin for bitcoin::network::Network impl core::marker::Unpin for bitcoin::network::NetworkKind impl core::marker::Unpin for bitcoin::network::ParseNetworkError @@ -3291,11 +3291,9 @@ impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Bip3 impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Block impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::BlockHash impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Header -impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::TxMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::ValidationError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::Version impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::WitnessCommitment -impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::block::WitnessMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::constants::ChainHash impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::locktime::absolute::LockTime impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3354,6 +3352,8 @@ impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::key::TweakedPublicKey impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::key::UncompressedPublicKeyError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::MerkleBlockError impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::PartialMerkleTree +impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::TxMerkleNode +impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::merkle_tree::WitnessMerkleNode impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::Network impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::NetworkKind impl core::panic::unwind_safe::RefUnwindSafe for bitcoin::network::ParseNetworkError @@ -3464,11 +3464,9 @@ impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Bip34Er impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Block impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::BlockHash impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Header -impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::TxMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::ValidationError impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::Version impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::WitnessCommitment -impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::block::WitnessMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::constants::ChainHash impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::locktime::absolute::LockTime impl core::panic::unwind_safe::UnwindSafe for bitcoin::blockdata::locktime::relative::DisabledLockTimeError @@ -3527,6 +3525,8 @@ impl core::panic::unwind_safe::UnwindSafe for bitcoin::key::TweakedPublicKey impl core::panic::unwind_safe::UnwindSafe for bitcoin::key::UncompressedPublicKeyError impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::MerkleBlockError impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::PartialMerkleTree +impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::TxMerkleNode +impl core::panic::unwind_safe::UnwindSafe for bitcoin::merkle_tree::WitnessMerkleNode impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::Network impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::NetworkKind impl core::panic::unwind_safe::UnwindSafe for bitcoin::network::ParseNetworkError @@ -3610,9 +3610,7 @@ impl core::str::traits::FromStr for bitcoin::bip32::XKeyIdentifier impl core::str::traits::FromStr for bitcoin::bip32::Xpriv impl core::str::traits::FromStr for bitcoin::bip32::Xpub impl core::str::traits::FromStr for bitcoin::blockdata::block::BlockHash -impl core::str::traits::FromStr for bitcoin::blockdata::block::TxMerkleNode impl core::str::traits::FromStr for bitcoin::blockdata::block::WitnessCommitment -impl core::str::traits::FromStr for bitcoin::blockdata::block::WitnessMerkleNode impl core::str::traits::FromStr for bitcoin::blockdata::constants::ChainHash impl core::str::traits::FromStr for bitcoin::blockdata::locktime::absolute::LockTime impl core::str::traits::FromStr for bitcoin::blockdata::script::ScriptHash @@ -3623,6 +3621,8 @@ impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Sequence impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Txid impl core::str::traits::FromStr for bitcoin::blockdata::transaction::Wtxid impl core::str::traits::FromStr for bitcoin::ecdsa::Signature +impl core::str::traits::FromStr for bitcoin::merkle_tree::TxMerkleNode +impl core::str::traits::FromStr for bitcoin::merkle_tree::WitnessMerkleNode impl core::str::traits::FromStr for bitcoin::network::Network impl core::str::traits::FromStr for bitcoin::p2p::Magic impl core::str::traits::FromStr for bitcoin::psbt::PsbtSighashType @@ -4085,13 +4085,13 @@ impl> core::ops::index::Index for bit impl> core::ops::index::Index for bitcoin::bip158::FilterHeader impl> core::ops::index::Index for bitcoin::bip32::XKeyIdentifier impl> core::ops::index::Index for bitcoin::blockdata::block::BlockHash -impl> core::ops::index::Index for bitcoin::blockdata::block::TxMerkleNode impl> core::ops::index::Index for bitcoin::blockdata::block::WitnessCommitment -impl> core::ops::index::Index for bitcoin::blockdata::block::WitnessMerkleNode impl> core::ops::index::Index for bitcoin::blockdata::script::ScriptHash impl> core::ops::index::Index for bitcoin::blockdata::script::WScriptHash impl> core::ops::index::Index for bitcoin::blockdata::transaction::Txid impl> core::ops::index::Index for bitcoin::blockdata::transaction::Wtxid +impl> core::ops::index::Index for bitcoin::merkle_tree::TxMerkleNode +impl> core::ops::index::Index for bitcoin::merkle_tree::WitnessMerkleNode impl> core::ops::index::Index for bitcoin::taproot::TapLeafHash impl> core::ops::index::Index for bitcoin::taproot::TapNodeHash impl> core::ops::index::Index for bitcoin::taproot::TapTweakHash @@ -4322,7 +4322,7 @@ pub bitcoin::block::Bip34Error::Unsupported pub bitcoin::block::Block::header: bitcoin::blockdata::block::Header pub bitcoin::block::Block::txdata: alloc::vec::Vec pub bitcoin::block::Header::bits: bitcoin::pow::CompactTarget -pub bitcoin::block::Header::merkle_root: bitcoin::blockdata::block::TxMerkleNode +pub bitcoin::block::Header::merkle_root: bitcoin::merkle_tree::TxMerkleNode pub bitcoin::block::Header::nonce: u32 pub bitcoin::block::Header::prev_blockhash: bitcoin::blockdata::block::BlockHash pub bitcoin::block::Header::time: u32 @@ -4336,7 +4336,7 @@ pub bitcoin::blockdata::block::Bip34Error::Unsupported pub bitcoin::blockdata::block::Block::header: bitcoin::blockdata::block::Header pub bitcoin::blockdata::block::Block::txdata: alloc::vec::Vec pub bitcoin::blockdata::block::Header::bits: bitcoin::pow::CompactTarget -pub bitcoin::blockdata::block::Header::merkle_root: bitcoin::blockdata::block::TxMerkleNode +pub bitcoin::blockdata::block::Header::merkle_root: bitcoin::merkle_tree::TxMerkleNode pub bitcoin::blockdata::block::Header::nonce: u32 pub bitcoin::blockdata::block::Header::prev_blockhash: bitcoin::blockdata::block::BlockHash pub bitcoin::blockdata::block::Header::time: u32 @@ -4810,15 +4810,11 @@ pub const bitcoin::bip32::XKeyIdentifier::LEN: usize pub const bitcoin::blockdata::block::BlockHash::DISPLAY_BACKWARD: bool pub const bitcoin::blockdata::block::BlockHash::LEN: usize pub const bitcoin::blockdata::block::Header::SIZE: usize -pub const bitcoin::blockdata::block::TxMerkleNode::DISPLAY_BACKWARD: bool -pub const bitcoin::blockdata::block::TxMerkleNode::LEN: usize pub const bitcoin::blockdata::block::Version::NO_SOFT_FORK_SIGNALLING: Self pub const bitcoin::blockdata::block::Version::ONE: Self pub const bitcoin::blockdata::block::Version::TWO: Self pub const bitcoin::blockdata::block::WitnessCommitment::DISPLAY_BACKWARD: bool pub const bitcoin::blockdata::block::WitnessCommitment::LEN: usize -pub const bitcoin::blockdata::block::WitnessMerkleNode::DISPLAY_BACKWARD: bool -pub const bitcoin::blockdata::block::WitnessMerkleNode::LEN: usize pub const bitcoin::blockdata::constants::COINBASE_MATURITY: u32 = 100u32 pub const bitcoin::blockdata::constants::ChainHash::BITCOIN: Self pub const bitcoin::blockdata::constants::ChainHash::REGTEST: Self @@ -5142,6 +5138,10 @@ pub const bitcoin::constants::SCRIPT_ADDRESS_PREFIX_TEST: u8 = 196u8 pub const bitcoin::constants::SUBSIDY_HALVING_INTERVAL: u32 = 210_000u32 pub const bitcoin::constants::TARGET_BLOCK_SPACING: u32 = 600u32 pub const bitcoin::constants::WITNESS_SCALE_FACTOR: units::weight::WITNESS_SCALE_FACTOR +pub const bitcoin::merkle_tree::TxMerkleNode::DISPLAY_BACKWARD: bool +pub const bitcoin::merkle_tree::TxMerkleNode::LEN: usize +pub const bitcoin::merkle_tree::WitnessMerkleNode::DISPLAY_BACKWARD: bool +pub const bitcoin::merkle_tree::WitnessMerkleNode::LEN: usize pub const bitcoin::opcodes::all::OP_0NOTEQUAL: _ pub const bitcoin::opcodes::all::OP_1ADD: _ pub const bitcoin::opcodes::all::OP_1SUB: _ @@ -5908,8 +5908,6 @@ pub fn alloc::vec::Vec::consensus_decode_f pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result -pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result @@ -5918,6 +5916,8 @@ pub fn alloc::vec::Vec::consensus_decode pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result +pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn alloc::vec::Vec::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn alloc::vec::Vec::from(branch: bitcoin::taproot::merkle_branch::TaprootMerkleBranch) -> Self @@ -6617,8 +6617,8 @@ pub fn bitcoin::blockdata::block::Block::check_merkle_root(&self) -> bool pub fn bitcoin::blockdata::block::Block::check_witness_commitment(&self) -> bool pub fn bitcoin::blockdata::block::Block::clone(&self) -> bitcoin::blockdata::block::Block pub fn bitcoin::blockdata::block::Block::coinbase(&self) -> core::option::Option<&bitcoin::blockdata::transaction::Transaction> -pub fn bitcoin::blockdata::block::Block::compute_merkle_root(&self) -> core::option::Option -pub fn bitcoin::blockdata::block::Block::compute_witness_commitment(witness_root: &bitcoin::blockdata::block::WitnessMerkleNode, witness_reserved_value: &[u8]) -> bitcoin::blockdata::block::WitnessCommitment +pub fn bitcoin::blockdata::block::Block::compute_merkle_root(&self) -> core::option::Option +pub fn bitcoin::blockdata::block::Block::compute_witness_commitment(witness_root: &bitcoin::merkle_tree::WitnessMerkleNode, witness_reserved_value: &[u8]) -> bitcoin::blockdata::block::WitnessCommitment pub fn bitcoin::blockdata::block::Block::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::blockdata::block::Block::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn bitcoin::blockdata::block::Block::consensus_encode(&self, r: &mut R) -> core::result::Result @@ -6626,7 +6626,7 @@ pub fn bitcoin::blockdata::block::Block::eq(&self, other: &bitcoin::blockdata::b pub fn bitcoin::blockdata::block::Block::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::blockdata::block::Block::total_size(&self) -> usize pub fn bitcoin::blockdata::block::Block::weight(&self) -> bitcoin_units::weight::Weight -pub fn bitcoin::blockdata::block::Block::witness_root(&self) -> core::option::Option +pub fn bitcoin::blockdata::block::Block::witness_root(&self) -> core::option::Option pub fn bitcoin::blockdata::block::BlockHash::all_zeros() -> Self pub fn bitcoin::blockdata::block::BlockHash::as_byte_array(&self) -> &::Bytes pub fn bitcoin::blockdata::block::BlockHash::as_byte_array(&self) -> &Self::Bytes @@ -6676,37 +6676,6 @@ pub fn bitcoin::blockdata::block::Header::partial_cmp(&self, other: &bitcoin::bl pub fn bitcoin::blockdata::block::Header::target(&self) -> bitcoin::pow::Target pub fn bitcoin::blockdata::block::Header::validate_pow(&self, required_target: bitcoin::pow::Target) -> core::result::Result pub fn bitcoin::blockdata::block::Header::work(&self) -> bitcoin::pow::Work -pub fn bitcoin::blockdata::block::TxMerkleNode::all_zeros() -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::as_byte_array(&self) -> &::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::as_byte_array(&self) -> &Self::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::TxMerkleNode::as_ref(&self) -> &[u8; 32] -pub fn bitcoin::blockdata::block::TxMerkleNode::as_ref(&self) -> &[u8] -pub fn bitcoin::blockdata::block::TxMerkleNode::borrow(&self) -> &[u8] -pub fn bitcoin::blockdata::block::TxMerkleNode::clone(&self) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::cmp(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> core::cmp::Ordering -pub fn bitcoin::blockdata::block::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::engine() -> ::Engine -pub fn bitcoin::blockdata::block::TxMerkleNode::eq(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> bool -pub fn bitcoin::blockdata::block::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_engine(e: ::Engine) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::TxMerkleNode -pub fn bitcoin::blockdata::block::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::from_str(s: &str) -> core::result::Result -pub fn bitcoin::blockdata::block::TxMerkleNode::hash(data: &[u8]) -> Self -pub fn bitcoin::blockdata::block::TxMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) -pub fn bitcoin::blockdata::block::TxMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator -pub fn bitcoin::blockdata::block::TxMerkleNode::index(&self, index: I) -> &Self::Output -pub fn bitcoin::blockdata::block::TxMerkleNode::partial_cmp(&self, other: &bitcoin::blockdata::block::TxMerkleNode) -> core::option::Option -pub fn bitcoin::blockdata::block::TxMerkleNode::to_byte_array(self) -> ::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::to_byte_array(self) -> Self::Bytes -pub fn bitcoin::blockdata::block::TxMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::blockdata::block::ValidationError::clone(&self) -> bitcoin::blockdata::block::ValidationError pub fn bitcoin::blockdata::block::ValidationError::eq(&self, other: &bitcoin::blockdata::block::ValidationError) -> bool pub fn bitcoin::blockdata::block::ValidationError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -6750,37 +6719,6 @@ pub fn bitcoin::blockdata::block::WitnessCommitment::partial_cmp(&self, other: & pub fn bitcoin::blockdata::block::WitnessCommitment::to_byte_array(self) -> ::Bytes pub fn bitcoin::blockdata::block::WitnessCommitment::to_byte_array(self) -> Self::Bytes pub fn bitcoin::blockdata::block::WitnessCommitment::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::WitnessMerkleNode::all_zeros() -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_byte_array(&self) -> &::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_byte_array(&self) -> &Self::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_ref(&self) -> &[u8; 32] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::as_ref(&self) -> &[u8] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::borrow(&self) -> &[u8] -pub fn bitcoin::blockdata::block::WitnessMerkleNode::clone(&self) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::cmp(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> core::cmp::Ordering -pub fn bitcoin::blockdata::block::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::engine() -> ::Engine -pub fn bitcoin::blockdata::block::WitnessMerkleNode::eq(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> bool -pub fn bitcoin::blockdata::block::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_engine(e: ::Engine) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::blockdata::block::WitnessMerkleNode -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::from_str(s: &str) -> core::result::Result -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash(data: &[u8]) -> Self -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) -pub fn bitcoin::blockdata::block::WitnessMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator -pub fn bitcoin::blockdata::block::WitnessMerkleNode::index(&self, index: I) -> &Self::Output -pub fn bitcoin::blockdata::block::WitnessMerkleNode::partial_cmp(&self, other: &bitcoin::blockdata::block::WitnessMerkleNode) -> core::option::Option -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_byte_array(self) -> ::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes -pub fn bitcoin::blockdata::block::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::blockdata::constants::ChainHash::as_byte_array(&self) -> &[u8; 32] pub fn bitcoin::blockdata::constants::ChainHash::as_bytes(&self) -> &[u8] pub fn bitcoin::blockdata::constants::ChainHash::as_mut(&mut self) -> &mut [u8; 32] @@ -7783,11 +7721,73 @@ pub fn bitcoin::merkle_tree::PartialMerkleTree::clone(&self) -> bitcoin::merkle_ pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::eq(&self, other: &bitcoin::merkle_tree::PartialMerkleTree) -> bool -pub fn bitcoin::merkle_tree::PartialMerkleTree::extract_matches(&self, matches: &mut alloc::vec::Vec, indexes: &mut alloc::vec::Vec) -> core::result::Result +pub fn bitcoin::merkle_tree::PartialMerkleTree::extract_matches(&self, matches: &mut alloc::vec::Vec, indexes: &mut alloc::vec::Vec) -> core::result::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::PartialMerkleTree::from_txids(txids: &[bitcoin::blockdata::transaction::Txid], matches: &[bool]) -> Self -pub fn bitcoin::merkle_tree::PartialMerkleTree::hashes(&self) -> &alloc::vec::Vec +pub fn bitcoin::merkle_tree::PartialMerkleTree::hashes(&self) -> &alloc::vec::Vec pub fn bitcoin::merkle_tree::PartialMerkleTree::num_transactions(&self) -> u32 +pub fn bitcoin::merkle_tree::TxMerkleNode::all_zeros() -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::as_byte_array(&self) -> &::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::as_byte_array(&self) -> &Self::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8; 32] +pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8] +pub fn bitcoin::merkle_tree::TxMerkleNode::borrow(&self) -> &[u8] +pub fn bitcoin::merkle_tree::TxMerkleNode::clone(&self) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::engine() -> ::Engine +pub fn bitcoin::merkle_tree::TxMerkleNode::eq(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> bool +pub fn bitcoin::merkle_tree::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::from_str(s: &str) -> core::result::Result +pub fn bitcoin::merkle_tree::TxMerkleNode::hash(data: &[u8]) -> Self +pub fn bitcoin::merkle_tree::TxMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn bitcoin::merkle_tree::TxMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator +pub fn bitcoin::merkle_tree::TxMerkleNode::index(&self, index: I) -> &Self::Output +pub fn bitcoin::merkle_tree::TxMerkleNode::partial_cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::option::Option +pub fn bitcoin::merkle_tree::TxMerkleNode::to_byte_array(self) -> ::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::to_byte_array(self) -> Self::Bytes +pub fn bitcoin::merkle_tree::TxMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::WitnessMerkleNode::all_zeros() -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_byte_array(&self) -> &::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_byte_array(&self) -> &Self::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_raw_hash(&self) -> &bitcoin_hashes::sha256d::Hash +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8; 32] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::borrow(&self) -> &[u8] +pub fn bitcoin::merkle_tree::WitnessMerkleNode::clone(&self) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::engine() -> ::Engine +pub fn bitcoin::merkle_tree::WitnessMerkleNode::eq(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> bool +pub fn bitcoin::merkle_tree::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_str(s: &str) -> core::result::Result +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash(data: &[u8]) -> Self +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +pub fn bitcoin::merkle_tree::WitnessMerkleNode::hash_byte_chunks(byte_slices: I) -> Self where B: core::convert::AsRef<[u8]>, I: core::iter::traits::collect::IntoIterator +pub fn bitcoin::merkle_tree::WitnessMerkleNode::index(&self, index: I) -> &Self::Output +pub fn bitcoin::merkle_tree::WitnessMerkleNode::partial_cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::option::Option +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> ::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes +pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write, I: core::iter::traits::iterator::Iterator pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params @@ -8602,11 +8602,11 @@ pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::SegwitV0Sighash) - pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::bip158::FilterHash) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::bip158::FilterHeader) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::BlockHash) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::TxMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::WitnessCommitment) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::block::WitnessMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::transaction::Txid) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::blockdata::transaction::Wtxid) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::merkle_tree::TxMerkleNode) -> bitcoin_hashes::sha256d::Hash +pub fn bitcoin_hashes::sha256d::Hash::from(hashtype: bitcoin::merkle_tree::WitnessMerkleNode) -> bitcoin_hashes::sha256d::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::TapSighash) -> bitcoin_hashes::sha256t::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::taproot::TapNodeHash) -> bitcoin_hashes::sha256t::Hash pub fn bitcoin_hashes::sha256t::Hash::from(hashtype: bitcoin::taproot::TapLeafHash) -> bitcoin_hashes::sha256t::Hash @@ -8798,17 +8798,13 @@ pub struct bitcoin::bip32::Xpub pub struct bitcoin::block::Block pub struct bitcoin::block::BlockHash(_) pub struct bitcoin::block::Header -pub struct bitcoin::block::TxMerkleNode(_) pub struct bitcoin::block::Version(_) pub struct bitcoin::block::WitnessCommitment(_) -pub struct bitcoin::block::WitnessMerkleNode(_) pub struct bitcoin::blockdata::block::Block pub struct bitcoin::blockdata::block::BlockHash(_) pub struct bitcoin::blockdata::block::Header -pub struct bitcoin::blockdata::block::TxMerkleNode(_) pub struct bitcoin::blockdata::block::Version(_) pub struct bitcoin::blockdata::block::WitnessCommitment(_) -pub struct bitcoin::blockdata::block::WitnessMerkleNode(_) pub struct bitcoin::blockdata::constants::ChainHash(_) pub struct bitcoin::blockdata::locktime::relative::DisabledLockTimeError(_) pub struct bitcoin::blockdata::opcodes::Opcode @@ -8864,6 +8860,8 @@ pub struct bitcoin::key::WPubkeyHash(_) pub struct bitcoin::locktime::relative::DisabledLockTimeError(_) pub struct bitcoin::merkle_tree::MerkleBlock pub struct bitcoin::merkle_tree::PartialMerkleTree +pub struct bitcoin::merkle_tree::TxMerkleNode(_) +pub struct bitcoin::merkle_tree::WitnessMerkleNode(_) pub struct bitcoin::opcodes::Opcode pub struct bitcoin::p2p::Magic(_) pub struct bitcoin::p2p::ServiceFlags(_) @@ -9031,18 +9029,10 @@ pub type bitcoin::blockdata::block::BlockHash::Bytes = ::Engine pub type bitcoin::blockdata::block::BlockHash::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::block::BlockHash::Output = >::Output -pub type bitcoin::blockdata::block::TxMerkleNode::Bytes = ::Bytes -pub type bitcoin::blockdata::block::TxMerkleNode::Engine = ::Engine -pub type bitcoin::blockdata::block::TxMerkleNode::Err = hex_conservative::error::HexToArrayError -pub type bitcoin::blockdata::block::TxMerkleNode::Output = >::Output pub type bitcoin::blockdata::block::WitnessCommitment::Bytes = ::Bytes pub type bitcoin::blockdata::block::WitnessCommitment::Engine = ::Engine pub type bitcoin::blockdata::block::WitnessCommitment::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::block::WitnessCommitment::Output = >::Output -pub type bitcoin::blockdata::block::WitnessMerkleNode::Bytes = ::Bytes -pub type bitcoin::blockdata::block::WitnessMerkleNode::Engine = ::Engine -pub type bitcoin::blockdata::block::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError -pub type bitcoin::blockdata::block::WitnessMerkleNode::Output = >::Output pub type bitcoin::blockdata::constants::ChainHash::Err = hex_conservative::error::HexToArrayError pub type bitcoin::blockdata::constants::ChainHash::Error = core::array::TryFromSliceError pub type bitcoin::blockdata::constants::ChainHash::Output = <[u8] as core::ops::index::Index>::Output @@ -9094,6 +9084,14 @@ pub type bitcoin::key::UntweakedKeypair::TweakedKey = bitcoin::key::TweakedKeypa pub type bitcoin::key::UntweakedPublicKey = secp256k1::key::XOnlyPublicKey pub type bitcoin::key::UntweakedPublicKey::TweakedAux = (bitcoin::key::TweakedPublicKey, secp256k1::key::Parity) pub type bitcoin::key::UntweakedPublicKey::TweakedKey = bitcoin::key::TweakedPublicKey +pub type bitcoin::merkle_tree::TxMerkleNode::Bytes = ::Bytes +pub type bitcoin::merkle_tree::TxMerkleNode::Engine = ::Engine +pub type bitcoin::merkle_tree::TxMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::TxMerkleNode::Output = >::Output +pub type bitcoin::merkle_tree::WitnessMerkleNode::Bytes = ::Bytes +pub type bitcoin::merkle_tree::WitnessMerkleNode::Engine = ::Engine +pub type bitcoin::merkle_tree::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::WitnessMerkleNode::Output = >::Output pub type bitcoin::network::Network::Err = bitcoin::network::ParseNetworkError pub type bitcoin::network::Network::Error = bitcoin::network::UnknownChainHashError pub type bitcoin::network::Network::Error = bitcoin::p2p::UnknownMagicError From 8d5cb014ce9fdb32ca7388ec6b7f06c995449dc5 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Thu, 13 Jun 2024 14:34:06 +0000 Subject: [PATCH 3/7] merkle_tree: introduce MerkleNode trait to better-type merkle tree calculation --- bitcoin/src/blockdata/block.rs | 10 ++-- bitcoin/src/merkle_tree/block.rs | 4 +- bitcoin/src/merkle_tree/mod.rs | 88 ++++++++++++++++++-------------- 3 files changed, 57 insertions(+), 45 deletions(-) diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs index 5f36ce0bb..d3337c86f 100644 --- a/bitcoin/src/blockdata/block.rs +++ b/bitcoin/src/blockdata/block.rs @@ -280,8 +280,8 @@ impl Block { /// Computes the transaction merkle root. pub fn compute_merkle_root(&self) -> Option { - let hashes = self.txdata.iter().map(|obj| obj.compute_txid().to_raw_hash()); - merkle_tree::calculate_root(hashes).map(|h| h.into()) + let hashes = self.txdata.iter().map(|obj| obj.compute_txid()); + merkle_tree::calculate_root(hashes) } /// Computes the witness commitment for the block's transaction list. @@ -300,12 +300,12 @@ impl Block { let hashes = self.txdata.iter().enumerate().map(|(i, t)| { if i == 0 { // Replace the first hash with zeroes. - Wtxid::all_zeros().to_raw_hash() + Wtxid::all_zeros() } else { - t.compute_wtxid().to_raw_hash() + t.compute_wtxid() } }); - merkle_tree::calculate_root(hashes).map(|h| h.into()) + merkle_tree::calculate_root(hashes) } /// Returns the weight of the block. diff --git a/bitcoin/src/merkle_tree/block.rs b/bitcoin/src/merkle_tree/block.rs index 8f090edef..288f26092 100644 --- a/bitcoin/src/merkle_tree/block.rs +++ b/bitcoin/src/merkle_tree/block.rs @@ -563,9 +563,9 @@ mod tests { .collect::>(); // Calculate the merkle root and height - let hashes = tx_ids.iter().map(|t| t.to_raw_hash()); + let hashes = tx_ids.iter().copied(); let merkle_root_1: TxMerkleNode = - merkle_tree::calculate_root(hashes).expect("hashes is not empty").into(); + merkle_tree::calculate_root(hashes).expect("hashes is not empty"); let mut height = 1; let mut ntx = tx_count; while ntx > 1 { diff --git a/bitcoin/src/merkle_tree/mod.rs b/bitcoin/src/merkle_tree/mod.rs index 4ef118d6d..8b5c7da1a 100644 --- a/bitcoin/src/merkle_tree/mod.rs +++ b/bitcoin/src/merkle_tree/mod.rs @@ -6,11 +6,12 @@ //! //! ``` //! # use bitcoin::{merkle_tree, Txid}; +//! # use bitcoin::merkle_tree::TxMerkleNode; //! # use bitcoin::hashes::Hash; //! # let tx1 = Txid::all_zeros(); // Dummy hash values. //! # let tx2 = Txid::all_zeros(); //! let tx_hashes = vec![tx1, tx2]; // All the hashes we wish to merkelize. -//! let root = merkle_tree::calculate_root(tx_hashes.into_iter()); +//! let root: Option = merkle_tree::calculate_root(tx_hashes.into_iter()); //! ``` mod block; @@ -18,10 +19,8 @@ mod block; use core::cmp::min; use core::iter; -use hashes::{sha256d, Hash}; -use io::Write; +use hashes::{sha256d, HashEngine as _}; -use crate::consensus::encode::Encodable; use crate::internal_macros::impl_hashencode; use crate::prelude::*; use crate::{Txid, Wtxid}; @@ -39,12 +38,42 @@ hashes::hash_newtype! { impl_hashencode!(TxMerkleNode); impl_hashencode!(WitnessMerkleNode); -impl From for TxMerkleNode { - fn from(txid: Txid) -> Self { Self::from_byte_array(txid.to_byte_array()) } +/// A node in a Merkle tree of transactions or witness data within a block. +pub trait MerkleNode: Copy { + /// The hash (TXID or WTXID) of a transaciton in the tree. + type Leaf; + + /// Convert a hash to a leaf node of the tree. + fn from_leaf(leaf: Self::Leaf) -> Self; + /// Combine two nodes to get a single node. The final node of a tree is called the "root". + fn combine(&self, other: &Self) -> Self; } -impl From for WitnessMerkleNode { - fn from(wtxid: Wtxid) -> Self { Self::from_byte_array(wtxid.to_byte_array()) } +// These two impl blocks are identical. FIXME once we have nailed down +// our hash traits, it should be possible to put bounds on `MerkleNode` +// and `MerkleNode::Leaf` which are sufficient to turn both methods into +// provided methods in the trait definition. +impl MerkleNode for TxMerkleNode { + type Leaf = Txid; + fn from_leaf(leaf: Self::Leaf) -> Self { Self::from_byte_array(leaf.to_byte_array()) } + + fn combine(&self, other: &Self) -> Self { + let mut encoder = sha256d::Hash::engine(); + encoder.input(self.as_byte_array()); + encoder.input(other.as_byte_array()); + Self(sha256d::Hash::from_engine(encoder)) + } +} +impl MerkleNode for WitnessMerkleNode { + type Leaf = Wtxid; + fn from_leaf(leaf: Self::Leaf) -> Self { Self::from_byte_array(leaf.to_byte_array()) } + + fn combine(&self, other: &Self) -> Self { + let mut encoder = sha256d::Hash::engine(); + encoder.input(self.as_byte_array()); + encoder.input(other.as_byte_array()); + Self(sha256d::Hash::from_engine(encoder)) + } } /// Calculates the merkle root of a list of *hashes*, inline (in place) in `hashes`. @@ -58,11 +87,7 @@ impl From for WitnessMerkleNode { /// - `None` if `hashes` is empty. The merkle root of an empty tree of hashes is undefined. /// - `Some(hash)` if `hashes` contains one element. A single hash is by definition the merkle root. /// - `Some(merkle_root)` if length of `hashes` is greater than one. -pub fn calculate_root_inline(hashes: &mut [T]) -> Option -where - T: Hash + Encodable, - ::Engine: Write, -{ +pub fn calculate_root_inline(hashes: &mut [T]) -> Option { match hashes.len() { 0 => None, 1 => Some(hashes[0]), @@ -79,14 +104,13 @@ where /// - `Some(merkle_root)` if length of `hashes` is greater than one. pub fn calculate_root(mut hashes: I) -> Option where - T: Hash + Encodable, - ::Engine: Write, - I: Iterator, + T: MerkleNode, + I: Iterator, { - let first = hashes.next()?; + let first: T::Leaf = hashes.next()?; let second = match hashes.next() { Some(second) => second, - None => return Some(first), + None => return Some(T::from_leaf(first)), }; let mut hashes = iter::once(first).chain(iter::once(second)).chain(hashes); @@ -96,24 +120,17 @@ where let (min, max) = hashes.size_hint(); let mut alloc = Vec::with_capacity(max.unwrap_or(min) / 2 + 1); - while let Some(hash1) = hashes.next() { + while let Some(hash1) = hashes.next().map(T::from_leaf) { // If the size is odd, use the last element twice. - let hash2 = hashes.next().unwrap_or(hash1); - let mut encoder = T::engine(); - hash1.consensus_encode(&mut encoder).expect("in-memory writers don't error"); - hash2.consensus_encode(&mut encoder).expect("in-memory writers don't error"); - alloc.push(T::from_engine(encoder)); + let hash2 = hashes.next().map(T::from_leaf).unwrap_or(hash1); + alloc.push(hash1.combine(&hash2)); } Some(merkle_root_r(&mut alloc)) } // `hashes` must contain at least one hash. -fn merkle_root_r(hashes: &mut [T]) -> T -where - T: Hash + Encodable, - ::Engine: Write, -{ +fn merkle_root_r(hashes: &mut [T]) -> T { if hashes.len() == 1 { return hashes[0]; } @@ -121,10 +138,7 @@ where for idx in 0..((hashes.len() + 1) / 2) { let idx1 = 2 * idx; let idx2 = min(idx1 + 1, hashes.len() - 1); - let mut encoder = T::engine(); - hashes[idx1].consensus_encode(&mut encoder).expect("in-memory writers don't error"); - hashes[idx2].consensus_encode(&mut encoder).expect("in-memory writers don't error"); - hashes[idx] = T::from_engine(encoder); + hashes[idx] = hashes[idx1].combine(&hashes[idx2]); } let half_len = hashes.len() / 2 + hashes.len() % 2; @@ -133,8 +147,6 @@ where #[cfg(test)] mod tests { - use hashes::sha256d; - use super::*; use crate::blockdata::block::Block; use crate::consensus::encode::deserialize; @@ -146,11 +158,11 @@ mod tests { let block: Block = deserialize(&segwit_block[..]).expect("Failed to deserialize block"); assert!(block.check_merkle_root()); // Sanity check. - let hashes_iter = block.txdata.iter().map(|obj| obj.compute_txid().to_raw_hash()); + let hashes_iter = block.txdata.iter().map(|obj| obj.compute_txid()); - let mut hashes_array = [sha256d::Hash::all_zeros(); 15]; + let mut hashes_array = [TxMerkleNode::all_zeros(); 15]; for (i, hash) in hashes_iter.clone().enumerate() { - hashes_array[i] = hash; + hashes_array[i] = TxMerkleNode::from_leaf(hash); } let from_iter = calculate_root(hashes_iter); From 2bc97b22e2a171fb3f928627d21d45c95754b052 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Sat, 15 Jun 2024 13:07:04 +0000 Subject: [PATCH 4/7] api changes for new calculate_root method These changes are nontrivial. They * Drop the `From` impls from (w)txids to (w)TxMerkleRoots * Introduce a new trait and bound calculate_root on it... * ...in such a way that its return value cannot be inferred without further hints (though in practice this doesn't matter because usually the return value is immediately assigned to something with a known type such as a BlockHeader field) --- api/bitcoin/all-features.txt | 20 ++++++++++++++------ api/bitcoin/default-features.txt | 20 ++++++++++++++------ api/bitcoin/no-features.txt | 20 ++++++++++++++------ 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/api/bitcoin/all-features.txt b/api/bitcoin/all-features.txt index 025ba6c5f..f24df8213 100644 --- a/api/bitcoin/all-features.txt +++ b/api/bitcoin/all-features.txt @@ -391,6 +391,8 @@ impl bitcoin::key::TapTweak for bitcoin::key::UntweakedKeypair impl bitcoin::key::TapTweak for bitcoin::key::UntweakedPublicKey impl bitcoin::key::TweakedKeypair impl bitcoin::key::TweakedPublicKey +impl bitcoin::merkle_tree::MerkleNode for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::merkle_tree::MerkleNode for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::merkle_tree::PartialMerkleTree impl bitcoin::merkle_tree::TxMerkleNode impl bitcoin::merkle_tree::WitnessMerkleNode @@ -1841,9 +1843,7 @@ impl core::convert::From for impl core::convert::From for u32 impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid -impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::psbt::Error impl core::convert::From for bitcoin::consensus::validation::TxVerifyError @@ -8837,6 +8837,8 @@ pub fn bitcoin::merkle_tree::MerkleBlockError::eq(&self, other: &bitcoin::merkle pub fn bitcoin::merkle_tree::MerkleBlockError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::MerkleBlockError::from(never: core::convert::Infallible) -> Self pub fn bitcoin::merkle_tree::MerkleBlockError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)> +pub fn bitcoin::merkle_tree::MerkleNode::combine(&self, other: &Self) -> Self +pub fn bitcoin::merkle_tree::MerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::PartialMerkleTree::bits(&self) -> &alloc::vec::Vec pub fn bitcoin::merkle_tree::PartialMerkleTree::clone(&self) -> bitcoin::merkle_tree::PartialMerkleTree pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result @@ -8856,6 +8858,7 @@ pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8] pub fn bitcoin::merkle_tree::TxMerkleNode::borrow(&self) -> &[u8] pub fn bitcoin::merkle_tree::TxMerkleNode::clone(&self) -> bitcoin::merkle_tree::TxMerkleNode pub fn bitcoin::merkle_tree::TxMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::TxMerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::deserialize>(d: D) -> core::result::Result::Error> @@ -8863,11 +8866,11 @@ pub fn bitcoin::merkle_tree::TxMerkleNode::engine() -> bool pub fn bitcoin::merkle_tree::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode -pub fn bitcoin::merkle_tree::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode pub fn bitcoin::merkle_tree::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::from_slice_delegated(sl: &[u8]) -> core::result::Result @@ -8890,6 +8893,7 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8] pub fn bitcoin::merkle_tree::WitnessMerkleNode::borrow(&self) -> &[u8] pub fn bitcoin::merkle_tree::WitnessMerkleNode::clone(&self) -> bitcoin::merkle_tree::WitnessMerkleNode pub fn bitcoin::merkle_tree::WitnessMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::WitnessMerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::deserialize>(d: D) -> core::result::Result::Error> @@ -8897,11 +8901,11 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::engine() -> bool pub fn bitcoin::merkle_tree::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode -pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_slice_delegated(sl: &[u8]) -> core::result::Result @@ -8915,8 +8919,8 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::serialize ::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write, I: core::iter::traits::iterator::Iterator -pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write +pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin::merkle_tree::MerkleNode, I: core::iter::traits::iterator::Iterator::Leaf> +pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params pub fn bitcoin::network::Network::chain_hash(self) -> bitcoin::blockdata::constants::ChainHash pub fn bitcoin::network::Network::clone(&self) -> bitcoin::network::Network @@ -10400,6 +10404,7 @@ pub trait bitcoin::consensus::serde::EncodeBytes pub trait bitcoin::consensus::serde::IntoDeError pub trait bitcoin::consensus::serde::hex::Case: sealed::Case pub trait bitcoin::key::TapTweak +pub trait bitcoin::merkle_tree::MerkleNode: core::marker::Copy pub trait bitcoin::psbt::GetKey pub trait bitcoin::script::PushBytesErrorReport pub type &'a bitcoin::bip32::DerivationPath::IntoIter = core::slice::iter::Iter<'a, bitcoin::bip32::ChildNumber> @@ -10548,13 +10553,16 @@ pub type bitcoin::key::UntweakedKeypair::TweakedKey = bitcoin::key::TweakedKeypa pub type bitcoin::key::UntweakedPublicKey = secp256k1::key::XOnlyPublicKey pub type bitcoin::key::UntweakedPublicKey::TweakedAux = (bitcoin::key::TweakedPublicKey, secp256k1::key::Parity) pub type bitcoin::key::UntweakedPublicKey::TweakedKey = bitcoin::key::TweakedPublicKey +pub type bitcoin::merkle_tree::MerkleNode::Leaf pub type bitcoin::merkle_tree::TxMerkleNode::Bytes = ::Bytes pub type bitcoin::merkle_tree::TxMerkleNode::Engine = ::Engine pub type bitcoin::merkle_tree::TxMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::TxMerkleNode::Leaf = bitcoin::blockdata::transaction::Txid pub type bitcoin::merkle_tree::TxMerkleNode::Output = >::Output pub type bitcoin::merkle_tree::WitnessMerkleNode::Bytes = ::Bytes pub type bitcoin::merkle_tree::WitnessMerkleNode::Engine = ::Engine pub type bitcoin::merkle_tree::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::WitnessMerkleNode::Leaf = bitcoin::blockdata::transaction::Wtxid pub type bitcoin::merkle_tree::WitnessMerkleNode::Output = >::Output pub type bitcoin::network::Network::Err = bitcoin::network::ParseNetworkError pub type bitcoin::network::Network::Error = bitcoin::network::UnknownChainHashError diff --git a/api/bitcoin/default-features.txt b/api/bitcoin/default-features.txt index a5a976f46..bec211c0c 100644 --- a/api/bitcoin/default-features.txt +++ b/api/bitcoin/default-features.txt @@ -382,6 +382,8 @@ impl bitcoin::key::TapTweak for bitcoin::key::UntweakedKeypair impl bitcoin::key::TapTweak for bitcoin::key::UntweakedPublicKey impl bitcoin::key::TweakedKeypair impl bitcoin::key::TweakedPublicKey +impl bitcoin::merkle_tree::MerkleNode for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::merkle_tree::MerkleNode for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::merkle_tree::PartialMerkleTree impl bitcoin::merkle_tree::TxMerkleNode impl bitcoin::merkle_tree::WitnessMerkleNode @@ -1801,9 +1803,7 @@ impl core::convert::From for impl core::convert::From for u32 impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid -impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::psbt::Error impl core::convert::From for bitcoin::key::ParsePublicKeyError @@ -8381,6 +8381,8 @@ pub fn bitcoin::merkle_tree::MerkleBlockError::eq(&self, other: &bitcoin::merkle pub fn bitcoin::merkle_tree::MerkleBlockError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::MerkleBlockError::from(never: core::convert::Infallible) -> Self pub fn bitcoin::merkle_tree::MerkleBlockError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)> +pub fn bitcoin::merkle_tree::MerkleNode::combine(&self, other: &Self) -> Self +pub fn bitcoin::merkle_tree::MerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::PartialMerkleTree::bits(&self) -> &alloc::vec::Vec pub fn bitcoin::merkle_tree::PartialMerkleTree::clone(&self) -> bitcoin::merkle_tree::PartialMerkleTree pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result @@ -8400,17 +8402,18 @@ pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8] pub fn bitcoin::merkle_tree::TxMerkleNode::borrow(&self) -> &[u8] pub fn bitcoin::merkle_tree::TxMerkleNode::clone(&self) -> bitcoin::merkle_tree::TxMerkleNode pub fn bitcoin::merkle_tree::TxMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::TxMerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::engine() -> ::Engine pub fn bitcoin::merkle_tree::TxMerkleNode::eq(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> bool pub fn bitcoin::merkle_tree::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode -pub fn bitcoin::merkle_tree::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode pub fn bitcoin::merkle_tree::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::from_str(s: &str) -> core::result::Result @@ -8431,17 +8434,18 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8] pub fn bitcoin::merkle_tree::WitnessMerkleNode::borrow(&self) -> &[u8] pub fn bitcoin::merkle_tree::WitnessMerkleNode::clone(&self) -> bitcoin::merkle_tree::WitnessMerkleNode pub fn bitcoin::merkle_tree::WitnessMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::WitnessMerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::engine() -> ::Engine pub fn bitcoin::merkle_tree::WitnessMerkleNode::eq(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> bool pub fn bitcoin::merkle_tree::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode -pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_str(s: &str) -> core::result::Result @@ -8453,8 +8457,8 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::partial_cmp(&self, other: &bitco pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> ::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write, I: core::iter::traits::iterator::Iterator -pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write +pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin::merkle_tree::MerkleNode, I: core::iter::traits::iterator::Iterator::Leaf> +pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params pub fn bitcoin::network::Network::chain_hash(self) -> bitcoin::blockdata::constants::ChainHash pub fn bitcoin::network::Network::clone(&self) -> bitcoin::network::Network @@ -9869,6 +9873,7 @@ pub trait bitcoin::consensus::encode::Encodable pub trait bitcoin::consensus::encode::ReadExt: bitcoin_io::Read pub trait bitcoin::consensus::encode::WriteExt: bitcoin_io::Write pub trait bitcoin::key::TapTweak +pub trait bitcoin::merkle_tree::MerkleNode: core::marker::Copy pub trait bitcoin::psbt::GetKey pub trait bitcoin::script::PushBytesErrorReport pub type &'a bitcoin::bip32::DerivationPath::IntoIter = core::slice::iter::Iter<'a, bitcoin::bip32::ChildNumber> @@ -10008,13 +10013,16 @@ pub type bitcoin::key::UntweakedKeypair::TweakedKey = bitcoin::key::TweakedKeypa pub type bitcoin::key::UntweakedPublicKey = secp256k1::key::XOnlyPublicKey pub type bitcoin::key::UntweakedPublicKey::TweakedAux = (bitcoin::key::TweakedPublicKey, secp256k1::key::Parity) pub type bitcoin::key::UntweakedPublicKey::TweakedKey = bitcoin::key::TweakedPublicKey +pub type bitcoin::merkle_tree::MerkleNode::Leaf pub type bitcoin::merkle_tree::TxMerkleNode::Bytes = ::Bytes pub type bitcoin::merkle_tree::TxMerkleNode::Engine = ::Engine pub type bitcoin::merkle_tree::TxMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::TxMerkleNode::Leaf = bitcoin::blockdata::transaction::Txid pub type bitcoin::merkle_tree::TxMerkleNode::Output = >::Output pub type bitcoin::merkle_tree::WitnessMerkleNode::Bytes = ::Bytes pub type bitcoin::merkle_tree::WitnessMerkleNode::Engine = ::Engine pub type bitcoin::merkle_tree::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::WitnessMerkleNode::Leaf = bitcoin::blockdata::transaction::Wtxid pub type bitcoin::merkle_tree::WitnessMerkleNode::Output = >::Output pub type bitcoin::network::Network::Err = bitcoin::network::ParseNetworkError pub type bitcoin::network::Network::Error = bitcoin::network::UnknownChainHashError diff --git a/api/bitcoin/no-features.txt b/api/bitcoin/no-features.txt index 3b0cecd81..f520060df 100644 --- a/api/bitcoin/no-features.txt +++ b/api/bitcoin/no-features.txt @@ -325,6 +325,8 @@ impl bitcoin::key::TapTweak for bitcoin::key::UntweakedKeypair impl bitcoin::key::TapTweak for bitcoin::key::UntweakedPublicKey impl bitcoin::key::TweakedKeypair impl bitcoin::key::TweakedPublicKey +impl bitcoin::merkle_tree::MerkleNode for bitcoin::merkle_tree::TxMerkleNode +impl bitcoin::merkle_tree::MerkleNode for bitcoin::merkle_tree::WitnessMerkleNode impl bitcoin::merkle_tree::PartialMerkleTree impl bitcoin::merkle_tree::TxMerkleNode impl bitcoin::merkle_tree::WitnessMerkleNode @@ -1637,9 +1639,7 @@ impl core::convert::From for impl core::convert::From for u32 impl core::convert::From for bitcoin::blockdata::transaction::Txid impl core::convert::From for bitcoin::blockdata::transaction::Wtxid -impl core::convert::From for bitcoin::merkle_tree::TxMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash -impl core::convert::From for bitcoin::merkle_tree::WitnessMerkleNode impl core::convert::From for bitcoin_hashes::sha256d::Hash impl core::convert::From for bitcoin::psbt::Error impl core::convert::From for bitcoin::key::ParsePublicKeyError @@ -7716,6 +7716,8 @@ pub fn bitcoin::merkle_tree::MerkleBlockError::clone(&self) -> bitcoin::merkle_t pub fn bitcoin::merkle_tree::MerkleBlockError::eq(&self, other: &bitcoin::merkle_tree::MerkleBlockError) -> bool pub fn bitcoin::merkle_tree::MerkleBlockError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::MerkleBlockError::from(never: core::convert::Infallible) -> Self +pub fn bitcoin::merkle_tree::MerkleNode::combine(&self, other: &Self) -> Self +pub fn bitcoin::merkle_tree::MerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::PartialMerkleTree::bits(&self) -> &alloc::vec::Vec pub fn bitcoin::merkle_tree::PartialMerkleTree::clone(&self) -> bitcoin::merkle_tree::PartialMerkleTree pub fn bitcoin::merkle_tree::PartialMerkleTree::consensus_decode_from_finite_reader(r: &mut R) -> core::result::Result @@ -7735,17 +7737,18 @@ pub fn bitcoin::merkle_tree::TxMerkleNode::as_ref(&self) -> &[u8] pub fn bitcoin::merkle_tree::TxMerkleNode::borrow(&self) -> &[u8] pub fn bitcoin::merkle_tree::TxMerkleNode::clone(&self) -> bitcoin::merkle_tree::TxMerkleNode pub fn bitcoin::merkle_tree::TxMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::TxMerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::engine() -> ::Engine pub fn bitcoin::merkle_tree::TxMerkleNode::eq(&self, other: &bitcoin::merkle_tree::TxMerkleNode) -> bool pub fn bitcoin::merkle_tree::TxMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::TxMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode -pub fn bitcoin::merkle_tree::TxMerkleNode::from(txid: bitcoin::blockdata::transaction::Txid) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: ::Bytes) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::TxMerkleNode +pub fn bitcoin::merkle_tree::TxMerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::TxMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::TxMerkleNode pub fn bitcoin::merkle_tree::TxMerkleNode::from_slice(sl: &[u8]) -> core::result::Result pub fn bitcoin::merkle_tree::TxMerkleNode::from_str(s: &str) -> core::result::Result @@ -7766,17 +7769,18 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::as_ref(&self) -> &[u8] pub fn bitcoin::merkle_tree::WitnessMerkleNode::borrow(&self) -> &[u8] pub fn bitcoin::merkle_tree::WitnessMerkleNode::clone(&self) -> bitcoin::merkle_tree::WitnessMerkleNode pub fn bitcoin::merkle_tree::WitnessMerkleNode::cmp(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> core::cmp::Ordering +pub fn bitcoin::merkle_tree::WitnessMerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_decode(r: &mut R) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::consensus_encode(&self, w: &mut W) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::engine() -> ::Engine pub fn bitcoin::merkle_tree::WitnessMerkleNode::eq(&self, other: &bitcoin::merkle_tree::WitnessMerkleNode) -> bool pub fn bitcoin::merkle_tree::WitnessMerkleNode::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode -pub fn bitcoin::merkle_tree::WitnessMerkleNode::from(wtxid: bitcoin::blockdata::transaction::Wtxid) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: ::Bytes) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_byte_array(bytes: Self::Bytes) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_engine(e: ::Engine) -> bitcoin::merkle_tree::WitnessMerkleNode +pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_raw_hash(inner: bitcoin_hashes::sha256d::Hash) -> bitcoin::merkle_tree::WitnessMerkleNode pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_slice(sl: &[u8]) -> core::result::Result pub fn bitcoin::merkle_tree::WitnessMerkleNode::from_str(s: &str) -> core::result::Result @@ -7788,8 +7792,8 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::partial_cmp(&self, other: &bitco pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> ::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write, I: core::iter::traits::iterator::Iterator -pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option where T: bitcoin_hashes::Hash + bitcoin::consensus::encode::Encodable, ::Engine: bitcoin_io::Write +pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin::merkle_tree::MerkleNode, I: core::iter::traits::iterator::Iterator::Leaf> +pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params pub fn bitcoin::network::Network::chain_hash(self) -> bitcoin::blockdata::constants::ChainHash pub fn bitcoin::network::Network::clone(&self) -> bitcoin::network::Network @@ -8947,6 +8951,7 @@ pub trait bitcoin::consensus::encode::Encodable pub trait bitcoin::consensus::encode::ReadExt: bitcoin_io::Read pub trait bitcoin::consensus::encode::WriteExt: bitcoin_io::Write pub trait bitcoin::key::TapTweak +pub trait bitcoin::merkle_tree::MerkleNode: core::marker::Copy pub trait bitcoin::psbt::GetKey pub trait bitcoin::script::PushBytesErrorReport pub type &'a bitcoin::bip32::DerivationPath::IntoIter = core::slice::iter::Iter<'a, bitcoin::bip32::ChildNumber> @@ -9084,13 +9089,16 @@ pub type bitcoin::key::UntweakedKeypair::TweakedKey = bitcoin::key::TweakedKeypa pub type bitcoin::key::UntweakedPublicKey = secp256k1::key::XOnlyPublicKey pub type bitcoin::key::UntweakedPublicKey::TweakedAux = (bitcoin::key::TweakedPublicKey, secp256k1::key::Parity) pub type bitcoin::key::UntweakedPublicKey::TweakedKey = bitcoin::key::TweakedPublicKey +pub type bitcoin::merkle_tree::MerkleNode::Leaf pub type bitcoin::merkle_tree::TxMerkleNode::Bytes = ::Bytes pub type bitcoin::merkle_tree::TxMerkleNode::Engine = ::Engine pub type bitcoin::merkle_tree::TxMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::TxMerkleNode::Leaf = bitcoin::blockdata::transaction::Txid pub type bitcoin::merkle_tree::TxMerkleNode::Output = >::Output pub type bitcoin::merkle_tree::WitnessMerkleNode::Bytes = ::Bytes pub type bitcoin::merkle_tree::WitnessMerkleNode::Engine = ::Engine pub type bitcoin::merkle_tree::WitnessMerkleNode::Err = hex_conservative::error::HexToArrayError +pub type bitcoin::merkle_tree::WitnessMerkleNode::Leaf = bitcoin::blockdata::transaction::Wtxid pub type bitcoin::merkle_tree::WitnessMerkleNode::Output = >::Output pub type bitcoin::network::Network::Err = bitcoin::network::ParseNetworkError pub type bitcoin::network::Network::Error = bitcoin::network::UnknownChainHashError From f7ce9bbee8356c6d70cd8b54fcf4989bcdd013a7 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Sun, 16 Jun 2024 14:59:49 +0000 Subject: [PATCH 5/7] merkle_node: rewrite algorithm Drop recursion, reduce memory usage to be logarithmic in size of tree rather than linear, and put it all in one function rather than three. Also make the method an trait method on MerkleNode which makes it a easier on type inference, by writing e.g. TxMerkleNode::calculate_root. --- bitcoin/src/blockdata/block.rs | 6 +- bitcoin/src/merkle_tree/block.rs | 5 +- bitcoin/src/merkle_tree/mod.rs | 140 ++++++++++++------------------- 3 files changed, 59 insertions(+), 92 deletions(-) diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs index d3337c86f..06288ccab 100644 --- a/bitcoin/src/blockdata/block.rs +++ b/bitcoin/src/blockdata/block.rs @@ -17,7 +17,7 @@ use crate::blockdata::script; use crate::blockdata::transaction::{Transaction, Wtxid}; use crate::consensus::{encode, Decodable, Encodable, Params}; use crate::internal_macros::{impl_consensus_encoding, impl_hashencode}; -use crate::merkle_tree::{self, TxMerkleNode, WitnessMerkleNode}; +use crate::merkle_tree::{MerkleNode as _, TxMerkleNode, WitnessMerkleNode}; use crate::pow::{CompactTarget, Target, Work}; use crate::prelude::*; use crate::VarInt; @@ -281,7 +281,7 @@ impl Block { /// Computes the transaction merkle root. pub fn compute_merkle_root(&self) -> Option { let hashes = self.txdata.iter().map(|obj| obj.compute_txid()); - merkle_tree::calculate_root(hashes) + TxMerkleNode::calculate_root(hashes) } /// Computes the witness commitment for the block's transaction list. @@ -305,7 +305,7 @@ impl Block { t.compute_wtxid() } }); - merkle_tree::calculate_root(hashes) + WitnessMerkleNode::calculate_root(hashes) } /// Returns the weight of the block. diff --git a/bitcoin/src/merkle_tree/block.rs b/bitcoin/src/merkle_tree/block.rs index 288f26092..6ba5218ec 100644 --- a/bitcoin/src/merkle_tree/block.rs +++ b/bitcoin/src/merkle_tree/block.rs @@ -515,7 +515,7 @@ impl std::error::Error for MerkleBlockError { #[cfg(test)] mod tests { #[cfg(feature = "rand-std")] - use {crate::merkle_tree, core::cmp, secp256k1::rand::prelude::*}; + use {crate::merkle_tree::MerkleNode as _, core::cmp, secp256k1::rand::prelude::*}; use super::*; use crate::consensus::encode; @@ -564,8 +564,7 @@ mod tests { // Calculate the merkle root and height let hashes = tx_ids.iter().copied(); - let merkle_root_1: TxMerkleNode = - merkle_tree::calculate_root(hashes).expect("hashes is not empty"); + let merkle_root_1 = TxMerkleNode::calculate_root(hashes).expect("hashes is not empty"); let mut height = 1; let mut ntx = tx_count; while ntx > 1 { diff --git a/bitcoin/src/merkle_tree/mod.rs b/bitcoin/src/merkle_tree/mod.rs index 8b5c7da1a..f0dee0a93 100644 --- a/bitcoin/src/merkle_tree/mod.rs +++ b/bitcoin/src/merkle_tree/mod.rs @@ -5,20 +5,17 @@ //! # Examples //! //! ``` -//! # use bitcoin::{merkle_tree, Txid}; -//! # use bitcoin::merkle_tree::TxMerkleNode; +//! # use bitcoin::Txid; +//! # use bitcoin::merkle_tree::{MerkleNode as _, TxMerkleNode}; //! # use bitcoin::hashes::Hash; //! # let tx1 = Txid::all_zeros(); // Dummy hash values. //! # let tx2 = Txid::all_zeros(); //! let tx_hashes = vec![tx1, tx2]; // All the hashes we wish to merkelize. -//! let root: Option = merkle_tree::calculate_root(tx_hashes.into_iter()); +//! let root = TxMerkleNode::calculate_root(tx_hashes.into_iter()); //! ``` mod block; -use core::cmp::min; -use core::iter; - use hashes::{sha256d, HashEngine as _}; use crate::internal_macros::impl_hashencode; @@ -39,6 +36,14 @@ impl_hashencode!(TxMerkleNode); impl_hashencode!(WitnessMerkleNode); /// A node in a Merkle tree of transactions or witness data within a block. +/// +/// This trait is used to compute the transaction Merkle root contained in +/// a block header. This is a particularly weird algorithm -- it interprets +/// the list of transactions as a balanced binary tree, duplicating branches +/// as needed to fill out the tree to a power of two size. +/// +/// Other Merkle trees in Bitcoin, such as those used in Taproot commitments, +/// do not use this algorithm and cannot use this trait. pub trait MerkleNode: Copy { /// The hash (TXID or WTXID) of a transaciton in the tree. type Leaf; @@ -47,6 +52,43 @@ pub trait MerkleNode: Copy { fn from_leaf(leaf: Self::Leaf) -> Self; /// Combine two nodes to get a single node. The final node of a tree is called the "root". fn combine(&self, other: &Self) -> Self; + + /// Given an iterator of leaves, compute the Merkle root. + /// + /// Returns `None` iff the iterator was empty. + fn calculate_root>(iter: I) -> Option { + let mut stack = Vec::<(usize, Self)>::with_capacity(32); + // Start with a standard Merkle tree root computation... + for (mut n, leaf) in iter.enumerate() { + stack.push((0, Self::from_leaf(leaf))); + + while n & 1 == 1 { + let right = stack.pop().unwrap(); + let left = stack.pop().unwrap(); + debug_assert_eq!(left.0, right.0); + stack.push((left.0 + 1, left.1.combine(&right.1))); + n >>= 1; + } + } + // ...then, deal with incomplete trees. Bitcoin does a weird thing in + // which it doubles-up nodes of the tree to fill out the tree, rather + // than treating incomplete branches specially. This, along with its + // conflation of leaves with leaf hashes, makes its Merkle tree + // construction theoretically (though probably not practically) + // vulnerable to collisions. This is consensus logic so we just have + // to accept it. + while stack.len() > 1 { + let mut right = stack.pop().unwrap(); + let left = stack.pop().unwrap(); + while right.0 != left.0 { + assert!(right.0 < left.0); + right = (right.0 + 1, right.1.combine(&right.1)); // combine with self + } + stack.push((left.0 + 1, left.1.combine(&right.1))); + } + + stack.pop().map(|(_, h)| h) + } } // These two impl blocks are identical. FIXME once we have nailed down @@ -76,75 +118,6 @@ impl MerkleNode for WitnessMerkleNode { } } -/// Calculates the merkle root of a list of *hashes*, inline (in place) in `hashes`. -/// -/// In most cases, you'll want to use [`calculate_root`] instead. Please note, calling this function -/// trashes the data in `hashes` (i.e. the `hashes` is left in an undefined state at conclusion of -/// this method and should not be used again afterwards). -/// -/// # Returns -/// -/// - `None` if `hashes` is empty. The merkle root of an empty tree of hashes is undefined. -/// - `Some(hash)` if `hashes` contains one element. A single hash is by definition the merkle root. -/// - `Some(merkle_root)` if length of `hashes` is greater than one. -pub fn calculate_root_inline(hashes: &mut [T]) -> Option { - match hashes.len() { - 0 => None, - 1 => Some(hashes[0]), - _ => Some(merkle_root_r(hashes)), - } -} - -/// Calculates the merkle root of an iterator of *hashes*. -/// -/// # Returns -/// -/// - `None` if `hashes` is empty. The merkle root of an empty tree of hashes is undefined. -/// - `Some(hash)` if `hashes` contains one element. A single hash is by definition the merkle root. -/// - `Some(merkle_root)` if length of `hashes` is greater than one. -pub fn calculate_root(mut hashes: I) -> Option -where - T: MerkleNode, - I: Iterator, -{ - let first: T::Leaf = hashes.next()?; - let second = match hashes.next() { - Some(second) => second, - None => return Some(T::from_leaf(first)), - }; - - let mut hashes = iter::once(first).chain(iter::once(second)).chain(hashes); - - // We need a local copy to pass to `merkle_root_r`. It's more efficient to do the first loop of - // processing as we make the copy instead of copying the whole iterator. - let (min, max) = hashes.size_hint(); - let mut alloc = Vec::with_capacity(max.unwrap_or(min) / 2 + 1); - - while let Some(hash1) = hashes.next().map(T::from_leaf) { - // If the size is odd, use the last element twice. - let hash2 = hashes.next().map(T::from_leaf).unwrap_or(hash1); - alloc.push(hash1.combine(&hash2)); - } - - Some(merkle_root_r(&mut alloc)) -} - -// `hashes` must contain at least one hash. -fn merkle_root_r(hashes: &mut [T]) -> T { - if hashes.len() == 1 { - return hashes[0]; - } - - for idx in 0..((hashes.len() + 1) / 2) { - let idx1 = 2 * idx; - let idx2 = min(idx1 + 1, hashes.len() - 1); - hashes[idx] = hashes[idx1].combine(&hashes[idx2]); - } - let half_len = hashes.len() / 2 + hashes.len() % 2; - - merkle_root_r(&mut hashes[0..half_len]) -} - #[cfg(test)] mod tests { use super::*; @@ -152,21 +125,16 @@ mod tests { use crate::consensus::encode::deserialize; #[test] - fn both_merkle_root_functions_return_the_same_result() { + fn static_vector() { // testnet block 000000000000045e0b1660b6445b5e5c5ab63c9a4f956be7e1e69be04fa4497b let segwit_block = include_bytes!("../../tests/data/testnet_block_000000000000045e0b1660b6445b5e5c5ab63c9a4f956be7e1e69be04fa4497b.raw"); let block: Block = deserialize(&segwit_block[..]).expect("Failed to deserialize block"); - assert!(block.check_merkle_root()); // Sanity check. + assert!(block.check_merkle_root()); + + // Same as `block.check_merkle_root` but do it explicitly. let hashes_iter = block.txdata.iter().map(|obj| obj.compute_txid()); - - let mut hashes_array = [TxMerkleNode::all_zeros(); 15]; - for (i, hash) in hashes_iter.clone().enumerate() { - hashes_array[i] = TxMerkleNode::from_leaf(hash); - } - - let from_iter = calculate_root(hashes_iter); - let from_array = calculate_root_inline(&mut hashes_array); - assert_eq!(from_iter, from_array); + let from_iter = TxMerkleNode::calculate_root(hashes_iter.clone()); + assert_eq!(from_iter, Some(block.header.merkle_root)); } } From 48ad5e4789f2491c609681a7ba620f1c826d3b9d Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Fri, 14 Jun 2024 16:01:14 +0000 Subject: [PATCH 6/7] api changes for "rewrite merkle root calculation" --- api/bitcoin/all-features.txt | 3 +-- api/bitcoin/default-features.txt | 3 +-- api/bitcoin/no-features.txt | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/api/bitcoin/all-features.txt b/api/bitcoin/all-features.txt index f24df8213..35bdfcdb6 100644 --- a/api/bitcoin/all-features.txt +++ b/api/bitcoin/all-features.txt @@ -8837,6 +8837,7 @@ pub fn bitcoin::merkle_tree::MerkleBlockError::eq(&self, other: &bitcoin::merkle pub fn bitcoin::merkle_tree::MerkleBlockError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::MerkleBlockError::from(never: core::convert::Infallible) -> Self pub fn bitcoin::merkle_tree::MerkleBlockError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)> +pub fn bitcoin::merkle_tree::MerkleNode::calculate_root>(iter: I) -> core::option::Option pub fn bitcoin::merkle_tree::MerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::MerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::PartialMerkleTree::bits(&self) -> &alloc::vec::Vec @@ -8919,8 +8920,6 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::serialize ::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin::merkle_tree::MerkleNode, I: core::iter::traits::iterator::Iterator::Leaf> -pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params pub fn bitcoin::network::Network::chain_hash(self) -> bitcoin::blockdata::constants::ChainHash pub fn bitcoin::network::Network::clone(&self) -> bitcoin::network::Network diff --git a/api/bitcoin/default-features.txt b/api/bitcoin/default-features.txt index bec211c0c..244a5c7b3 100644 --- a/api/bitcoin/default-features.txt +++ b/api/bitcoin/default-features.txt @@ -8381,6 +8381,7 @@ pub fn bitcoin::merkle_tree::MerkleBlockError::eq(&self, other: &bitcoin::merkle pub fn bitcoin::merkle_tree::MerkleBlockError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::MerkleBlockError::from(never: core::convert::Infallible) -> Self pub fn bitcoin::merkle_tree::MerkleBlockError::source(&self) -> core::option::Option<&(dyn core::error::Error + 'static)> +pub fn bitcoin::merkle_tree::MerkleNode::calculate_root>(iter: I) -> core::option::Option pub fn bitcoin::merkle_tree::MerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::MerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::PartialMerkleTree::bits(&self) -> &alloc::vec::Vec @@ -8457,8 +8458,6 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::partial_cmp(&self, other: &bitco pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> ::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin::merkle_tree::MerkleNode, I: core::iter::traits::iterator::Iterator::Leaf> -pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params pub fn bitcoin::network::Network::chain_hash(self) -> bitcoin::blockdata::constants::ChainHash pub fn bitcoin::network::Network::clone(&self) -> bitcoin::network::Network diff --git a/api/bitcoin/no-features.txt b/api/bitcoin/no-features.txt index f520060df..7df5c578a 100644 --- a/api/bitcoin/no-features.txt +++ b/api/bitcoin/no-features.txt @@ -7716,6 +7716,7 @@ pub fn bitcoin::merkle_tree::MerkleBlockError::clone(&self) -> bitcoin::merkle_t pub fn bitcoin::merkle_tree::MerkleBlockError::eq(&self, other: &bitcoin::merkle_tree::MerkleBlockError) -> bool pub fn bitcoin::merkle_tree::MerkleBlockError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result pub fn bitcoin::merkle_tree::MerkleBlockError::from(never: core::convert::Infallible) -> Self +pub fn bitcoin::merkle_tree::MerkleNode::calculate_root>(iter: I) -> core::option::Option pub fn bitcoin::merkle_tree::MerkleNode::combine(&self, other: &Self) -> Self pub fn bitcoin::merkle_tree::MerkleNode::from_leaf(leaf: Self::Leaf) -> Self pub fn bitcoin::merkle_tree::PartialMerkleTree::bits(&self) -> &alloc::vec::Vec @@ -7792,8 +7793,6 @@ pub fn bitcoin::merkle_tree::WitnessMerkleNode::partial_cmp(&self, other: &bitco pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> ::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_byte_array(self) -> Self::Bytes pub fn bitcoin::merkle_tree::WitnessMerkleNode::to_raw_hash(self) -> bitcoin_hashes::sha256d::Hash -pub fn bitcoin::merkle_tree::calculate_root(hashes: I) -> core::option::Option where T: bitcoin::merkle_tree::MerkleNode, I: core::iter::traits::iterator::Iterator::Leaf> -pub fn bitcoin::merkle_tree::calculate_root_inline(hashes: &mut [T]) -> core::option::Option pub fn bitcoin::network::Network::as_ref(&self) -> &bitcoin::consensus::params::Params pub fn bitcoin::network::Network::chain_hash(self) -> bitcoin::blockdata::constants::ChainHash pub fn bitcoin::network::Network::clone(&self) -> bitcoin::network::Network From 90b6d6748b1a49fb45ebc80e8069ba909182b2cb Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Sun, 16 Jun 2024 15:11:52 +0000 Subject: [PATCH 7/7] merkle_tree: remove some now-redundant code from block.rs --- bitcoin/src/merkle_tree/block.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/bitcoin/src/merkle_tree/block.rs b/bitcoin/src/merkle_tree/block.rs index 6ba5218ec..13c59ef1e 100644 --- a/bitcoin/src/merkle_tree/block.rs +++ b/bitcoin/src/merkle_tree/block.rs @@ -18,7 +18,7 @@ use crate::blockdata::block::{self, Block}; use crate::blockdata::transaction::{Transaction, Txid}; use crate::blockdata::weight::Weight; use crate::consensus::encode::{self, Decodable, Encodable, MAX_VEC_SIZE}; -use crate::merkle_tree::TxMerkleNode; +use crate::merkle_tree::{MerkleNode as _, TxMerkleNode}; use crate::prelude::*; /// Data structure that represents a block header paired to a partial merkle tree. @@ -273,7 +273,7 @@ impl PartialMerkleTree { if hash_used != self.hashes.len() as u32 { return Err(NotAllHashesConsumed); } - Ok(TxMerkleNode::from_byte_array(hash_merkle_root.to_byte_array())) + Ok(hash_merkle_root) } /// Calculates the height of the tree. @@ -307,7 +307,7 @@ impl PartialMerkleTree { left }; // Combine subhashes - PartialMerkleTree::parent_hash(left, right) + left.combine(&right) } } @@ -394,17 +394,9 @@ impl PartialMerkleTree { right = left; } // and combine them before returning - Ok(PartialMerkleTree::parent_hash(left, right)) + Ok(left.combine(&right)) } } - - /// Helper method to produce SHA256D(left + right) - fn parent_hash(left: TxMerkleNode, right: TxMerkleNode) -> TxMerkleNode { - let mut encoder = TxMerkleNode::engine(); - left.consensus_encode(&mut encoder).expect("engines don't error"); - right.consensus_encode(&mut encoder).expect("engines don't error"); - TxMerkleNode::from_engine(encoder) - } } impl Encodable for PartialMerkleTree { @@ -515,7 +507,7 @@ impl std::error::Error for MerkleBlockError { #[cfg(test)] mod tests { #[cfg(feature = "rand-std")] - use {crate::merkle_tree::MerkleNode as _, core::cmp, secp256k1::rand::prelude::*}; + use {core::cmp, secp256k1::rand::prelude::*}; use super::*; use crate::consensus::encode;