Skip to content

[Feature] Integer square root#3052

Draft
d0cd wants to merge 2 commits into
stagingfrom
feat/integer-square-root
Draft

[Feature] Integer square root#3052
d0cd wants to merge 2 commits into
stagingfrom
feat/integer-square-root

Conversation

@d0cd
Copy link
Copy Markdown
Collaborator

@d0cd d0cd commented Dec 6, 2025

This PR introduces:

  • console and circuit implementations of integer square root.

Resource: https://en.wikipedia.org/wiki/Integer_square_root

TODO:

  • Integrate into opcodes
  • Guard by consensus version
  • Soundness analysis
  • Optimizations
    • (x + 1)^2 > y ==> x^2 + 2x + 1 > y ==> 2x + 1 > y - x^2 (checked subtraction)
    • x^2 <= y ==> 0 <= y - x^2

@d0cd d0cd changed the title [Feature] Integer square root. [Feature] Integer square root Dec 6, 2025
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

Successfully merging this pull request may close these issues.

1 participant