Bitcoin Forum
May 03, 2024, 09:47:28 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 »  All
  Print  
Author Topic: Point addition / Point concatenate  (Read 876 times)
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6726


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 26, 2021, 06:31:12 PM
Last edit: April 27, 2021, 08:49:49 AM by NotATether
 #21

here we are taking as hex
b+d =bd
where b is one point and d is 2nd point, result should be bd point in concatenation
for your easy dec result will be 189 not 1113

I guess you do understand that this concatenation you're doing is not point addition but rather a different operation (which makes me feel better), so now you're looking for math properties of this concatenation thing?

Well for starters the operation you're doing is equal to a*len(b)*4 16 + b [there are 4 bits in a hex char] in terms of the real addition so so you should be able to use it almost anywhere you need an Ax + B style expression.

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

Posts: 1714729648

View Profile Personal Message (Offline)

Ignore
1714729648
Reply with quote  #2

1714729648
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714729648
Hero Member
*
Offline Offline

Posts: 1714729648

View Profile Personal Message (Offline)

Ignore
1714729648
Reply with quote  #2

1714729648
Report to moderator
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 26, 2021, 08:15:24 PM
 #22

chinese remainder theorem

https://math.stackexchange.com/questions/317637/combine-two-given-elliptic-curves

any commnet related to our research ?

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 26, 2021, 11:52:50 PM
 #23

here we are taking as hex
b+d =bd
where b is one point and d is 2nd point, result should be bd point in concatenation
for your easy dec result will be 189 not 1113

I guess you do understand that this concatenation you're doing is not point addition but rather a different operation (which makes me feel better), so now you're looking for math properties of this concatenation thing?

Well for starters the operation you're doing is equal to a*len(b)*4 + b [there are 4 bits in a hex char] in terms of the real addition so so you should be able to use it almost anywhere you need an Ax + B style expression.
this is simple math operation to calc, a*len(b)*16 + b
but based on x,y points, there will be 2 snaorio, if concatenate under mod p, will be calculated, and result will apear on curve other not at curve, that will be apear based on point formula,
and if operation everything will be on curve always

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
bytcoin
Member
**
Offline Offline

Activity: 211
Merit: 20

$$$$$$$$$$$$$$$$$$$$$$$$$


View Profile
April 27, 2021, 11:55:12 AM
 #24

P + G = PG

hex prvkey is abc
x: 3ef30130654689a64c864d6dd38760481c55fc525e2c6c7084e2d2d3d4d51be9
y: f7d86b288c09ddb5311f292285168000e43e4b62201bd8de23a391daa8e00ce8

hex prvkey is def
x: 6a6e1dc6f203f7fdd97965892301e5fb995a37318c410543835f0edcd3456c49
y: 2a072b9898b93e9eb05f9ad86a97546d83b579bf6efd3482f93baca13784496b


result = hex prvkey is abcdef:

x: 12faae608bd6562562b8f85564664cd1fdcd667f6b24b2b221ef86b9231f4d74
y: 512ee8cd9b34331afd05ccb8d81d1393c150c73ec5695845b731f7e6e0086719

Let me see if I understand ....

Instead:

2 + 1 = 3
3 + 4 = 7

You want this:

2 + 1 = 21
3 + 4 = 34

?
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 27, 2021, 12:09:32 PM
 #25

P + G = PG

hex prvkey is abc
x: 3ef30130654689a64c864d6dd38760481c55fc525e2c6c7084e2d2d3d4d51be9
y: f7d86b288c09ddb5311f292285168000e43e4b62201bd8de23a391daa8e00ce8

hex prvkey is def
x: 6a6e1dc6f203f7fdd97965892301e5fb995a37318c410543835f0edcd3456c49
y: 2a072b9898b93e9eb05f9ad86a97546d83b579bf6efd3482f93baca13784496b


result = hex prvkey is abcdef:

x: 12faae608bd6562562b8f85564664cd1fdcd667f6b24b2b221ef86b9231f4d74
y: 512ee8cd9b34331afd05ccb8d81d1393c150c73ec5695845b731f7e6e0086719

Let me see if I understand ....

Instead:

2 + 1 = 3
3 + 4 = 7

You want this:

2 + 1 = 21
3 + 4 = 34

?
yes

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
bytcoin
Member
**
Offline Offline

Activity: 211
Merit: 20

$$$$$$$$$$$$$$$$$$$$$$$$$


View Profile
April 27, 2021, 12:25:45 PM
 #26

@brainless I don't see any advantage in calculating this ... Maybe just out of curiosity? Any personal projects or research? Or did you discover something interesting?
ymgve2
Full Member
***
Offline Offline

Activity: 161
Merit: 230


View Profile
April 27, 2021, 02:27:46 PM
Merited by NotATether (1)
 #27

your formula if write in python, will help me to understand, kindly write python script, thankx

Code:
def point_add(Ax, Ay, Bx, By):
    """Point addition of points (Ax, Ay) and (Bx, By)"""
    
    l = (By - Ay)//(Bx - Ax)
    Cx = l**2 - Ax - Bx
    Cy = l*(Ax - Cx) - Ay
    return Cx, Cy   # Point (Cx, Cy) = (Ax, Ay) + (Bx, By)

small edit: the code was full of no-break spaces

Note that you will have to unserialize your hex numbers into integers before you can pass them here. The integer type in Python (unlike in other languages) is infinite-precision.



 File "main.py", line 33
    lambda = (By - Ay)/(Bx - Ax)
           ^
SyntaxError: invalid syntax

Right. lambda is a keyword in Python so I have to name it something else. See the edited code.

Did you just convert the Wikipedia equations to code? This will not work at all, because the calculation has to be done modulo the characteristic of the elliptic curve's field, everything should be done mod 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f

Also this code does not account for the special cases where points have the same X coordinates.

Instead, take a look at https://stackoverflow.com/questions/31074172/elliptic-curve-point-addition-over-a-finite-field-in-python

(I still have no idea what OP is trying to do, and I suspect they don't know themselves either)
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6726


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 27, 2021, 05:58:10 PM
 #28

Did you just convert the Wikipedia equations to code? This will not work at all, because the calculation has to be done modulo the characteristic of the elliptic curve's field, everything should be done mod 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f

Yes that's what I did, I kind of got the idea something was wrong when these calculations made large negative numbers for OP's output instead of points on the curve.

I guess I have to mod each addition/subtraction by this, and can't defer it to the end of the line right? E.g

Code:
l = ((By - Ay) mod p) / ((Bx - Ax) mod p)  mod p

versus:

Code:
l = (By - Ay)/(Bx - Ax) mod p

(I'll get to the edge cases later, for now let's get this clarified.)

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18509


View Profile
April 27, 2021, 07:43:23 PM
Merited by NotATether (1), ymgve2 (1)
 #29

-snip-
You need to use the multiplicative inverse, which every number will have since p is prime.

So, using your notation, you would do:

(By - Ay) * (Bx - Ax)-1 mod p

So, as an example let's use the curve y2 = x3 + 7 mod 31, and lets use points (5,16) and (7,28)

s = (28-16)/(7-5) mod 31
s = 12/2 mod 31

The multiplicative inverse of 2 mod 31 is 16, so

s = 12*16 mod 31 = 6

Cx = 62 - 5 - 7 mod 31 = 24
Cy = 6*(5 - 24) - 16 mod 31 = -6 = 25

So the point C is (24,25).

The python command you would be looking for is:

Code:
l=(By-Ay) * libnum.invmod(Bx-Ax,p)
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 27, 2021, 08:38:06 PM
 #30

these all are simple math ecc addition, remain Q is point concatenate base on formula, where at curve or not at curve,
my logics are beyond your thinking by point concatenate, where i have reach is same address with x same 2 difrent y's
see below

1FQYNQGz32BDLcSBC4Kz54mErjzB7kbL1N
1FQYNQGz32BDLcSBC4Kz54mErjzB7kbL1N

1NWYqgBKDgJ3X8JnxynVRJeHxpsabPAcK8
1MfnBBkWkcXTQSvSucgCrh3D1WpvdV7DCM

see compressed address
04eb611af1fd2e89e5361028f25d1a5510a4bc477757be925a594ce17436afe40370ac8110203e9 f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53
at y is 70ac8110203e9f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53
03eb611af1fd2e89e5361028f25d1a5510a4bc477757be925a594ce17436afe403
see uncompressed address

04eb611af1fd2e89e5361028f25d1a5510a4bc477757be925a594ce17436afe40384125d3056d83 64cf8962165f479d3da6f2ebc096f792df0ba484d8d703c0667
at y is 84125d3056d8364cf8962165f479d3da6f2ebc096f792df0ba484d8d703c0667
where y is difrent but in both cases compressed address is same
uncompressed addresses are difrent

check here
https://iancoleman.io/bitcoin-key-compression/


13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
ymgve2
Full Member
***
Offline Offline

Activity: 161
Merit: 230


View Profile
April 27, 2021, 09:09:51 PM
Merited by o_e_l_e_o (2)
 #31

I don't know where you got 0x70ac8110203e9f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53 from, but (x,y) = (0xeb611af1fd2e89e5361028f25d1a5510a4bc477757be925a594ce17436afe403, 0x70ac8110203e9f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53) is NOT a valid point on the secp256k1 curve.


The valid y coordinates for x = 0xeb611af1fd2e89e5361028f25d1a5510a4bc477757be925a594ce17436afe403 are:

0x84125d3056d8364cf8962165f479d3da6f2ebc096f792df0ba484d8d703c0667 (you got that one) and
0x7beda2cfa927c9b30769de9a0b862c2590d143f69086d20f45b7b2718fc3f5c8

Since point compression takes just the lower bit of the y coordinate to set the prefix to either 0x02 or 0x03, the fact that you have an INVALID y coordinate which has the same lowest bit as the valid one, means point compression of course gives the same result.
ymgve2
Full Member
***
Offline Offline

Activity: 161
Merit: 230


View Profile
April 27, 2021, 10:05:04 PM
 #32

I got curious and wondered where you got 0x70ac8110203e9f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53 from, and discovered that it's what happens when you try to decompress a point with the x coordinate set to 0. Note that there are NO points on the secp256k1 curve with 0 as a valid x coordinate, this just happens because that iancoleman site doesn't check point validity at all.

If you enter 030000000000000000000000000000000000000000000000000000000000000000 into the iancoleman site, you get x=0 and y=0x70ac8110203e9f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53 - which makes me yet again wonder what the hell you are trying to do.

Could you try to explain a bit more what your goal is?
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 27, 2021, 11:40:22 PM
 #33

I got curious and wondered where you got 0x70ac8110203e9f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53 from, and discovered that it's what happens when you try to decompress a point with the x coordinate set to 0. Note that there are NO points on the secp256k1 curve with 0 as a valid x coordinate, this just happens because that iancoleman site doesn't check point validity at all.

If you enter 030000000000000000000000000000000000000000000000000000000000000000 into the iancoleman site, you get x=0 and y=0x70ac8110203e9f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53 - which makes me yet again wonder what the hell you are trying to do.

Could you try to explain a bit more what your goal is?
btw i mention valid points, as compress address same and uncompressed address changed

when you construct x1, x2, x3 from y1 or y2
your x=0 vanish

y1 = 8f537eefdfc1606a0727cd69b4a7333d38ed44e3932a7179eecb4b6fba9360dc
y2 = 70ac8110203e9f95f8d832964b58ccc2c712bb1c6cd58e861134b48f456c9b53
x1 = eb611af1fd2e89e5361028f25d1a5510a4bc477757be925a594ce17436afe403
x2 = 8a80022196a21dcf65edb784fabedce993aba053f77169c814b61f30be356589
x3 = 8a1ee2ec6c2f584b64021f88a826ce05c7981834b0d003dd91fcff590b1aaed2

i am simple playing with bits and curves Smiley

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
ymgve2
Full Member
***
Offline Offline

Activity: 161
Merit: 230


View Profile
April 27, 2021, 11:48:53 PM
 #34

None of the combinations of those points are on the secp256k1 curve. Whatever you are doing, it is simply wrong.

Try it yourself, to be a valid point it has to satisfy the equation (x**3 + A*x + B) % N == (y**2) % N and for secp256k1 N = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f, A = 0, B = 7
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 27, 2021, 11:52:03 PM
 #35

None of the combinations of those points are on the secp256k1 curve. Whatever you are doing, it is simply wrong.

Try it yourself, to be a valid point it has to satisfy the equation (x**3 + A*x + B) % N == (y**2) % N and for secp256k1 N = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f, A = 0, B = 7

get three x1, x2, x3 from x=0
tell me what y's and x's you get result

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 27, 2021, 11:54:23 PM
 #36

from x = 8a80022196a21dcf65edb784fabedce993aba053f77169c814b61f30be356589

y1 = 84125d3056d8364cf8962165f479d3da6f2ebc096f792df0ba484d8d703c0667
y2 = 7beda2cfa927c9b30769de9a0b862c2590d143f69086d20f45b7b2718fc3f5c8
x1 = 8a80022196a21dcf65edb784fabedce993aba053f77169c814b61f30be356589
x2 = 8a1ee2ec6c2f584b64021f88a826ce05c7981834b0d003dd91fcff590b1aaed2
x3 = eb611af1fd2e89e5361028f25d1a5510a4bc477757be925a594ce17436afe403

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
ymgve2
Full Member
***
Offline Offline

Activity: 161
Merit: 230


View Profile
April 28, 2021, 12:00:04 AM
 #37

None of the combinations of those points are on the secp256k1 curve. Whatever you are doing, it is simply wrong.

Try it yourself, to be a valid point it has to satisfy the equation (x**3 + A*x + B) % N == (y**2) % N and for secp256k1 N = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f, A = 0, B = 7

get three x1, x2, x3 from x=0
tell me what y's and x's you get result

There are no results, because x=0 is not on the curve. The y values you get from x=0 do not as far as I can tell have any solution on the curve.

from x = 8a80022196a21dcf65edb784fabedce993aba053f77169c814b61f30be356589

y1 = 84125d3056d8364cf8962165f479d3da6f2ebc096f792df0ba484d8d703c0667
y2 = 7beda2cfa927c9b30769de9a0b862c2590d143f69086d20f45b7b2718fc3f5c8
x1 = 8a80022196a21dcf65edb784fabedce993aba053f77169c814b61f30be356589
x2 = 8a1ee2ec6c2f584b64021f88a826ce05c7981834b0d003dd91fcff590b1aaed2
x3 = eb611af1fd2e89e5361028f25d1a5510a4bc477757be925a594ce17436afe403

These, though, are valid, but what is the point? What is the relevance of finding other points with the same y coordinates?
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 28, 2021, 12:07:31 AM
 #38

0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
+
0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798

result
valid curve x=0 and y=8f53.....

base on these strategy, going to find point concatenate, where result will be on curve or not at curve (if outside of modulo p),

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
ymgve2
Full Member
***
Offline Offline

Activity: 161
Merit: 230


View Profile
April 28, 2021, 12:15:33 AM
 #39

0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
+
0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798

result
valid curve x=0 and y=8f53.....

base on these strategy, going to find point concatenate, where result will be on curve or not at curve (if outside of modulo p),


That's not the way to do this point addition, if you add two points with the same X coordinate but opposite Y coordinates, you get the curve's infinity point, which is a special case and can't be represented as a public key.

Also you still haven't explained what this "concatenation" is supposed to accomplish.
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 28, 2021, 12:29:33 AM
 #40

0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
+
0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798

result
valid curve x=0 and y=8f53.....

base on these strategy, going to find point concatenate, where result will be on curve or not at curve (if outside of modulo p),


That's not the way to do this point addition, if you add two points with the same X coordinate but opposite Y coordinates, you get the curve's infinity point, which is a special case and can't be represented as a public key.

Also you still haven't explained what this "concatenation" is supposed to accomplish.
point concatenation will help me to generate new public addresses in new security level, like multi pubkeys "3" p2wsh, p2sh, similar, finding new paring, diffrent level secure, but must know, 0 point loop holes
example if x=0 and not at curve then where from y -y comes, as its not satisfy Equation, Q is where from y-y comes ?

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
Pages: « 1 [2] 3 »  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!