Goksu Toprak pfp
Goksu Toprak
@gt
Looking for recommendations on improving the performance of importing wallets on React Native. Using Viem / Ox — Getting 1500ms from `mnemonicToAccount`: https://viem.sh/docs/accounts/local/mnemonicToAccount#mnemonictoaccount Getting 300ms from `privateKeyToAccount`: https://viem.sh/docs/accounts/local/privateKeyToAccount#privatekeytoaccount Looking for pointers to get either of these calls to at most 100ms. Understand that these are optimized in web / node / crypto context but not on React Native yet.
4 replies
4 recasts
31 reactions

Frederik Bolding 🦊 pfp
Frederik Bolding 🦊
@frederik
Most likely the bottleneck is PBKDF2 when deriving the mnemonic seed. Most libraries use noble packages without much configurability to swap to native code. We've built an abstraction on top of noble at MetaMask that also supports using native code for PBKDF2: https://github.com/MetaMask/key-tree In combination with something like `react-native-quick-crypto`, that may give a big speed boost! Let me know if you want more details!
2 replies
0 recast
4 reactions

Paul Miller pfp
Paul Miller
@paulm
Pbkdf 2048 is nothing. It should be like 500,000 for security. Then yes it could have been slow. 2048 must be fast anywhere. So it's RN issue. Will investigate
1 reply
0 recast
0 reaction

jxom  pfp
jxom
@jxom
cc. @paulm
0 reply
0 recast
0 reaction