BitBoxSwiss / bitbox02-firmware

Firmware code of the BitBox02 hardware wallet
https://bitbox.swiss/bitbox02
Apache License 2.0
256 stars 91 forks source link

api: allow ShowMnemonic for initialization (allows skipping SD backup) #945

Closed benma closed 1 year ago

benma commented 2 years ago

The normal initialization flow is unseeded -> seeded -> initialized:

SetPassword api call to create the seed and set the password -> seeded.

CreateBackup to create the backup onto a microSD card -> initialized.

ShowMnemonic was only allowed in the initalized state, i.e. after a microSD card backup was made.

This commit allows skipping microSD card backups in favor of a mnemonic backup, by allowing the ShowMnemonic API call also in the seeded (not yet initialized) state.

The api call is modified to set the initialized state, and to not ask for the user password when not initialized, which is the same way the CreateBackup call works (which is also allowed after the initialization).

benma commented 2 years ago

Unit tests and a functional test to follow.