Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precomputed signature hash caching #21

Open
MatthewLM opened this issue Sep 30, 2023 · 1 comment
Open

Precomputed signature hash caching #21

MatthewLM opened this issue Sep 30, 2023 · 1 comment

Comments

@MatthewLM
Copy link
Collaborator

MatthewLM commented Sep 30, 2023

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.

@MatthewLM
Copy link
Collaborator Author

PrecomputedSignatureHashes was created in 5fd4bf8 but needs to be listed into Transaction to cache hashes between signings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant