Skip to content

Conversation

@j-berman
Copy link
Collaborator

@j-berman j-berman commented Sep 30, 2025

Used in sqrt implemented in FCMP++, which is used in this torsion_check_vartime.

torsion_check_vartime is part of an optimization* that wallets use to check outputs and commitments for torsion, before clearing torsion if they do indeed have torsion (most are expected to not have torsion, hence this optimization). Outputs in the tree cannot have torsion. Wallets build the tree locally, and therefore need to make sure torsioned outputs do not enter the tree.

*torsion_check_vartime is currently unproven. That is why the integration presently only uses it wallet-side in order to speed up wallet sync, and not at consensus. Wallet-side worst case is a DoS. Daemon-side worst case is inflation. Theoretically we could hold off on using it wallet-side until after the fork, at which point we ban torsioned outputs at consensus, and can therefore be certain the function works correctly for all pre-fork potentially torsioned outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants