Bitcoin Forum
June 13, 2024, 11:55:59 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Re: How to define which coordinate is negative? on: January 10, 2023, 08:41:09 AM
pk1 = '02C6047F9441ED7D6D3045406E95C07CD85C778E4B8CEF3CA7ABAC09B95C709EE5'#private key=2
pk2 = '022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4'#private key=5


P = pub2point(pk1)
Q = pub2point(pk2)

eq = P.x == Q.x
lt = P.x < Q.x
R = eq or lt
print(R)

>>>>>>>.false


Q is big because it is private key 5 but im getting false output


Since you know the private keys, and you want to sort by private keys, then you must compare the private keys.

You should only compare X points if you want to sort by public key. But since you want to compare by private keys, you have to compare the private keys themselves.

There is no way to order a list of private keys using only their public keys - it is like trying to order a list of strings based on their SHA256 hashes - that is impossible.



hi can you please tell me how to find the publickey of btc address
2  Bitcoin / Development & Technical Discussion / Re: Pubkey scaling/subtracting/other tips for reducing search time on: August 03, 2022, 05:34:38 AM
I'm not sure of the significance of these numbers so maybe a backstory on how you came about these numbers could be useful. Does it make the overall search time faster?  Huh

Those numbers are factors of secp256k1 modified order

n    = 115792089237316195423570985008687907852837564279074904382605163141518161494337 (prime number)
n-1 = 115792089237316195423570985008687907852837564279074904382605163141518161494336 (composite number)

factorisation of n-1 into primes: 2*2*2*2*2*2 * 3 * 149 * 631 * 107361793816595537 * 174723607534414371449 * 341948486974166000522343609283189

18051648 = 2*2*2*2*2*2 * 3 * 149 * 631
9025824   = 2*2*2*2*2 * 3 * 149 * 631
6017216   = 2*2*2*2*2*2 * 149 * 631

and so on

I don't see any special magic here. In fact, BTC's real private key can be divisible by any prime number and also can be prime by itself. Due to the fact that secp256k1 is a cyclic group, we cannot check whether the result of dividing an unknown number (public key) is an integer or a fraction (in real math, outside of cyclic group), so we cannot make any meaningful conclusions from the results obtained.


CAN YOU PLEASE TELL ME HOW YOU ARE SELECTING THOSE PRIME NUMBERS CORRECTLY.


CAN YOU PROVIDE ME SOME EXAMPLE 447,596


THANKS
3  Bitcoin / Development & Technical Discussion / Re: Pubkey scaling/subtracting/other tips for reducing search time on: July 29, 2022, 01:21:07 PM
from fastecdsa import curve
from fastecdsa.point import Point
import bit

G = curve.secp256k1.G
N = curve.secp256k1.q
DIV = '02AE3482B19E840288CC9B302AD9F5DC017AB796D3690CC8029017A8AF3503BE8E'
pubkey = '03ec0f4d728d248698a59d3a50a0469da06fdb8019700dfc5de9eae2dd93fc2bc8'

def pub2point(pub_hex):
    x = int(pub_hex[2:66], 16)
    if len(pub_hex) < 70:
        y = bit.format.x_to_y(x, int(pub_hex[:2], 16) % 2)
    else:
        y = int(pub_hex[66:], 16)
    return Point(x, y, curve=curve.secp256k1)


Q = pub2point(pubkey)
R = pub2point(DIV)
z= Q / R

print(z)


-----------------------------------------
>>>    z= Q / R
TypeError: unsupported operand type(s) for /: 'Point' and 'Point'




CAN ANYONE HELP,HOW TO CORRECT THIS

THANKS
4  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: July 29, 2022, 12:52:58 PM
from fastecdsa import curve
from fastecdsa.point import Point
import bit

G = curve.secp256k1.G
N = curve.secp256k1.q
DIV = '02AE3482B19E840288CC9B302AD9F5DC017AB796D3690CC8029017A8AF3503BE8E'
pubkey = '03ec0f4d728d248698a59d3a50a0469da06fdb8019700dfc5de9eae2dd93fc2bc8'

def pub2point(pub_hex):
    x = int(pub_hex[2:66], 16)
    if len(pub_hex) < 70:
        y = bit.format.x_to_y(x, int(pub_hex[:2], 16) % 2)
    else:
        y = int(pub_hex[66:], 16)
    return Point(x, y, curve=curve.secp256k1)


Q = pub2point(pubkey)
R = pub2point(DIV)
z= Q / R

print(z)


-----------------------------------------
>>>    z= Q / R
TypeError: unsupported operand type(s) for /: 'Point' and 'Point'




CAN ANYONE HELP,HOW TO CORRECT THIS

THANKS
5  Bitcoin / Development & Technical Discussion / Re: Pubkey scaling/subtracting/other tips for reducing search time on: July 28, 2022, 04:36:09 AM
you just explained that it has already been spend found. whe testing that key or what, what addition to add if found to get the right pvk. address. thanks



This is another good example with privrange ( ((2^60) - 986458768829923488 ) pubkey:



0x db09b0615ad40a0 * 038141a3381c97660163ce69acf22d5a0cc8c09fcbb624fa556ff17629b4b31918

=

0348e843dc5b1bd246e6309b4924b81543d02b16c8083df973a89ce2c7eb89a10d(this is has a range 2^60 (address - 1Kn5h2qpgw9mWE5jKpk8PP4qvvJ1QVy8su))


This is a part of privkey - 986458768829923488 in hex db09b0615ad40a0.



No one can't find a privkey of 038141a3381c97660163ce69acf22d5a0cc8c09fcbb624fa556ff17629b4b31918 ?  Roll Eyes



dec = 104856515000339101452906010972016177983340459646873053037069757574992766929113

hex = E7D2AF2FC9FF9CAF795D2EED256567679873FC547A513AA85A8A2E2776AB88D9

pubkey = 038141a3381c97660163ce69acf22d5a0cc8c09fcbb624fa556ff17629b4b31918

can any one know how he found this.

thanks
6  Bitcoin / Bitcoin Discussion / Re: 120 puzle. Share 1.2 BTC 50/50 !!! ASAP Please !!! on: July 27, 2022, 06:20:15 AM
On My GPUs showing about 180 Days at 14B Keys Second

Check out the Image: https://imgur.com/a/hNSfTEj

i am new here can any one tell me what is 120bit key, in normal its 256bit right but how you all getting 120bit.
7  Bitcoin / Development & Technical Discussion / Re: How to define which coordinate is negative? on: July 24, 2022, 05:17:49 PM


all points with lowest Y-coordinate are odd and with highest are even.

can you please explain this how you are saying odd or even.
8  Bitcoin / Development & Technical Discussion / Re: How to define which coordinate is negative? on: July 24, 2022, 06:18:03 AM
pk1 = '02C6047F9441ED7D6D3045406E95C07CD85C778E4B8CEF3CA7ABAC09B95C709EE5'#private key=2
pk2 = '022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4'#private key=5


P = pub2point(pk1)
Q = pub2point(pk2)

eq = P.x == Q.x
lt = P.x < Q.x
R = eq or lt
print(R)

>>>>>>>.false


Q is big because it is private key 5 but im getting false output


Since you know the private keys, and you want to sort by private keys, then you must compare the private keys.

You should only compare X points if you want to sort by public key. But since you want to compare by private keys, you have to compare the private keys themselves.

There is no way to order a list of private keys using only their public keys - it is like trying to order a list of strings based on their SHA256 hashes - that is impossible.


thanks sir!!

is there any way to find private key range
first half below this(57896044618658097711785492504343953926418782139537452191302581570759080747168) or
second half above this(57896044618658097711785492504343953926418782139537452191302581570759080747168) using public key
9  Bitcoin / Development & Technical Discussion / Re: How to define which coordinate is negative? on: July 24, 2022, 05:47:08 AM
comparing two public key im trying to find which one big or small

is there any alternative way to do this ,already pm you my code

please help!

Well you should split up this operation

Code:
R = P <= Q

You should make it:

Code:
eq = P.x == Q.x
lt = P.x < Q.x
R = eq or lt

You cannot directly compare two Point classes. Read this page to understand why: https://crypto.stackexchange.com/questions/98189/how-to-prove-that-an-elliptic-curve-point-is-smaller-or-greater-than-half-of-the

Quote from: the answer in the link above
If there were a polynomial time solution[1] then this would provide a polynomial time solution to the elliptic curve discrete logarithm problem. We strongly believe this not to be the case.
...

[1] They are talking about a similar problem, where you find if the point is on the smaller half or bigger half of the private key range. But this discussion is why you cannot check two Point classes for Less Than - because their private keys are unknown.



To work around this, you should compare the X coordinates directly.

This will tell you if the X points are smaller or bigger, and allows you to order the public keys by characteristic P (instead of by private key order N).

P.S. I would appreciate it if you post the questions about the code inside this thread only, posting the same thing in the thread *and* in my PM mailbox is a bit annoying because I am already watching this thread.




pk1 = '02C6047F9441ED7D6D3045406E95C07CD85C778E4B8CEF3CA7ABAC09B95C709EE5'#private key=2
pk2 = '022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4'#private key=5


P = pub2point(pk1)
Q = pub2point(pk2)

eq = P.x == Q.x
lt = P.x < Q.x
R = eq or lt
print(R)

>>>>>>>.false


Q is big because it is private key 5 but im getting false output
10  Bitcoin / Development & Technical Discussion / Re: How to define which coordinate is negative? on: July 23, 2022, 12:26:38 PM
all points with lowest Y-coordinate are odd and with highest are even. and if we could calculate exact position of point in this group there could be a correlation
to secp256k1 subgroup S={G,2G,3G,...,(N-1)G}.
but secp256k1 P-N is 432420386565659656852420866390673177326 more than 2^128 since not all values of P can become X-coordinate.

The last part effectively rules out dividing the Y by 2 and discarding the fractional part, to attempt to discern the subranges of X (e.g. between 0,2^64-1 and 2^64,2^128-1)

hi is there any way to find private key range using public key

pk1 = '022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4'

pk2 = '02C6047F9441ED7D6D3045406E95C07CD85C778E4B8CEF3CA7ABAC09B95C709EE5'

pk1<=pk2
false


any python code useful for me
im getting below error

typeerror ' ' not supported between instances of 'point' and 'point'

Are you sure you are using this code smapl, because this error message looks funny - there are no point types in this code.



comparing two public key im trying to find which one big or small

is there any alternative way to do this ,already pm you my code

please help!
11  Bitcoin / Development & Technical Discussion / Re: How to define which coordinate is negative? on: July 23, 2022, 05:53:57 AM
if we consider the entire points group like this:
from lowest possible X
(1)X:0000000000000000000000000000000000000000000000000000000000000001 Y:4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee
(2)X:0000000000000000000000000000000000000000000000000000000000000001 Y:bde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441
(3)X:0000000000000000000000000000000000000000000000000000000000000002 Y:66fbe727b2ba09e09f5a98d70a5efce8424c5fa425bbda1c511f860657b8535e
(4)X:0000000000000000000000000000000000000000000000000000000000000002 Y:990418d84d45f61f60a56728f5a10317bdb3a05bda4425e3aee079f8a847a8d1
...
to highest possible X
(.)X:fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2c Y:0e994b14ea72f8c3eb95c71ef692575e775058332d7e52d0995cf8038871b67d
(.)X:fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2c Y:f166b4eb158d073c146a38e1096da8a188afa7ccd281ad2f66a307fb778e45b2

all points with lowest Y-coordinate are odd and with highest are even. and if we could calculate exact position of point in this group there could be a correlation
to secp256k1 subgroup S={G,2G,3G,...,(N-1)G}.
but secp256k1 P-N is 432420386565659656852420866390673177326 more than 2^128 since not all values of P can become X-coordinate.

Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240
Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424
P = 115792089237316195423570985008687907853269984665640564039457584007908834671663
N = 115792089237316195423570985008687907852837564279074904382605163141518161494337
#print(P-N)432420386565659656852420866390673177326
    #2^128 340282366920938463463374607431768211456
#input()
starting_x = 0x0
p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
beta  = 0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee
beta2 = 0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40

def oncurve(x,y): # Checks if point satifies x^3 +7 = y^2 , mod P
  x = (x*x*x+7) % p
  y = (y*y) % p
  return x==y
  
while starting_x < p:
    x = starting_x
    ysquared = ((x*x*x+7) % p)      
    y1 = pow(ysquared, (p+1)//4, p)
    y2 = (y1 * -1) % p
    if (y1**2) % p == (x**3 + 7) % p:
        print(f"Secp256k1 True X Coordinate: {hex(x)[2:].zfill(64)} [{x}]")
        print(f'{hex(x)[2:].zfill(64)}:{hex(y1)[2:].zfill(64)}')
        print( oncurve( x,int(hex(y1)[2:].zfill(64), 16)) )
        print(f'{hex(x)[2:].zfill(64)}:{hex(y2)[2:].zfill(64)}')
        print( oncurve( x,int(hex(y2)[2:].zfill(64), 16)) )
        print(hex((x*beta) % p)[2:].zfill(64))
        print(hex((x*beta2) % p)[2:].zfill(64))
        print('---------------------------------------------------------------------------------------------------------------------------------')
    starting_x += 1

hi is there any way to find private key range using public key

pk1 = '022f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4'

pk2 = '02C6047F9441ED7D6D3045406E95C07CD85C778E4B8CEF3CA7ABAC09B95C709EE5'

pk1<=pk2
false


any python code useful for me
im getting below error

typeerror ' ' not supported between instances of 'point' and 'point'
12  Bitcoin / Development & Technical Discussion / Re: How to define which coordinate is negative? on: July 21, 2022, 06:11:51 AM

lets guess
P1 is Even
P2 is Odd

post your guess and lets get answer in private key from creator
Smiley

it was first what i checked.  It is not correlated (

PK is 96, but i try to test how much participant , no one interested, as they loose hopes, maximum newbie apear and start trying brute force or kanagroo, vantisearch etc
Enjoy your time

hi @brainless

is there any way to guess private key odd or even using public key
13  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: July 16, 2022, 01:47:19 PM
Here is no magic, here is script to shiftdown pubkey:
Code:
import random
import math
import hashlib
import base58
def inverse(x, p):
    """
    Calculate the modular inverse of x ( mod p )    
    """
    inv1 = 1
    inv2 = 0
    n=1
    while p != 1 and p!=0:        
        quotient = x // p
        
        inv1, inv2 = inv2, inv1 - inv2 * quotient
        x, p = p, x % p        
        n = n+1
    
    return inv2

def dblpt(pt, p):
    """
    Calculate pt+pt = 2*pt
    """
    if pt is None:
        return None
    (x,y)= pt
    if y==0:
        return None
    
    slope= 3*pow(x,2,p)*pow(2*y,p-2,p)
    
    
    xsum= pow(slope,2,p)-2*x
    
    ysum= slope*(x-xsum)-y  
    
    return (xsum%p, ysum%p)

def addpt(p1,p2, p):
    """
    Calculate p1+p2
    """
    if p1 is None or p2 is None:
        return None
    (x1,y1)= p1
    (x2,y2)= p2
    if x1==x2:
        return dblpt(p1, p)
        
    # calculate (y1-y2)/(x1-x2)  modulus p
    
    slope=(y1-y2)*pow(x1-x2,p-2,p)
    
    
    xsum= pow(slope,2,p)-(x1+x2)
  
    ysum= slope*(x1-xsum)-y1
    
    
    return (xsum%p, ysum%p)

def ptmul(pt,a, p):
    """
    Calculate pt*a
    """
    scale= pt    
    acc=None
  
    
    while a:
        
        if a&1:
            if acc is None:
                acc= scale
                
            else:    
                acc= addpt(acc,scale, p)                
              
        scale= dblpt(scale, p)
        a >>= 1
        
            
  
    return acc

def ptdiv(pt,a,p,n):  
    """
    Calculate pt/a
    """  
    divpt=inverse(a, n)%n    
    return ptmul(pt, divpt, p)


def isoncurve(pt,p):
    """
    returns True when pt is on the secp256k1 curve
    """
    (x,y)= pt
    return (y**2 - x**3 - 7)%p == 0


def getuncompressedpub(compressed_key):
    """
    returns uncompressed public key
    """
    y_parity = int(compressed_key[:2]) - 2    
    x = int(compressed_key[2:], 16)
    a = (pow(x, 3, p) + 7) % p
    y = pow(a, (p+1)//4, p)    
    if y % 2 != y_parity:
        y = -y % p        
    return (x,y)

def compresspub(uncompressed_key):
    """
    returns uncompressed public key
    """
    (x,y)=uncompressed_key
    y_parity = y&1
    head='02'
    if y_parity ==1:
        head='03'    
    compressed_key = head+'{:064x}'.format(x)      
    return compressed_key

def hash160(hex_str):
    sha = hashlib.sha256()
    rip = hashlib.new('ripemd160')
    sha.update(hex_str)
    rip.update( sha.digest() )    
    return rip.hexdigest()  # .hexdigest() is hex ASCII
    
def getbtcaddr(pubkeyst):
    
    hex_str = bytearray.fromhex(pubkeyst)
    # Obtain key:
    key_hash = '00' + hash160(hex_str)

    # Obtain signature:

    sha = hashlib.sha256()
    sha.update( bytearray.fromhex(key_hash) )
    checksum = sha.digest()
    sha = hashlib.sha256()
    sha.update(checksum)
    checksum = sha.hexdigest()[0:8]

    return (base58.b58encode( bytes(bytearray.fromhex(key_hash + checksum)) )).decode('utf-8')

def checkpub(realpub, temppub, id):
    localpt = ptmul(temppub, 1024, p)
    localaddpt = ptmul(g, id, p)
    respub= addpt(localpt,localaddpt, p)
    print ("respub-> ", compresspub(respub))
    
#secp256k1 constants
Gx=0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
Gy=0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
n=0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
p = 2**256 - 2**32 - 977
g= (Gx,Gy)


compressed_key='0234c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf'
point=getuncompressedpub(compressed_key)

print(getbtcaddr("04%064x%064x"%point))
print(getbtcaddr(compressed_key))
divisor = 2**3
newpub=ptdiv(point,divisor,p,n)

(partGx,partGy)=ptdiv(g,divisor,p,n)
print ("1 Fraction part-> (%x,%064x)" % (partGx,partGy))

with open('pub.txt', 'w') as f:
    f.write("04%064x%064x"%newpub)
    f.write('\n')
    print ("Compressed NewPUB (",0,")-> ", compresspub(newpub),"addr",getbtcaddr(compresspub(newpub)))
    i=1
    (pointx,pointy)=(partGx,partGy)
    while i<divisor:
        (newpubtempx,newpubtempy) = addpt(newpub,(pointx,p-pointy), p)
        f.write("04%064x%064x"%(newpubtempx,newpubtempy))
        f.write('\n')
        print ("Compressed NewPUB (",i,")-> ", compresspub((newpubtempx,newpubtempy)),"addr",getbtcaddr(compresspub((newpubtempx,newpubtempy))))
        (pointx,pointy) = addpt((pointx,pointy),(partGx,partGy), p)  
        i=i+1

  



In this example i use pubkey  0234c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf, privkey is 0x67 and upper range is 2^7
Divisor is 2^3, so new upper range is 2^7-2^3=2^4
In file pub.txt you will find all pubkeys and their number is equil to divisor.
if you try to find all this keys in range 0x1:0xf you will see that only one pubkey will be lie in range
And this pubkey is 03d01115d548e7561b15c38f004d734633687cf4419620095bc5b0f47070afe85a with privkey 0xC
To produce real privkey need multiply privkey by divisor
0xC*0x8 = 0x60
After this need add to result founded public key number (7)
Totaly privekey = 0x60 +0x7=0x67



can you please tell me how to increase the upper range in this code
14  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: July 16, 2022, 05:14:47 AM
This makes actually no sense, because the underlying principle is different.

example:

Puzzle 11
https://privatekeys.pw/key/0000000000000000000000000000000000000000000000000000000000000483

038b05b0603abd75b0c57489e451f811e1afe54a8715045cdf4888333f3ebc6e8b

halving the publickey:
03dcaaaaea9e3b34b36c5e029abaf3028b39124ba8b90b0b7480256e10630052f2
02c2ee47ca8e17112fa255a52021ffd30b6d7a3b7e2341526c559b60a9c768013d

03dcaaaaea9e3b34b36c5e029abaf3028b39124ba8b90b0b7480256e10630052f2 is the result, when the privatekey of puzzle 11 is even and
02c2ee47ca8e17112fa255a52021ffd30b6d7a3b7e2341526c559b60a9c768013d if the the privatekey of puzzle 11 is odd.

02c2ee47ca8e17112fa255a52021ffd30b6d7a3b7e2341526c559b60a9c768013d is the correct one, as the privatekey of puzzle 11 is odd  
02c2ee47ca8e17112fa255a52021ffd30b6d7a3b7e2341526c559b60a9c768013d is https://privatekeys.pw/key/0000000000000000000000000000000000000000000000000000000000000241

So if you do 02c2ee47ca8e17112fa255a52021ffd30b6d7a3b7e2341526c559b60a9c768013d + 02c2ee47ca8e17112fa255a52021ffd30b6d7a3b7e2341526c559b60a9c768013d, you get 038b05b0603abd75b0c57489e451f811e1afe54a8715045cdf4888333f3ebc6e8b (untested, I guess you need also adding the Generatorpoint for + 1 as we do 241 + 241 + 1 = 483)

So what is 03dcaaaaea9e3b34b36c5e029abaf3028b39124ba8b90b0b7480256e10630052f2 then? It is 241.5.
241.5 + 241.5 = 483

So, where do we find 241.5?

https://privatekeys.pw/key/7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b1e5f

How did I find it? key middle range minus half of our privatekey: 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0 - 0x241 => tada

So from complexity of 11 bits, i just needed to check 10 bits now.

If I divide by 32, I actually do what?

2 * 2 * 2 * 2 * 2 = 32

So we are halving the public key 5 times. This means, that when we do this on key 11, we get 32 keys, from where one of them has the correct endsequence of the private key. So we have to check all keys if they are in the range of 2^6. If we get one, than we know how the first 6 bits of the privatekey are. We can from here determine the last 5 bits easily. I am not interested in the other ranges, as i have now a total valid privatekey



i m little bit confused can you please provide me some example
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!