Merge rust-bitcoin/rust-bitcoin#1624: Improve `sighash` module documentation

75b266a129 Improve `sighash` module documentation (Martin Habovstiak)

Pull request description:

  "Sighash" is a technical term that newbies in Bitcoin may not know and could get lost when trying to find how to sign a transaction. This change attempts to make it more obvious that this module is needed for signing.

  Closes #1463

ACKs for top commit:
  tcharding:
    ACK 75b266a129
  apoelstra:
    ACK 75b266a129

Tree-SHA512: 7157566c1639c63ce0fba2832e8e5e846e689d89e24077ed7769b721c5db4613cd7fd8d91464992eb78de74b42912ca877e7182a9c3c9c8848bf94d89767b8cc
This commit is contained in:
Andrew Poelstra 2023-02-07 01:11:07 +00:00
commit 611772ca0e
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 5 additions and 2 deletions

View File

@ -1,12 +1,15 @@
// SPDX-License-Identifier: CC0-1.0 // SPDX-License-Identifier: CC0-1.0
//! Generalized, efficient, signature hash implementation. //! Signature hash implementation (used in transaction signing).
//! //!
//! Implementation of the algorithm to compute the message to be signed according to //! Efficient implementation of the algorithm to compute the message to be signed according to
//! [Bip341](https://github.com/bitcoin/bips/blob/150ab6f5c3aca9da05fccc5b435e9667853407f4/bip-0341.mediawiki), //! [Bip341](https://github.com/bitcoin/bips/blob/150ab6f5c3aca9da05fccc5b435e9667853407f4/bip-0341.mediawiki),
//! [Bip143](https://github.com/bitcoin/bips/blob/99701f68a88ce33b2d0838eb84e115cef505b4c2/bip-0143.mediawiki) //! [Bip143](https://github.com/bitcoin/bips/blob/99701f68a88ce33b2d0838eb84e115cef505b4c2/bip-0143.mediawiki)
//! and legacy (before Bip143). //! and legacy (before Bip143).
//! //!
//! Computing signature hashes is required to sign a transaction and this module is designed to
//! handle its complexity efficiently. Computing these hashes is as simple as creating
//! [`SighashCache`] and calling its methods.
use core::borrow::{Borrow, BorrowMut}; use core::borrow::{Borrow, BorrowMut};
use core::{fmt, str}; use core::{fmt, str};