Skip to content

Commit e9e9177

Browse files
committed
Merge rust-bitcoin/rust-bitcoin#1037: Document Txid being displayed backwards
28049ce Document `Txid` being displayed backwards (Dawid Ciężarkiewicz) Pull request description: Fix #958 I hope putting it on the most notorious type where people actually notice it is enough. I couldn't find a good way to put it on all other `sha256d` automatically, and copy pasting it seems not worth it. ACKs for top commit: tcharding: ACK 28049ce apoelstra: ACK 28049ce Tree-SHA512: a5acf5d7a73361a6c48b45ed264fafb911930ae9f1bdb03895dc39c679d508dc56dbf44896fd38cf6569abb652e7fce721028ef06344462747a77078ef5a8f4f
2 parents f465b79 + 9888e55 commit e9e9177

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/hash_types.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ macro_rules! impl_hashencode {
3939
}
4040
}
4141

42-
hash_newtype!(Txid, sha256d::Hash, 32, doc="A bitcoin transaction hash/transaction ID.");
42+
hash_newtype!(
43+
Txid, sha256d::Hash, 32, doc="A bitcoin transaction hash/transaction ID.
44+
45+
For compatibility with the existing Bitcoin infrastructure and historical
46+
and current versions of the Bitcoin Core software itself, this and
47+
other [`sha256d::Hash`] types, are serialized in reverse
48+
byte order when converted to a hex string via [`std::fmt::Display`] trait operations.
49+
See [`hashes::Hash::DISPLAY_BACKWARD`] for more details.
50+
");
4351
hash_newtype!(Wtxid, sha256d::Hash, 32, doc="A bitcoin witness transaction ID.");
4452
hash_newtype!(BlockHash, sha256d::Hash, 32, doc="A bitcoin block hash.");
4553
hash_newtype!(Sighash, sha256d::Hash, 32, doc="Hash of the transaction according to the signature algorithm");

0 commit comments

Comments
 (0)