Bitcoin Forum
May 22, 2024, 04:20:15 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Verifying G on y² = x³ + 7 mod p  (Read 144 times)
Harald1970 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 5


View Profile
December 09, 2021, 08:12:50 PM
Merited by o_e_l_e_o (4), ABCbits (1)
 #1

Hi guys,

About the elliptic curve y² = x³ + 7 mod p Bitcoin uses:

As i understood base point G should be on that curve where point G should have the following coordinates:

x = 79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
y = 483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8

In decimal format:

x = 55066263022277343669578718895168534326250603453777594175500187360389116729240
y = 32670510020758816978083085130507043184471273380659243275938904335757337482424

and p should be:

2^256 – 2^32 – 977 = 115792089237316195423570985008687907853269984665640564039457584007908834671663

However, when I enter these values in the equation (y² = x³ + 7 mod p)

(32670510020758816978083085130507043184471273380659243275938904335757337482424)² mod 115792089237316195423570985008687907853269984665640564039457584007908834671663 = (55066263022277343669578718895168534326250603453777594175500187360389116729240)³ + 7 mod 115792089237316195423570985008687907853269984665640564039457584007908834671663

I come to a totally different conclusion.

Namely:

32748224938747404814623910738487752935528512903530129802856995983256684603122 =
1669770616981538039777298102996166657201110805898885633627016627799942916593334 7716953447757272370428515427513339781177865265195629184436663606848320359309455 8427352525126936769086968791554813695916119291254705683450242657305024007

So what did i do wrong?
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1526
Merit: 7401


Farewell, Leo


View Profile
December 09, 2021, 08:21:10 PM
Merited by o_e_l_e_o (4), ABCbits (3), garlonicon (2)
 #2

So what did i do wrong?
In here, you're mod-ing 7 with p instead of (x3 + 7) with p:

Quote
(55066263022277343669578718895168534326250603453777594175500187360389116729240)³ + 7 mod 115792089237316195423570985008687907853269984665640564039457584007908834671663

If you mod (x3 + 7) with p, you will, indeed, get:
Code:
32748224938747404814623910738487752935528512903530129802856995983256684603122

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
garlonicon
Hero Member
*****
Offline Offline

Activity: 806
Merit: 1940


View Profile
December 09, 2021, 08:24:29 PM
Merited by o_e_l_e_o (4)
 #3

Quote
1669770616981538039777298102996166657201110805898885633627016627799942916593334
7716953447757272370428515427513339781177865265195629184436663606848320359309455
8427352525126936769086968791554813695916119291254705683450242657305024007
Just use modulo on that number and it will be correct. You used modulo on x-value, but not on y-value, so they are obviously not equal.

Edit:
Quote
you're mod-ing 7 with p
You are right, using 7 modulo something bigger than 7 does not change anything.
Harald1970 (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 5


View Profile
December 09, 2021, 09:18:42 PM
 #4

Thank you guys! What harm a simple bracket at the wrong place can do!  Cool

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!