Author

Topic: pubkeybitcoin (Read 45 times)

member
Activity: 143
Merit: 82
August 30, 2024, 08:30:00 AM
#6
Code:
$ ./pubkeybitcoin.sh
Enter private key that will be used to calculate the corresponding secp256k1 public key:
7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1
secp256k1 pubkey:
02000003B78CE563F89A0ED9414F5AA28AD0D96D6795F9C63
Thank you. I've just fixed the insufficient number of leading zeros. Should have been: 0200000000000000000000003B78CE563F89A0ED9414F5AA28AD0D96D6795F9C63
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
August 30, 2024, 07:41:36 AM
#5
-snip-
The goal is that it works out-of-the-box in nearly all environments, e.g. MacOS, Rasbperry Pi, Windows XP (with busybox or something similar installed), *BSD, Android:"
Works on Windows 11 with WSL (Windows Subsystem for Linux) with Ubuntu distro.

Just have to install the dependency:
Code:
$ sudo apt install bc

Test commands from README:
Code:
$ sh pubkeybitcoin.sh -f hex FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140
secp256k1 pubkey:
0379BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
Code:
$ sh pubkeybitcoin.sh -f wif L5oLkpV3aqBjhki6LmvChTCV6odsp4SXM6FfU2Gppt5kFLaHLuZ9
secp256k1 pubkey:
0379BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798

Test for prvKey outside range:
Code:
$ sh pubkeybitcoin.sh -f hex FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
ERROR. The entered value exceeds the limit for secp256k1 private key: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364140.
copper member
Activity: 821
Merit: 1992
August 30, 2024, 07:04:22 AM
#4
Code:
$ ./pubkeybitcoin.sh
Enter private key that will be used to calculate the corresponding secp256k1 public key:
7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1
secp256k1 pubkey:
02000003B78CE563F89A0ED9414F5AA28AD0D96D6795F9C63
member
Activity: 143
Merit: 82
August 30, 2024, 06:38:38 AM
#3
Thanks. I tested on Android with Termux and can confirm success. Beforehand, I had installed bc with the command "pkg install bc".
sr. member
Activity: 420
Merit: 315
Top Crypto Casino
August 30, 2024, 05:22:15 AM
#2
 Would be better answered in the development and technical board https://bitcointalk.org/index.php?board=6.0
So you can move it there.


Tried running on my Android since I'm currently far from my system.
But the app I use can't run shell script and Terminux works better on a rooted phone.
But will try later through Linux


For those that are interested in running the code.
To download the code just click on the highlighted green tagged Clone and click on download Zip.
Or just copy the code directly.
member
Activity: 143
Merit: 82
August 30, 2024, 02:55:30 AM
#1
Can I ask you to help in testing the pubkeybitcoin program in various environments, please? It calculates a secp256k1 public key from a private key in (POSIX-compliant) shell (sh, bash, zsh etc. and bc - basic calculator). The goal is that it works out-of-the-box in nearly all environments, e.g. MacOS, Rasbperry Pi, Windows XP (with busybox or something similar installed), *BSD, Android: "https://github.com/GregTonoski/pubkeybitcoin". I would be grateful for verification and confirmation or bug reports, improvement suggestions etc.
Jump to: