kevaundray
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Halving a point on the bandersnatch curve ## Introduction Considering the case of when $(\frac{a}{p})=(\frac{d}{p})=-1$ and $p \equiv \text{1 mod 4}$. This document derives the halving formula and its necessary conditions. This is derived from [Bessalov's work](https://core.ac.uk/download/pdf/146445895.pdf). Some of his work has been translated to English, however it is unfortunately behind a paywall, so we link his monograph. ## What does it mean to halve a point? For a twisted Edwards curve, the formula for doubling a point $(x, y)$ is: $$2(x,y) = (\frac{2xy}{1+dx^2y^2},\frac{y^2-ax^2}{1-dx^2y^2}) = (X, Y) \text{ (0)}$$ This formula states that given a point $(x, y)$, we can produce $(X,Y)$ such that $2(x,y) = (x,y) +(x,y) = (X, Y)$ Halving a point is the opposite. ie given a point $(X, Y)$ we can compute a point $(x,y)$ such that $(X, Y) = 2(x,y)$. We will see later on that there can be multiple points $(x_i,y_i)$ for a given $(X,Y)$ if we are not in a prime order group; *halving is analogous to taking the square root, while doubling is analogous to squaring a number. The square root can have multiple results, while squaring a number has one result.* ### Theorem 1: $(\frac{1-dX^2}{p}) = (\frac{1-aX^2}{p})$ when $X$ is on the curve *Proof.* The curve equation is given as: $ax^2 + y^2 = 1+dx^2y^2$ $$ \rightarrow 1-ax^2 = y^2 - dx^2y^2$$ $$ \rightarrow 1-ax^2 = y^2(1-dx^2)$$ Hence for a point on the curve, $1-dx^2$ and $1-ax^2$ are either both squares or both non-squares. *Proof done.* # Outline We will first solve for the $X$ co-ordinate in equation 0. This will give us two quadratic equations that are only solvable when $1-aX^2$ and $1-dX^2$ are squares. This will be our first condition for a point to be halvable. By Theorem 1, either both equations are solvable or none of them are. The quadratic equations will give us 8 solutions that are all on the curve, but not all will be solutions to the doubling formula. We will narrow our solutions to 4 when we notice that one point being a solution, necessarily means that two points cannot be a solution. At this point, we can conclude that when $1-aX^2$ is a square, there are four solutions which when doubled will give a point with x co-ordinate $X$. $1-aX^2$ is a necessary condition to find solutions, however it is not a sufficient one since the $Y$ co-ordinate has not been used to constrain the solutions and the sign of the $X$ co-ordinate is ignored. $1-aX^2$ is nonetheless useful because if it is not a square, then the point is not halvable. The only points which are halvable on a non-cyclic twisted edwards curve of order $4p$, are points of order $p$. This check therefore can serve as a quick way to reject _some_ points of order $2p$. This will be important for banderwagon. One can substantiate the previous paragraph by noting that if $(X,Y)$ has order $p$ and thus passes the $1-aX^2$ check, then the points $(\pm X, \pm Y)$ will also pass the check and so with probability of a $\frac{1}{2}$ one can guess the point has order $p$ or $2p$. The second condition for determining whether $(X,Y)$ is halvable can be derived by plugging in the solutions from the quadratic equations into the doubling formula's $Y$ co-ordinate in equation 0. If a point $(X,Y)$ passes both conditions, then it has order $p$. ## Methodology ### Solving for $X$ The doubling formula has two equations for the $x$ co-ordinate we will use these to create two quadratic equations. The two equations are $\frac{2xy}{1+dx^2y^2}$ and $\frac{2xy}{ax^2 + y^2}$. **Case1:** Suppose: $$\frac{2xy}{1+dx^2y^2} = X$$ $\text{let } k = xy$ $$\rightarrow X(1 + dk^2) = 2k $$ $$\rightarrow (Xd)k^2 - 2k + X = 0 \text{ (1)}$$ Note that $X$ is a constant here, so we have a quadratic equation where the indeterminate variable is $k$, using the quadratic formula, we can write out the solutions as: $$ k_{1,2}= \frac{2 \pm \sqrt{4 - 4dX^2}}{2dX} $$ $$ \rightarrow \frac{1 \pm \sqrt{1 - dX^2}}{dX} \text{ (2)} $$ For the equation to be solvable $1-dX^2$ needs to be a square, ie $(\frac{1-dX^2}{p}) \neq -1$. **Case2:** Suppose: $$\frac{2xy}{ax^2 + y^2} = X$$ $\text{let } t = \frac{y}{x}$ $$ \frac{2\frac{y}{x}}{a + (\frac{y}{x})^2} = X$$ $$ \rightarrow \frac{2t}{a+t^2} = X$$ $$\rightarrow Xt^2 - 2t + aX = 0 \text{ (3)}$$ Similarly, we have a quadratic equation in $t$, we write out the solutions as: $$ t_{1,2} = \frac{2\pm\sqrt{4-4aX^2}}{2X}$$ $$ \rightarrow \frac{1\pm\sqrt{1-aX^2}}{X} \text{ (4)} $$ For the equation to be solvable $1-aX^2$ needs to be a square. For both equations 2 and 4 to be simultaneously solvable, we need $1-aX^2$ and $1-dX^2$ to be non-squares. Theorem 1 shows that this is the case when $X$ is on the curve, so either both equations are solvable or both equations are not solvable. *Note* $$t_1t_2 =a$$ $$k_1k_2 = \frac{1}{d}$$ Since $(\frac{a}{p})=(\frac{d}{p})=-1$, then $t_1$ or $t_2$ must be a non-residue, similarly $k_1$ or $k_2$ must be a non-residue. >Without loss of generality, we can assume that $t_1$ and $k_1$ are residues while $t_2$ and $k_2$ are non-residues. ### Summary so far If we have a random point $(X,Y)$ and we want to find a point $(x,y)$ which when doubled gives $(X,Y)$. At the very least $1-aX^2$ and $1-dX^2$ needs to be a square for such a point $(x,y)$ to even exist. ## Solving for Y From the doubling formula, we know that: $$ \frac{y^2-ax^2}{1-dx^2y^2} = Y$$ Expressing the above equation in terms of $t_{1,2}$ and $k_{1,2}$ will give us the second condition needed to determine if a point $(X,Y)$ can be halvable. $$ \frac{x^2(\frac{y^2}{x^2}-a)}{1-dx^2y^2} = Y$$ $$\rightarrow \frac{x^2(t_1^2-a)}{1-dk_1^2} = Y$$ $$\rightarrow (\frac{k_1}{t_1})\frac{t_1^2-a}{1-dk_1^2} = Y$$ Using equation 1 and 3, we know that $(Xd)k^2 - 2k + X = 0$ and $Xt^2 - 2t + aX = 0$ which implies that $2(1-\frac{k}{X}) = 1-dk^2$ and $t^2 -a = 2(\frac{t}{X} - a)$. Substituting: $$\rightarrow (\frac{k_1}{t_1})\frac{2(\frac{t_1}{X} - a)}{2(1-\frac{k_1}{X})} = Y$$ $$\rightarrow (\frac{k_1}{t_1})\frac{\frac{t_1}{X} - a}{1-\frac{k_1}{X}} = Y$$ $$\rightarrow (\frac{k_1}{t_1})\frac{t_1 - aX}{X-k_1} = Y$$ $$\rightarrow k_1(t_1 - aX) = Yt_1(X-k_1)$$ The last equation is the second check needed to ensure that a point is halvable. ie given an $(X,Y)$ if $1-aX^2$ is a square, then we have solutions. If those solutions also pass the $k_1(t_1 - aX) = Yt_1(X-k_1)$ check, then they are solutions to the doubling formula. ## Finding solutions After checking that a point $(X,Y)$ is halvable and finding the solutions $t_{1,2}, k_{1,2}$ to the quadratic equations. We find 8 potential solutions using the following two equations: $$(x_1^2,y_1^2) = (t_1k_1,\frac{k_1}{t_1})$$ $$(x_2^2,y_2^2) = (t_2k_2,\frac{k_2}{t_2})$$ They will be of the form $(\pm x_1, \pm y_1)$, $(\pm x_2, \pm y_2)$ but note that not all of these solutions will be valid at the same time. Assume that $(x_1,y_1)$ is valid, then $x_1y_1 = k_1$. This cannot simultaneously be true for $(-x_1, y_1), (x_1, -y_1)$. It can still be true for $(-x_1, -y_1)$. This is intuitive since, if $(x,y)$ is a solution then any other solution can only differ by order 2 points. This implies that there are only four valid solutions $\{(x_1, y_1), (-x_1,-y_1), (x_2,y_2), (-x_2, -y_2)\}$. These points all satisfy the following relation: $2(x_1,y_1)=2(-x_1,-y_1)=2(x_2,y_2)=2(-x_2,-y_2) = (X, Y)$ due to the fact that they are solutions to the doubling formula and pass both checks. > **Remark**: To find all solutions we only need one solution. When examining the solutions, one shall see that $(x_1,y_1)$ and $(x_2,y_2)$ differ by $D_1$ or $D_2$ ## Examining the Four solutions Given that when $a$ and $d$ are non-squares and $p \equiv \text{ 1 mod 4}$, there are no points of order 4. One can see that the small order subgroup of such an edwards curve will be $E[2] =\{(0,1), D_0, D_1, D_2\}$. $D_0$ is the rational point of order 2, $D_1, D_2$ are exceptional points of order 2. $E[2]$ is then isomorphic to the Klein-4 group or $\mathbb{Z_2} \times \mathbb{Z_2}$. It follows that we can express the four solutions concretely as $P + E[2] = \{P, P+D_0, P+D_1, P+D_2 \}$. >**Remark**: If $[2]P = (X,Y)$ then doubling any of the points in $P + E[2]$ gives $(X,Y$) > **Note**: One only requires one solution in order to generate the others. ## What points are halvable? *For a twisted edwards curve of order $4n$ where $n$ is an odd prime. We will show that if the small order subgroup is non-cyclic, then only the points of order $n$ are halvable.* If the subgroup of size 4 is non-cyclic, then there are 3 points with order 2. The curve therefore contains $3(n-1)$ points with order $2n$ and $n-1$ points with order $n$. One can see that there exists exactly 3 points with order $2n$ that when doubled produces a point $P$ of order $n$. Moreover, there exists a single point in the subgroup of size $n$ that when doubled, gives you $P$. This follows from the fact that halving in a prime order group is the same as multiplying by a half, and also that doubling is injective when the group has an odd order. See [here](https://math.stackexchange.com/questions/522273/if-a-group-g-has-odd-order-then-the-square-function-is-injective/522277#522277). The above argument shows that there are always four points on the curve that will double to give a point of order $n$. One of the points will have order $n$ and the other $3$ will have order $2n$. Now lets say we have the following $2T_1 = T_2$. If we now assume that $T_2$ has order $2n$, then $T_1$ must have order $4n$. This is not possible as we know that all points have at most order $2n$, showing that points with order $2n$ are not halvable in the group, only points of order $n$. ## What does $(\frac{1-aX^2}{p})=1$ tell us about $(X,Y)$? **Non-square** If $1-aX^2$ is not a square, then $1-dX^2$ is not a square. This then means that there are no solutions for equations 2 and 4, and hence one cannot produce points which satisfy the doubling formula; $(X,Y)$ is not halvable. Moreover, when the subgroup of size 4 is non-cyclic, it implies that $(X,Y)$ does not have prime order $n$ by the previous section. **Square** If $1-aX^2$ is a square, then since $(\frac{1-aX^2}{p})=(\frac{1-dX^2}{p})$. This means that we can find solutions to the quadratics in equations 2 and 4. It does not mean that the point has order $n$. Observe that if this check passes for a point of order $n$ $(X,Y)$, it also passes for $\{(-X,-Y), (-X,Y), (X, -Y)\}$ , so with probability of $\frac{1}{2}$, the point has order $n$. Hence $(\frac{1-aX^2}{p})=1$ is true for $(\pm X,\pm Y)$ if $(X,Y)$ has prime order. It is easy to manually check that it is also true for the identity $(0,1)$ and the order 2 point $(0,-1)$. We can conclude that it is true for all points which do not differ by the points at infinity, and one is able to use it to reject points of the form $P+D_1$ or $P+D_2$ Assuming that $1-aX^2$ is a non-square for a point of order $n$, immediately arises a contradiction to the doubling formula for prime order groups. One can also check $P+E[2]$ and note the effect that adding $D_1$ or $D_2$ has on a point $(x,y)$: $$ P + E[2] = \{ P, P+ D_0, P+D_1, P+D_2\}$$ $$ P + E[2] = \{(x,y), (-x,-y), (\frac{1}{\sqrt{ad}}x^{-1}, \sqrt\frac{a}{d}y^{-1}),(-\frac{1}{\sqrt{ad}}x^{-1}, -\sqrt\frac{a}{d}y^{-1}) $$ ## Relevance to banderwagon The fact that $1-aX^2$ rejects the exceptional points and the fact that the elements in each set $\{(X,Y), (-X,-Y)\}$, $\{(-X,Y), (X,-Y)\}$ differ by only $D_0$ will allows us to create a quotient group of prime order.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully