Bitcoin Forum
June 21, 2018, 03:44:36 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Using sipa's secp256k1 library to find a public key from a private key  (Read 1127 times)
fatefree
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
September 18, 2014, 02:47:06 PM
 #1

I am trying to create a proof of concept using sipa's secp256k1 library (https://github.com/bitcoin/secp256k1) to find the public key of a given private key. However the code does not have much documentation so I am having trouble following it.

I believe the appropriate method to use is:

secp256k1_ecdsa_pubkey_create(unsigned char *pubkey, int *pubkeylen, const unsigned char *seckey, int compressed)

However I'm not sure exactly how it should be called. If anyone is familiar with using this, I would appreciate any direction.
1529552676
Hero Member
*
Offline Offline

Posts: 1529552676

View Profile Personal Message (Offline)

Ignore
1529552676
Reply with quote  #2

1529552676
Report to moderator
1529552676
Hero Member
*
Offline Offline

Posts: 1529552676

View Profile Personal Message (Offline)

Ignore
1529552676
Reply with quote  #2

1529552676
Report to moderator
1529552676
Hero Member
*
Offline Offline

Posts: 1529552676

View Profile Personal Message (Offline)

Ignore
1529552676
Reply with quote  #2

1529552676
Report to moderator
The World's Betting Exchange

Bet with play money. Win real Bitcoin. 5BTC Prize Fund for World Cup 2018.

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
piotr_n
Legendary
*
Offline Offline

Activity: 1890
Merit: 1002


aka tonikt


View Profile WWW
September 18, 2014, 05:59:54 PM
 #2

I think you want to use secp256k1_ecmult_gen() followed by secp256k1_ge_set_gej()
The XY returned by the second function is the public key.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
gmaxwell
Moderator
Legendary
*
qt
Offline Offline

Activity: 2436
Merit: 1201



View Profile
September 18, 2014, 11:03:00 PM
 #3

I think you want to use secp256k1_ecmult_gen() followed by secp256k1_ge_set_gej()
The XY returned by the second function is the public key.
Absolutely not. Those are not public functions.

secp256k1_ecdsa_pubkey_create(unsigned char *pubkey, int *pubkeylen, const unsigned char *seckey, int compressed)

Is correct... there is more information in the header that defines it.

Bitcoin will not be compromised
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!