Bitcoin Forum
May 17, 2024, 09:55:38 PM *
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)
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 22, 2021, 09:05:52 PM
 #1

abc
023ef30130654689a64c864d6dd38760481c55fc525e2c6c7084e2d2d3d4d51be9
043ef30130654689a64c864d6dd38760481c55fc525e2c6c7084e2d2d3d4d51be9f7d86b288c09d db5311f292285168000e43e4b62201bd8de23a391daa8e00ce8

def
036a6e1dc6f203f7fdd97965892301e5fb995a37318c410543835f0edcd3456c49
046a6e1dc6f203f7fdd97965892301e5fb995a37318c410543835f0edcd3456c492a072b9898b93 e9eb05f9ad86a97546d83b579bf6efd3482f93baca13784496b

abcdef
0312faae608bd6562562b8f85564664cd1fdcd667f6b24b2b221ef86b9231f4d74
0412faae608bd6562562b8f85564664cd1fdcd667f6b24b2b221ef86b9231f4d74512ee8cd9b343 31afd05ccb8d81d1393c150c73ec5695845b731f7e6e0086719

here abc is 1 point, and 2nd point is def
if we can join or merge like abc add to def
where result would be abcdef point

abc+def = 18AB
one new func could be inside
like abc+def = abcdef
like point +point = pp ( line extended) ( not 2p)

point 1
point 2
a =1+2 = 3
more advance looking func

point 1
point 2
a =1+2 = 12

any ecc expert, can explain about this addition apply?
maybe it will called Point concatenate

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6746


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 23, 2021, 06:37:12 AM
 #2

See this thread. I quote a post from there:

To get C = A + B, where A != B  (in other words A and B must not be the same point. If that's the case, use point doubling instead):

- lambda = (By - Ay)/(Bx - Ax)   (Note: no a term, even if the curve is not secp256k1!)
- Cx = lambda2 - Ax - Bx
- Cy = lambda*(Ax - Cx) - Ay

So point addition isn't concatenation or arithmetic addition, you simply take their uncompressed form, extract the X and Y values and perform the above operations on them and embed the X and Y result into an uncompressed point.

Note: "abc" and "def" don't look like curve points, because they are just hex numbers with no X and Y value.

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

Activity: 161
Merit: 168


View Profile
April 23, 2021, 07:42:06 AM
 #3

The points are coded like a public key:

abc A: 3ef30130654689a64c864d6dd38760481c55fc525e2c6c7084e2d2d3d4d51be9
abc B: f7d86b288c09ddb5311f292285168000e43e4b62201bd8de23a391daa8e00ce8

def A: 6a6e1dc6f203f7fdd97965892301e5fb995a37318c410543835f0edcd3456c49
def B: 2a072b9898b93e9eb05f9ad86a97546d83b579bf6efd3482f93baca13784496b


abc + def:
15cb9594ee936bd14b98139460879bee6f33b0f7c0ccb293825794d985f595be
aaad772a2ec81ab6013775e9edb274efe2e133e65e58949ac7f25429fb1bb152
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 23, 2021, 07:51:37 PM
 #4

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

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 25, 2021, 04:11:46 PM
 #5

https://crypto.stackexchange.com/questions/310/mapping-points-between-elliptic-curves-and-the-integers

is this formula can work on above required result ?

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6746


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 25, 2021, 04:44:37 PM
 #6


The formulas in that post are for compressing an X,Y pair into an x- coordinate, and has nothing to do with point addition. I have already given the formula for that in my first post, and that's what I'm going to assume you used to derive your answer:

x: 12faae608bd6562562b8f85564664cd1fdcd667f6b24b2b221ef86b9231f4d74
y: 512ee8cd9b34331afd05ccb8d81d1393c150c73ec5695845b731f7e6e0086719

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 25, 2021, 05:10:17 PM
 #7


The formulas in that post are for compressing an X,Y pair into an x- coordinate, and has nothing to do with point addition. I have already given the formula for that in my first post, and that's what I'm going to assume you used to derive your answer:

x: 12faae608bd6562562b8f85564664cd1fdcd667f6b24b2b221ef86b9231f4d74
y: 512ee8cd9b34331afd05ccb8d81d1393c150c73ec5695845b731f7e6e0086719

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

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6746


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 25, 2021, 06:13:23 PM
Last edit: April 25, 2021, 07:01:46 PM by NotATether
 #8

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 25, 2021, 06:29:35 PM
 #9

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)"""

    lambda = (By - Ay)/(Bx - Ax)
    Cx = lambda**2 - Ax - Bx
    Cy = lambda*(Ax - Cx) - Ay
    return Cx, Cy   # Point (Cx, Cy) = (Ax, Ay) + (Bx, By)

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

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 25, 2021, 06:32:32 PM
 #10

if
Ax = 28472748655393009267694063518808149386163109418078082138878164433505686461417 #3ef30130654689a64c864d6dd38760481c55fc525e2c6c7084e2d2d3d4d51be9
Ay = 112103652146063681709271542430359369857619412145509508700963842184555907779816 #f7d86b288c09ddb5311f292285168000e43e4b62201bd8de23a391daa8e00ce8

Bx = 48139720641152563685347991770512702742210610129134046538275528729266911276105 #6a6e1dc6f203f7fdd97965892301e5fb995a37318c410543835f0edcd3456c49
By = 19009808459039115948789087270292949097337312255656245874893769987807919753579 #2a072b9898b93e9eb05f9ad86a97546d83b579bf6efd3482f93baca13784496b

what result will be back from your formula ?
x: 9858272149801355672780957992190489068105775500642985285161445958802893804990
y: 77199671246421658177371783275117138254582110578372826724463426751083822428498

or

x: 8584546547439194144767466770313806210515315127328165539072185327841223593332
y: 36720222448510784205200470825713773455378994828752011866054770511274779895577

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18515


View Profile
April 25, 2021, 07:02:07 PM
Merited by NotATether (1)
 #11

-snip-
If your two points are:
Code:
043EF30130654689A64C864D6DD38760481C55FC525E2C6C7084E2D2D3D4D51BE9F7D86B288C09DDB5311F292285168000E43E4B62201BD8DE23A391DAA8E00CE8
046A6E1DC6F203F7FDD97965892301E5FB995A37318C410543835F0EDCD3456C492A072B9898B93E9EB05F9AD86A97546D83B579BF6EFD3482F93BACA13784496B

Then adding them together gives you the following point:
Code:
0415CB9594EE936BD14B98139460879BEE6F33B0F7C0CCB293825794D985F595BEAAAD772A2EC81AB6013775E9EDB274EFE2E133E65E58949AC7F25429FB1BB152

If you want to break that in to an x and y coordinate and convert to decimal as you have done, then the coordinates are:
Code:
x = 9858272149801355672780957992190489068105775500642985285161445958802893804990
y = 77199671246421658177371783275117138254582110578372826724463426751083822428498
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 25, 2021, 07:11:51 PM
 #12

-snip-
If your two points are:
Code:
043EF30130654689A64C864D6DD38760481C55FC525E2C6C7084E2D2D3D4D51BE9F7D86B288C09DDB5311F292285168000E43E4B62201BD8DE23A391DAA8E00CE8
046A6E1DC6F203F7FDD97965892301E5FB995A37318C410543835F0EDCD3456C492A072B9898B93E9EB05F9AD86A97546D83B579BF6EFD3482F93BACA13784496B

Then adding them together gives you the following point:
Code:
0415CB9594EE936BD14B98139460879BEE6F33B0F7C0CCB293825794D985F595BEAAAD772A2EC81AB6013775E9EDB274EFE2E133E65E58949AC7F25429FB1BB152

If you want to break that in to an x and y coordinate and convert to decimal as you have done, then the coordinates are:
Code:
x = 9858272149801355672780957992190489068105775500642985285161445958802893804990
y = 77199671246421658177371783275117138254582110578372826724463426751083822428498

if we convert back into hexprvkey as per your addition
abc
def
abc+def = 18AB

but what i am looking addition like example in hex prvkeys based on x,y points
abc
def
abc+def = abcdef


13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18515


View Profile
April 25, 2021, 07:47:27 PM
 #13

but what i am looking addition like example in hex prvkeys based on x,y points
abc
def
abc+def = abcdef
Well first, these aren't private keys but rather points on the curve, which would be public keys if anything.

Yes, I guess you could concatenate two points together. You could take the two x coordinates:
Code:
3EF30130654689A64C864D6DD38760481C55FC525E2C6C7084E2D2D3D4D51BE9
6A6E1DC6F203F7FDD97965892301E5FB995A37318C410543835F0EDCD3456C49

Concatenate them together:
Code:
3EF30130654689A64C864D6DD38760481C55FC525E2C6C7084E2D2D3D4D51BE96A6E1DC6F203F7FDD97965892301E5FB995A37318C410543835F0EDCD3456C49

Modulo p:*
Code:
0D1C311FC0BD9915B98E45F586FE55821BAE99FB78ADB182BCCDC84652001073

And then calculate the two corresponding y coordinates:
Code:
76C85E288DE490C4281D4E5C94F930900FABA66B47B4CF1788C657BAF15C9BBA
8937A1D7721B6F3BD7E2B1A36B06CF6FF0545994B84B30E87739A8440EA36075

I have no idea why you would want to do such a thing though. Care to explain what you are trying to achieve here?



*p is the finite field over which the secp256k1 curve is defined:
Code:
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 25, 2021, 07:54:59 PM
 #14

here http://web.math.princeton.edu/swim/SWIM%202010/Yao-Zhan%20Presentation%20SWIM%202010.pdf
page 5
Adding points is not the same addition as
1+1=2.
this line make me thinking
if its not 1+1 = 2
then could be 1+1 = 11
just this make me thinking different and test

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18515


View Profile
April 25, 2021, 08:05:21 PM
 #15

if its not 1+1 = 2
then could be 1+1 = 11
No, it is neither 1+1 = 2 nor is it 1+1 = 11. The correct answer has been given by NotATether in the first reply in this thread.

Graphically, you plot the two points on the curve, draw a straight line between them, extend that straight line to find the third point where it intersects the curve, and then reflect that third point across the x axis to find your answer.

Algebraically, you use the equations given above.

This is explained on page 8 of the link you gave, with the (slightly more complicated) equations given on page 10.
mrxtraf
Member
**
Offline Offline

Activity: 255
Merit: 27


View Profile WWW
April 26, 2021, 09:10:53 AM
 #16

Here you write 1 + 1 = 11
And in what system should this be applied? Decimal, hex, or maybe binary?
For example, two numbers in hex b(11) and d(13)
In hex
b + d = bd
But in dec
11 + 13 = 1113
But
hex bd = dec 189 and not equal 1113 from previso result
So which system should you use as a basis for concatenation?
If decimal
X + Y = XY
in mathematic

X*strpad('1', len(Y)+1, '0', right) + Y

But in Hex it is completely different!

But if we transfer this to the points of coordinates, then nothing will work, because the length of Y is not known.
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 26, 2021, 03:02:16 PM
 #17

Here you write 1 + 1 = 11
And in what system should this be applied? Decimal, hex, or maybe binary?
For example, two numbers in hex b(11) and d(13)
In hex
b + d = bd
But in dec
11 + 13 = 1113
But
hex bd = dec 189 and not equal 1113 from previso result
So which system should you use as a basis for concatenation?
If decimal
X + Y = XY
in mathematic

X*strpad('1', len(Y)+1, '0', right) + Y

But in Hex it is completely different!

But if we transfer this to the points of coordinates, then nothing will work, because the length of Y is not known.

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

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 26, 2021, 04:57:00 PM
 #18

hex b dec 11
x: 774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb
y: d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b

hex d dec 13

x: f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8
y: 0ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81

result should be
hex bd dec 189
x: 6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859
y: cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10

13sXkWqtivcMtNGQpskD78iqsgVy9hcHLF
mrxtraf
Member
**
Offline Offline

Activity: 255
Merit: 27


View Profile WWW
April 26, 2021, 05:28:20 PM
 #19

Impossible, not real and not logical.
brainless (OP)
Member
**
Offline Offline

Activity: 316
Merit: 34


View Profile
April 26, 2021, 06:22:37 PM
 #20

Impossible, not real and not logical.

movie name mission impossible, always done at possible, i believe some math expert have solution, Smiley

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!