steemit / steem-js

Steem.js the official JavaScript library for Steem blockchain
https://www.npmjs.com/package/steem
MIT License
472 stars 225 forks source link

get address from privateKey #473

Open roccomuso opened 4 years ago

roccomuso commented 4 years ago

How to generate an address given a private Key with this lib? is it documented?

wehmoen commented 4 years ago

You have to derive the public key from the given private key and use the "account_by_key" api: https://developers.steem.io/apidefinitions/account-by-key-api

wehmoen commented 4 years ago

Keep in mind there can be more than 1 account with the same keyset

roccomuso commented 4 years ago

like a collision?

wehmoen commented 4 years ago

Keys aren't unique on Steem. You can use the same key for multiple accounts.