You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
Currently, we are using master private keys. It's ok, but it would be much more convenient to add mnemonic support (bip39).
Mnemonic generation can be done only if we have a wordlist somewhere.
I think having the wordlist on SD card is ok as soon as we check that the wordlist is correct.
To check the wordlist we need to calculate it's hash and compare with a hardcoded value.
Generating master private key from mnemonic can be done like this:
char mnemonic[] = "here is our mnemonic phrase with 12 words from the wordlist";
char password[] = ""; // we are not using passwords for now
HDPrivateKey key;
key.fromMnemonic(mnemonic, strlen(mnemonic), password, strlen(password), USE_TESTNET);
This procedure doesn't check if the mnemonic is correct - it only hashes it 2048 times and gets the seed. If we want to check the mnemonic we need a wordlist and a function for that. Mnemonic generation from random bytes is also not implemented yet.
Also, calculation of the seed from the mnemonic is extremely slow (can take up to several seconds) so it makes sense to calculate it once and then store in the file together with mnemonic.
Our saved key file will have the following content then:
Currently, we are using master private keys. It's ok, but it would be much more convenient to add mnemonic support (bip39).
Mnemonic generation can be done only if we have a wordlist somewhere.
I think having the wordlist on SD card is ok as soon as we check that the wordlist is correct.
To check the wordlist we need to calculate it's hash and compare with a hardcoded value.
Generating master private key from mnemonic can be done like this:
This procedure doesn't check if the mnemonic is correct - it only hashes it 2048 times and gets the seed. If we want to check the mnemonic we need a wordlist and a function for that. Mnemonic generation from random bytes is also not implemented yet.
Also, calculation of the seed from the mnemonic is extremely slow (can take up to several seconds) so it makes sense to calculate it once and then store in the file together with mnemonic.
Our saved key file will have the following content then:
Currently, I think we don't want to support more than 1 coin and more than 1 account at the same time, so it will be good enough.
The text was updated successfully, but these errors were encountered: