I have a simple string, for example test
– and I need to convert it to Ethereum private key 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
What is an algorithm? Which functions should I apply? I want to make it with nodejs.
private-key
I have a simple string, for example test
– and I need to convert it to Ethereum private key 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
What is an algorithm? Which functions should I apply? I want to make it with nodejs.
Best Answer
You can do it like this using Web3 libraries for programming language:
You can do it like this on a UNIX/Linux command prompt:
The only requirement of a private key is that it is 256 bit integer number, or 32 bytes or random data (with some small limitations)
Note that most simple passphares that are guessable are guessed. For example, any sentence from the bible or other famous book is no go.
Check web3.js for JavaScript and web3.py for Python.