Commit Graph

2 Commits

Author SHA1 Message Date
Tobin C. Harding 4300cf2210
Add p2wpkh and p2wsh signature hash functions
The word "segwit" refers to segwit v0 and taproot but currently we have
`segwit_signature_hash` that is version specific (segwit v0).

- Rename `segwit_encode_signing_data_to` to
  `segwit_v0_encode_signing_data_to`
- Add `p2wpkh_signature_hash` and `p2wsh_signature_hash` functions

We keep the single encode function because the error handling is better
that way.

While we are at it test the bip-143 test vectors against all the
sighash types of wrapped p2wsh.
2023-08-15 11:54:08 +10:00
Alec Matusis fc167097aa Added examples for sighash computations
So far computed sighashes for:
 - P2WPKH
 - P2MS
 - P2SH multisig
 - P2WSH multisig.

TODOs:
  - Add P2TR script-path multisig and key-path examples
2023-06-20 02:07:21 -07:00