The hashes from the new PrecomputeHasher sub-classes in the 9-tr-sighash branch can be cached for use across input signature hashes. A new PrecomputedSignatureHashes class can hold data for signature hashes and provide both double hashes (non-taproot) and single hashes (taproot).
The new cache objects can be carried by a Transaction and passed to the WitnessSignatureHasher and TaprootSignatureHasher classes. When a transaction is signed, the object can be passed to the new Transaction object to retain the cached signatures between signings. A new object can be constructed for new Transaction objects from the addInput() and addOutput methods with the invalidated hashes removed.
PrecomputedSignatureHashes was created in 5fd4bf8daa4209d7ed5256b712253218b21e84aa but needs to be listed into Transaction to cache hashes between signings.
The hashes from the new
PrecomputeHasher
sub-classes in the9-tr-sighash
branch can be cached for use across input signature hashes. A newPrecomputedSignatureHashes
class can hold data for signature hashes and provide both double hashes (non-taproot) and single hashes (taproot).The new cache objects can be carried by a
Transaction
and passed to theWitnessSignatureHasher
andTaprootSignatureHasher
classes. When a transaction is signed, the object can be passed to the newTransaction
object to retain the cached signatures between signings. A new object can be constructed for newTransaction
objects from theaddInput()
andaddOutput
methods with the invalidated hashes removed.