Commit Graph

4 Commits

Author SHA1 Message Date
Tobin C. Harding e1869340be
Upgrade secp dependency
Upgrade `rust-secp256k1` to the latest version `v0.29.0`. This removes
the duplicate deps as well.
2024-04-03 09:24:41 +11:00
Tobin C. Harding 6715e93e89
Add Witness::p2tr_key_spend function
Add a function for creating the witness when doing a key path spend for
a P2TR output.

This mirrors what we did for P2WPKH when adding `Witness::p2wpkh`.

Includes update to the taproot signing example to use the new constructor.
2024-01-24 15:21:31 +11:00
Tobin C. Harding 271b45299f
Improve Signature field names
Applies to both `ecdsa::Signature` and `taproot::Signature`.

Re-name the `Signature` fields with more descriptive names. The
names used were decided upon in the issue discussion.

Impove rustdocs while we are at it.

Note, the change to `sign-tx-segwit-v0` is refactor only, the diff does
not show it but we have a local variable already called `sighash_type`
that is equal to `EcdsaSighashType::All`.

Includes a function argument rename as well, just to be uniform.

Fix: #2139
2024-01-15 10:26:40 +11:00
Tobin C. Harding fa104aefa5
bitcoin: Add signing examples
Add two signing examples to showcase signing a simple one input two
output transaction using both segwit v0 outputs and taproot outputs.

This patch is the result of the recent rust-bitcoin TABConf workshop,
wit bug fix by Sanket, updated to use APIs from tip of master branch.

This code, depending on v0.30.0 is what is being introduced to the
cookbook at the moment.
2023-10-31 10:11:48 +11:00