Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: COBRAS on March 12, 2023, 10:33:04 AM



Title: Looking for python scrypt. ASAP
Post by: COBRAS on March 12, 2023, 10:33:04 AM
Provide someone, please, a python v 3.7 ,scrypt for multiply Pubkey Bitcoin to scalar,  subtract one pubkey from another pubkey, substract scalar from pubkey ?



???

thanks


Title: Re: Looking for python scrypt. ASAP
Post by: litecoin_messiah on March 12, 2023, 11:35:11 PM
https://github.com/mvrc42/bitp0wn?



Title: Re: Looking for python scrypt. ASAP
Post by: PowerGlove on March 13, 2023, 01:13:37 AM
Provide someone, please, a python v 3.7 ,scrypt for multiply Pubkey Bitcoin to scalar,  subtract one pubkey from another pubkey, substract scalar from pubkey ?
Here's a Python script that you might find useful: [Code] Generating addresses from scratch (Python 3.6+) (https://bitcointalk.org/index.php?topic=5432111).

There's a function in there (named scale) for multiplying a point by a scalar. There's also a function in there (named add) for adding two points together; for point subtraction, you can "flip" one of the arguments (i.e. change the y coordinate to: -y % secp256k1_field_order) before doing the addition (see: How to subtract two points on an elliptic curve? (https://bitcoin.stackexchange.com/questions/92800/how-to-subtract-two-points-on-an-elliptic-curve)). For adding/subtracting a scalar to/from a point, I can't help you (I don't believe that operation has a useful definition unless you first convert the scalar into a point).