LiskArchive / lisk-elements

⚙️ Library for sending Lisk transactions from the client or server
https://lisk.io/
GNU General Public License v3.0
250 stars 64 forks source link

Add getAddressFromPrivateKey - Closes #952 #1041

Closed shuse2 closed 5 years ago

shuse2 commented 5 years ago

What was the problem?

There was no way to generate address from private key

How did I fix it?

Add a function to generate publicKey from private key, and then add exposed function to convert private key to address

How to test it?

npm t

Review checklist

shuse2 commented 5 years ago

@AndreasKendziorra Addressed

shouldn't it be tweetnacl.sign.secretKeyLength?

this was 64 bytes, so it couldn't be used. I created an internal constant instead.