Bitcoin Forum
May 17, 2024, 07:05:02 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Keyspace and Bitcoin Addresses  (Read 501 times)
ecdsa123
Full Member
***
Offline Offline

Activity: 211
Merit: 105

Dr WHO on disney+


View Profile
November 07, 2023, 07:53:56 PM
Merited by vjudeu (1)
 #21

If we are talking about space .. first we need understand , there are no 2**256 public key.

there are a lot of less than we think.


Code:

import random
import sys

p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f

n = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141

E = EllipticCurve(GF(p), [0, 7])

G = E.point( (0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8))   # Base point


for i in range(1,256):
    try:
       
        d=E.lift_x((2**i))
        print("found point",d)
    except:
        print("sorry, there is no point on curve with x=",2**i)


Donate: bc1q0sezldfgm7rf2r78p5scasrrcfkpzxnrfcvdc6

Subscribe : http://www.youtube.com/@Ecdsa_Solutions
ymgve2
Full Member
***
Offline Offline

Activity: 161
Merit: 230


View Profile
November 08, 2023, 04:54:41 AM
 #22

There are exactly 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140 public keys, as per the definition of the curve.

There are therefore 2**256 - 0x14551231950b75fc4402da1732fc9bec0 keys, and while the second number seems large, it's insignificantly small compared to the full keyspace.
Pages: « 1 [2]  All
  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!