Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement wasm-based seed conversion for HD-Wallet native #5467

Closed
woodenfurniture opened this issue Oct 16, 2023 · 1 comment · Fixed by #5493
Closed

Implement wasm-based seed conversion for HD-Wallet native #5467

woodenfurniture opened this issue Oct 16, 2023 · 1 comment · Fixed by #5493
Assignees
Milestone

Comments

@woodenfurniture
Copy link
Member

woodenfurniture commented Oct 16, 2023

Description

Mobile devices spend around 3.5s on app boot converting the mnemonic to a BIP32 seed. Looking into the HDWallet source code we see a TODO to reimplement it:
packages/hdwallet-native/src/crypto/isolation/engines/default/bip39.ts

Image

Additional details

The existing implementation of pbkdf2_sha512_singleblock may be replaceable with pbkdf2 from hash-wasm, for example:

import { createSHA512, pbkdf2 } from "hash-wasm";

// ...

const out = await BIP32Engine.Seed.create(
      Buffer.from(
        await pbkdf2({
          password: mnemonic,
          salt,
          iterations: 2048,
          hashLength: 64,
          hashFunction: createSHA512(),
          outputType: "binary",
        })
      )
    );

Acceptance criteria

  • Native wallet can connect / disconnect / transact as normal
  • Improved app boot time
@woodenfurniture woodenfurniture converted this from a draft issue Oct 16, 2023
@woodenfurniture woodenfurniture self-assigned this Oct 16, 2023
@woodenfurniture woodenfurniture added this to the Mobile perf milestone Oct 16, 2023
@0xApotheosis 0xApotheosis moved this from To schedule to In progress in ShapeShift Dashboard Oct 18, 2023
@0xApotheosis
Copy link
Contributor

HDWallet PR: shapeshift/hdwallet#648

@0xApotheosis 0xApotheosis moved this from In progress to In review in ShapeShift Dashboard Oct 18, 2023
@github-project-automation github-project-automation bot moved this from In review to Done in ShapeShift Dashboard Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants