cryptoadvance / specter-diy

DIY airgapped hardware wallet that uses QR codes for communication with the host
MIT License
440 stars 73 forks source link

Add support for "Export to software" QR code from Specter-Desktop #167

Closed stepansnigirev closed 2 years ago

stepansnigirev commented 2 years ago

Often people scan "Export to software" QR code with DIY and get "can't find a matching app" error. The QR code contains everything we need though, so we could just parse it and create a wallet.

example of the content of the QR code:

{"label": "btc1", "blockheight": 0, "descriptor": "wpkh([cdc15fe2/84h/1h/0h]tpubDDWHZoCmT44TvebStogKMkQMoKW5FP8emyu3EhLwKWN1cMU8X41nwQk5Zxx5Zy9v9BFaeLrhDBHEpktyET3V2uW5py1qo9ArQ19x4sLYEmy/0/*)#g8r697ak", "devices": [{"type": "bitcoincore", "label": "btchot1"}]}

We should take the descriptor, replace /0/* with /{0,1}/* and pass together with label to the wallets app. So the QR code above should convert to the command to wallets app:

addwallet btc1&wpkh([cdc15fe2/84h/1h/0h]tpubDDWHZoCmT44TvebStogKMkQMoKW5FP8emyu3EhLwKWN1cMU8X41nwQk5Zxx5Zy9v9BFaeLrhDBHEpktyET3V2uW5py1qo9ArQ19x4sLYEmy/{0,1}/*)
stepansnigirev commented 2 years ago

Added in the latest release https://github.com/cryptoadvance/specter-diy/releases/tag/v1.6.0