SeedSigner / seedsigner

Use an air-gapped Raspberry Pi Zero to sign for Bitcoin transactions! (and do other cool stuff)
MIT License
699 stars 161 forks source link

UrXpubQrEncoder always exports for "mainnet" #582

Open jdlcdl opened 2 months ago

jdlcdl commented 2 months ago

Exporting XPUB destined for Sparrow appears to export version=mainnet-public even when seedsigner is set for testnet.

As far as I can tell, Sparrow always forces the extended public key to the version matching the network mode that sparrow is running in. This is not causing any problems whatsoever, I'm just logging this as I realized this to be the case while testing for v0.8.0-rc1.

I suspect that if HDKey were initilialized with a non-defaulted "use_info" DataItem, that the resulting "xpub" key might become its "tpub". https://github.com/SeedSigner/seedsigner/blob/100a9740e70e3c7119eab0f8b0ad262f72a35b7e/src/seedsigner/models/encode_qr.py#L348

From the Foundation-Devices Passport2 codebase, use_info is initialized like: https://github.com/Foundation-Devices/passport2/blob/0199ac1488efc894b3d4bb4f55ec2f6884e6491d/ports/stm32/boards/Passport/modules/wallets/casa.py#L37

Discussion 2 days ago in the telegram New Devs group led me to believe that this may better be addressed during the next refactor of qr-encoding code.


An example of a single-sig native-segwit descriptor exported by seedsigner for Sparrow (indicates "zpub" for user) is below: zpub

fedebuyito commented 1 week ago

Hi @jdlcdl , I think I could found way of exporting on testnet for public key from seedsigner. Would be possible to test it on SeedQReader or another tool you have?