Bitcoin Forum
January 10, 2026, 07:02:48 AM *
News: Due to a wallet-migration bug, you should not upgrade Bitcoin Core. But if you already did, there's no need to downgrade.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: (Same public key) * (Same public key) = Public key possible or not.  (Read 205 times)
bjpark (OP)
Jr. Member
*
Offline Offline

Activity: 37
Merit: 4


View Profile
October 15, 2024, 03:10:21 AM
 #1

Research Bitcoin I have a question. Public key*(private key) = Public key has operation and device. (Same public key) * (Same public key) = Public key
I'd like to know if the second one is possible or not.

from ecdsa import SECP256k1, VerifyingKey
from ecdsa.ellipticcurve import Point

def public_key_to_scalar(public_key) -> int:
    """Converts a public key to an integer scalar."""
    return int.from_bytes(public_key.to_string(), 'big')

def multiply_public_key_by_scalar(pub_key, scalar) -> Point:
    """Multiplies a public key by a scalar."""
    return pub_key.pubkey.point * scalar

def point_to_hex(point) -> str:
    """Converts an elliptic curve point to a hexadecimal string in 0x format."""
    x_hex = "0x" + format(point.x(), '064x')
    y_hex = "0x" + format(point.y(), '064x')
    return x_hex, y_hex

# Input public key as a hexadecimal string (should be a valid uncompressed public key)
####Corresponds to the decimal value
input_hex1 = "b84a76136d0c86725a8a305f4a87aeeaa9f44eead621dd1e84d0ea1ad85d82ab" + \
             "9deccad50c1d1b9575d2fd2223215b5d74e29a87cd7879e343296eb688206713"

# Convert the hexadecimal string to a VerifyingKey object
pub_key1 = VerifyingKey.from_string(bytes.fromhex(input_hex1), curve=SECP256k1)

# Define a valid scalar (could be a private key or a large random integer)
# Corresponds to a private key value of 0.1
scalar = 0x2  # Example scalar value

# Multiply the public key by the scalar
result_point = multiply_public_key_by_scalar(pub_key1, scalar)

# Convert the result to a hexadecimal string in 0x format
x_hex, y_hex = point_to_hex(result_point)
print(f"Result of multiplication in hex (x): {x_hex}")
print(f"Result of multiplication in hex (y): {y_hex}")
pooya87
Legendary
*
Offline Offline

Activity: 4060
Merit: 12197



View Profile
October 15, 2024, 04:21:18 AM
 #2

In Elliptic Curve Cryptography you can't multiply two points. The only thing that is defined is multiplication of a point with a number which is defined as adding that point to itself number times. If you are converting that other point to a scalar (public_key_to_scalar) with a workaround, then you are already doing what I said not what you asked in your title.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
garlonicon
Copper Member
Legendary
*
Offline Offline

Activity: 944
Merit: 2309


View Profile
October 15, 2024, 04:54:29 AM
 #3

Why point by point multiplication is undefined in ECDSA?
Ambatman
Hero Member
*****
Offline Offline

Activity: 882
Merit: 1151


Don't tell anyone


View Profile WWW
October 16, 2024, 10:26:22 PM
 #4

Converting from Pubkey to scalar is not really valid in the elliptic curve.
You can only multiply by a scalar or add the Pubkeys
For example
Code:
Pubkey A 
A=(5,7)
Pubkey B
B=(3,4)
Say A is converted to scalar A=x1=5
It wouldn't be valid to multiply the converted pubkey with the point B, as it does not adhere to the curve mathematical property.

But you can either choose to add the Pubkeys or perform direct scalar multiplication to get another point in the curve, like kA where k is the scalar and shows the amount of time the Pubkey A would be added to itself.
C=A+B


███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4620
Merit: 10300



View Profile WWW
October 17, 2024, 12:48:02 AM
Merited by pooya87 (3), ABCbits (2)
 #5

In Elliptic Curve Cryptography you can't multiply two points. The only thing that is defined is multiplication of a point with a number which is defined as adding that point to itself number times. If you are converting that other point to a scalar (public_key_to_scalar) with a workaround, then you are already doing what I said not what you asked in your title.

It's less that it's not defined it's that there is no known efficient algorithm for it.  If you had an efficient algorithm for the DLP in the group you could give point point multiplication answers.  If you could compute the product of points directly you could solve the decisional DH problem, which is believed to be hard in groups like secp256k1.

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!