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.
The hashes from the new
PrecomputeHashersub-classes in the9-tr-sighashbranch can be cached for use across input signature hashes. A newPrecomputedSignatureHashesclass 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
Transactionand passed to theWitnessSignatureHasherandTaprootSignatureHasherclasses. When a transaction is signed, the object can be passed to the newTransactionobject to retain the cached signatures between signings. A new object can be constructed for newTransactionobjects from theaddInput()andaddOutputmethods with the invalidated hashes removed.