-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sighash
module name is confusing
#1463
Comments
IME Is there anything in this module that is not sighash-related? I did a quick skim and it seems not. I also don't see any actual signing code so I don't think it makes sense to call it something like |
Perhaps, I am also used to |
Hmm, maybe I'm biased by having less coding experience than doc-reading in this area. |
That sounds like it's related to signmessage, or something ... it's definitely not clear that it's referring to a sighash. |
Oh, true. Is there anything particularly wrong with |
This module is only tangentially related to signing. It's about computing and caching sighashes. |
That's like 90% of all work one has to do when signing Bitcoin transactions. The only other parts are constructing tap tree (if any), calling one function from What's confusing about it is it's not obvious that "you need this module to sign transactions". Maybe just change the doc summary to something like "Infrastructure for signing Bitcoin transactions"? |
If it's 90% of the work then we should definitely label it something discoverable, which "sighash" is. "Infrastructure for signing Bitcoin transactions" does not make it obvious at all what's inside, and kinda sounds like it might be a collection of ad-hoc accoutrements that a normal users might not need, since normally you just compute a sighash and sign it. |
I guess that depends on the background. Someone coming from Bitcoin Core would probably look for |
For sure -- I'm happy to extend the documentation to describe what a sighash is (and maybe disambiguate between the sighash and a sighash flag), and to give the high-level "compute a sighash, sign it, stick the signature into the transaction/PSBT" workflow. I think it'll take more than a sentence or two. We could also put an example of signing a transaction in the top-level lib.rs, which will use this module, hopefully hinting new users where they need to look. |
I'd love to have something like a cookbook:
This should be well-visible at front page (README, doc) and link to separated doc. Otherwise the front page could become cluttered with things. |
It's basically a documentation issue now, I will try to come up with a simple PR. |
Bad news: I just found out the generated docs don't have full text search - they can only search in names. I think the cookbook is the only way. |
"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 rust-bitcoin#1463
If we get this done by BTC Prague we could have two tracks in the workshop, one for full enthusiasts (develop a wallet) and one for casually interested Rust devs (work through / look through the cookbook)? |
That could be interesting. But I wouldn't try too hard. I suggest:
|
75b266a 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 75b266a apoelstra: ACK 75b266a Tree-SHA512: 7157566c1639c63ce0fba2832e8e5e846e689d89e24077ed7769b721c5db4613cd7fd8d91464992eb78de74b42912ca877e7182a9c3c9c8848bf94d89767b8cc
AFAIK the term
sighash
usually refers to theSIGHASH_x
flags. However thesighash
module provides tools for actually signing the transactions. (I vaguely remember getting confused about this.)Alternative names:
sign
tx_sign
/sign_tx
signing
transaction_signing
I think I like
sign_tx
the most, feel free to suggest others.Also
*SighashType
andAnnex
belong to something like primitives.The text was updated successfully, but these errors were encountered: