Skip to content

Conversation

@fmsouza
Copy link
Contributor

@fmsouza fmsouza commented Jan 22, 2026

Pull Request Template

Description

  • Finishing implementation of the passphrase recovery screen
  • Implementing algo25 account recovery

Related Issues

Checklist

  • Have you tested your changes locally?
  • Have you reviewed the code for any potential issues?
  • Have you documented any necessary changes in the project's documentation?
  • Have you added any necessary tests for your changes?
  • Have you updated any relevant dependencies?

Additional Notes

  • Add any additional notes or comments that may be helpful for reviewers.

@fmsouza fmsouza self-assigned this Jan 22, 2026
@fmsouza fmsouza changed the title [3266] feat(onboarding): finishing word recovery passphrase screen feat(onboarding): finishing word recovery passphrase screen [PERA-3266] Jan 22, 2026
@fmsouza fmsouza marked this pull request as ready for review January 22, 2026 15:13
@fmsouza fmsouza requested a review from wjbeau January 22, 2026 15:13

expect(mockPush).toHaveBeenCalledWith('ImportInfo')
expect(mockPush).toHaveBeenCalledWith('ImportInfo', {
accountType: 'universal',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's maybe stick with hdwallet in the code. I know the user facing description is Universal Wallet, but all the code references xHDWallet and the account type is hdwallet, etc.

type WalletAccount,
} from './models'
import { KeyType } from '@perawallet/wallet-core-kms'
import * as bip39 from 'bip39'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR maybe but I think the latest version of xHDWallets I imported actually switched to a different bip39 implementation so I guess we should follow suit and use the same one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've double checked that and it seems like it's using the same implementation to generate the PK for creating a new account. What seems to be different is how derivation works, which seems to use BIP32 instead. But we can definitely address that in the next PR, which will address derivations.

import { KeyType } from '@perawallet/wallet-core-kms'
import * as bip39 from 'bip39'

export type UniversalKeyPair = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again maybe call it HDWalletKeyPair

}
}

export const createUniversalWalletFromMnemonic = async (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same Universal -> HDWallet rename

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I guess the name here should be specific to keys rather than wallets? E.g. createHDWalletKeyDataFromMnemonic or something?

createdAt: new Date(),
type: KeyType.Algo25Key,
}
await saveKey(rootKeyPair, seed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For HDWallet I actually didn't really investigate seed vs entropy. The API just sometimes needed one and sometimes the other so I stored both for HDWallets. Maybe we can get away with just storing Seed OR maybe we should make Algo25 conform to the same structure just so we don't have to have special logic on the consumer side to do constant switching between structures? (somewhere in the signing flow there is code that does JSON.parse(rootKeypair) and then uses the seed and that would now have to only do that for hdwallets and something else for algo25)

@wjbeau wjbeau merged commit 5c642b2 into main Jan 22, 2026
4 checks passed
@wjbeau wjbeau deleted the fmsouza/3266-word-recovery-passphrase-screen branch January 22, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants