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

Assess and prevent Transaction malleability #179

Open
JoshOrndorff opened this issue Feb 15, 2024 · 0 comments
Open

Assess and prevent Transaction malleability #179

JoshOrndorff opened this issue Feb 15, 2024 · 0 comments

Comments

@JoshOrndorff
Copy link
Contributor

Malleability goes all the way back to bitcoin. The point is that UTXO IDs are based on the hash of the transaction that creates them. Sometimes you want to know the UTXO IDs that would be created by a given transaction so that you can construct a chain of off-chain transactions that will be signed and settled later (see htlcs or lightning network).

The Transaction IDs need to be based on stripped / simplified transactions, not concrete transactions with witness data filled in.

If you fill in the witness data first, then the hadh and thus the UTXO IDs created are malleable. Imagine an output that needs to be signed by alice. Modern signing algos use randomized initialization vectors, so there are many valid sigantures and thus many hashes.

OTOH if the transaction hash is calculated on the stripped transaction then the has and output ids are deterministic.

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