Post
Topic
Board Development & Technical Discussion
Re: Why do you think G/2 is so strange?
by
AlexanderCurl
on 04/01/2023, 10:45:56 UTC
Quote
how do you find such point with x having many leading zeros and the corresponding scalar?
I name it pt0 for convenient

do you start from it and randomly pick a scalar that point pt0/scalar = G  ?

or inversely fix a random G and randomly  generate a scalar k unless you find a point with x having sufficient leading zero?


First off I have visual generator my WebServer. You can set any scalar from secp256k1 range and it will generate subgroup in full correspondence to secp256k1 subgroup.
Secondly all group operation with points(addition, doubling, scalar_multiplication, subtraction, division) are isomorphic to (Zp,+,*) where we fix p as secp256k1 n.

N = 115792089237316195423570985008687907852837564279074904382605163141518161494337
lambda1 = 37718080363155996902926221483475020450927657555482586988616620542887997980018
lambda2 = 78074008874160198520644763525212887401909906723592317393988542598630163514318
   
def multiplicative_inverse(x, m):
    return pow(x, m - 2, m)
   
def additive_inverse(a):
    return N - a
   
def add(a, b): #addition
    return (a + b) % N

def sub(a, b): #subtraction
    return (a + additive_inverse(b)) % N

def mul(a, b): #multiplication
    return (a * b) % N
   
def div(a, b): #division
    return (a * multiplicative_inverse(b, N)) % N

print(div(1, 61168582499785340698020811768434254152333414806039741990912550463524917977698))
print(div(57896044618658097711785492504343953926418782139537452191302581570759080747169,
61168582499785340698020811768434254152333414806039741990912550463524917977698))