I tried to generate mnemonic for my react native application using Both BIP39 and react-native-Bip39 and it is working fine in the simulator but as soon as I try to generate a mnemonic on a physical device it is failing with a console error that say that it is only supported on browser such as chrome or Firefox, is there another library, a fix or another way to make this library run on react native?
2 Answers
Basically the issue is that react's library is old, it wasn't updated for 5 years and encryption has evolved since plus weaknesses found in old libraries.
There's a fork that updated this library to use native pbkdf2 from react-native-aes-crypto, there's a pull request but it wasn't merged yet.
react-native-bip39 fork: https://github.com/annakaz/react-native-bip39
Side note: code review this package for yourself, as a malicious actor could modify it so it'll produce a pseudo-random seed, which he has access to.
-
i found a solution, not sure if you want but i can send you the repo, my code is open source– YannCommented Jun 7, 2022 at 14:01
-