0

Is there a direct non-iterative formula for point multiplication by 3 in the secp256k1 elliptic curve just like point multiplication by 2 (point doubling)? If such a formula exists, could you explain how to achieve this? If not, could you clarify why it's not possible?

Favour
  • 41
  • 5

1 Answers1

3

A simple way to derive a point tripling method in Cartesian coordinates for secp256k1 is per $3P=(2P)+P$, and towards this

p = 2**256-2**32-977

def triple(x:int, y:int): if x==0 or y==0: return 0,0 # point at infinity X = x2 w = 3X R = 2y2 % p Z = 4yR % p u = RR B = ((x+R)2-X-u) % p h = (w2-2B) % p X = 2hy % p Y = (w(B-h)-2u) % p u = yZ-Y % p v = xZ-X % p w = v2 R = wX % p w = vw % p A = (u2Z-w-2R) % p h = pow(wZ,-1,p) return vAh % p, (u(R-A)-wY)h % p

I don't claim that's optimal.

fgrieu
  • 149,326
  • 13
  • 324
  • 622