Author

Topic: Using sipa's secp256k1 library to find a public key from a private key (Read 1247 times)

staff
Activity: 4326
Merit: 8951
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.
legendary
Activity: 2058
Merit: 1416
aka tonikt
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.
newbie
Activity: 3
Merit: 0
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.
Jump to: