1

I'm trying to create a bitcoin wallet from a mnenomic phrase using bip32 in an expo app, for that I need to use the module tiny-secp256k1, but it has proven to be difficult due to the apparent incompatibility with the expo framework, I believe I have solved various issues when implementing this module in expo but I am stuck now.

First I had the problem explained and solved in this metro issue

Then I had problems with RNRandomBytes.seed being null, I used this "react-native-randombytes" issue to solve it.

But now I'm facing this new problem

TypeError: (0, fs_1.readFileSync) is not a function. (In '(0, fs_1.readFileSync)((0, wasm_path_cjs_js_1.path)("secp256k1.wasm"))', '(0, fs_1.readFileSync)' is undefined)

I don't know if this problem is due to one of the solutions I implemented above or if it's something else entirely.

In my expo app I'm using rn-nodeify believing it would help me solve incompatibility issues and while it has worked installing some dependencies that were missing it has not solved the issue with tiny-secp256k1.

For testing proposes I've just been instancing tiny-secp256k1 in my app.js file, just doing that it's enough for the error mentioned above to appear.

import ecc from "tiny-secp256k1";

Any help would be appreciated.

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33

0 Answers0