Commit b2da197
committed
tx: add segwit v0 support to the caching signature hash helpers
Segwit uses SHA-256D instead of taproot's SHA-256 for commitments.
Support this by using a flag on cache keys indicating a double hash is
required.
Update the various functions that hash portions of the tx data to
support the segwit v0 variant (in many cases the same data, just double
hashed).
Note that Elements taproot hashes some data in a different order, which
makes this change more painful than it should be. It also makes it
impossible to cleanly/automatically cache taproot data when generating
segwit data and vice-versa, meaning mixed segwit v0 and taproot
transactions are less efficient than they could potentially be
otherwise.1 parent 9c9fce6 commit b2da197
1 file changed
+126
-68
lines changed
0 commit comments