ElementsProject / libwally-core

Useful primitives for wallets
Other
284 stars 136 forks source link

Add means to get 'hash prevouts' for a tx #284

Closed JamieDriver closed 1 year ago

JamieDriver commented 3 years ago

BIP 143 (https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki) defines 'hash_prevouts' for a transaction to commit the inputs being spent.
Jade and Ledger both use this value in computing deterministic blinding factors for the outputs of confidential elements transactions.
As it stands, Jade and the wallets, and in future gdk (if it is to use the same deterministic blinders) need to compute this value.
It would be more straightforward I think if it was calculated in one place - ie. in libwally.
Note: it is already calculated as part of tx_to_bip143_bytes(), so really just needs extracting/exposing.

jgriffiths commented 1 year ago

Merged in master along with the other calls for deterministic blinders, closing.