Bitcoin Forum
November 09, 2024, 12:48:15 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: pubkeybitcoin  (Read 90 times)
Greg Tonoski (OP)
Member
**
Offline Offline

Activity: 143
Merit: 82


View Profile
August 30, 2024, 07:55:30 AM
Merited by garlonicon (1)
 #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.
Ambatman
Sr. Member
****
Offline Offline

Activity: 448
Merit: 337


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
August 30, 2024, 10: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.

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████
 
Playbet.io
  
Casino & Sportsbook
  
Grab up to
BTC 
+ 800 Free Spins
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
Greg Tonoski (OP)
Member
**
Offline Offline

Activity: 143
Merit: 82


View Profile
August 30, 2024, 11: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".
garlonicon
Copper Member
Legendary
*
Offline Offline

Activity: 922
Merit: 2209


Pawns are the soul of chess


View Profile
August 30, 2024, 12:04:22 PM
Merited by Greg Tonoski (1)
 #4

Code:
$ ./pubkeybitcoin.sh 
Enter private key that will be used to calculate the corresponding secp256k1 public key:
7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1
secp256k1 pubkey:
02000003B78CE563F89A0ED9414F5AA28AD0D96D6795F9C63

nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6356


Self-proclaimed Genius


View Profile
August 30, 2024, 12:41:36 PM
Merited by Greg Tonoski (1)
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Greg Tonoski (OP)
Member
**
Offline Offline

Activity: 143
Merit: 82


View Profile
August 30, 2024, 01:30:00 PM
 #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
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!