eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

How to get public key if i know private key?

Open winter38 opened this issue 8 years ago • 3 comments

Is there any way to get public key if i know only private key?

I want to get account info only from private key. I know, that account name i can get from get_key_accounts, but it need public key.

winter38 avatar Oct 08 '18 09:10 winter38

for this you need to install eosjs-ecc pakage. eosjs has no public interface to this module

iKest avatar Oct 08 '18 12:10 iKest

In previous versions we could use:

const ecc = require('eosjs').modules.ecc; var pub = ecc.privateToPublic(pvk);

qding-bot avatar Oct 08 '18 20:10 qding-bot

Thank you! just will include https://github.com/eosio/eosjs-ecc for now.

winter38 avatar Oct 09 '18 09:10 winter38