What randomness algo does Yoroi use for the wallet generation? Interested in seeing how secure it is.
1 Answer
Yoroi is using the bip39
JavaScript library to generate the mnemonic.
When we look at its code, we can discover the generation is actually pretty simple:
function generateMnemonic(strength, rng, wordlist) {
strength = strength || 128;
if (strength % 32 !== 0) {
throw new TypeError(INVALID_ENTROPY);
}
rng = rng || randomBytes;
return entropyToMnemonic(rng(strength / 8), wordlist);
}
We see that as no random number generator (rnd
) is defined, it uses the randombytes
library by default, which is in place using the Crypto.getRandomValues() function that is provided from your browser.
To sum this up, Yoroi is using randomness algorithm of your browser, which - depending on the browser - is your system-level entropy source.