EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

How to get public key if i know private key? #387

Closed winter38 closed 6 years ago

winter38 commented 6 years ago

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.

iKest commented 6 years ago

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

qding-bot commented 6 years ago

In previous versions we could use:

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

winter38 commented 6 years ago

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