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

Resolves issue 621 - Verify Address for exported Xpub Option #629

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from

Conversation

fedebuyito
Copy link
Contributor

@fedebuyito fedebuyito commented Nov 13, 2024

Description

Because workflow of exportpubkey would must to be securely closed verifying addresses obtained on wallet software (Sparrow, for instance), issue reported #621 is conceptual consistent.

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other (export XPUB address from seed and verify addresses workflow)

Checklist

  • I’ve run pytest and made sure all unit tests pass before sumbitting the PR. They was updated, too.

If you modified or added functionality/workflow, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms/os:

  • Raspberry Pi OS Manual Build
  • SeedSigner OS on a Pi0/Pi0W board
  • Other (enteropositivo emulator), new workflow was probed with sparrow wallet for segwit, nested and legacy scripts (taproot was not implemented)

Fixes #621
Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.

Changing KEY_BACKSPACE size on ToolsDiceEntropy and ToolsCoinFlip screens
Missed import sentence for commands added on last commit
On class SeedExportXpubQRDisplayView(View): Replaces "Destination" return call from MainMenuView to ScanAddressView. Rest of changes are for passing seed_num between class calling.
Changes for passing seed_num between class calling (for ScanAddressView class).
Test for seed views workflow affected.
@fedebuyito
Copy link
Contributor Author

Hi. Here, local pytest runned on 3.10 / 3.12 and video capture of workflow on Seedsigner Emulator (with loop backed camera for Sparrow interaction) for signet/segwit addresses:

image

image

2024-12-19 23-46-28

Tested with same results on my pi0-seedsigner device, too.

Best Regards. -

@kdmukai
Copy link
Contributor

kdmukai commented Dec 20, 2024

Very cool.

But I would suggest an intermediate screen. We have to explain what the second camera live preview is expecting to scan.

  • xpub QR export.
  • Intermediate screen prompt: "Verify New Wallet?"; brief 1 sentence explanation of why / how(?); buttons:
    • [QR icon] Verify an address
    • Done
  • Live camera preview to scan addr to verify.

@fedebuyito
Copy link
Contributor Author

Thanks for your feedback, Keith. I will try, that makes sense.

@fedebuyito fedebuyito changed the title Resolves issue 621 Resolves issue 621- Verify Address for exported Xpub Option Dec 21, 2024
Added SeedExportXpubQRAskVerifyAddView(View) class for intermediate screen asking for verifying address or done action after exporting Xpub
Added FlowStep(seed_views.SeedExportXpubQRAskVerifyAddView, screen_return_value=0) to seed flow tests.
@fedebuyito
Copy link
Contributor Author

Do you think this way would be fit? (I updated tests too, because of the new screen)

image

Added AdviceScreen class
Resolves conflicts from previous merger
Resolves conflicts from previous merger
Resolves conflicts from previous merger
Resolves conflicts from previous merger
Resolves conflicts from previous merger
Added AdviceScreen class.
Resolves conflicts from previous merger
Resolves conflicts from previous merger
Added FlowStep(seed_views.SeedExportXpubQRAskVerifyAddView, screen_return_value=0) to seed flow tests.
Added  new Screenshot for SeedExportXpubQRAskVerifyAddView
@fedebuyito
Copy link
Contributor Author

  • Code adapted in order to resolve conflicts from last massive merge (PR Initial l10n / multilanguage support #620 ), including workflow test.
  • Revised view text and icon for better understanding.
  • Tested on local for 3.12 and 3.10, and pi0 manual build.
  • Added new view to screenshot generator (tests passed, too).
  • Did not try with multi language because is out of scope of this issue

image

image
image

@jdlcdl
Copy link

jdlcdl commented Dec 30, 2024

Reviewed and tried this pr at 2047506

This is nice functionality. I like that it helps teach users to verify their watch-only wallet setup.

  • Perhaps improved wording on the new Advice screen:
    A better title might be "Wallet Verification". Text might be "Scan a wallet address to verify the exported xpub?". Button might be "Scan an address".
    ...once done, to make suggestions to translators/transifex for new strings in Spanish.
  • Since multisig cannot work with a single xpub (though this pr does check and succeed address verifications), it might only be relevant to, and therefore available, after exporting single-sig xpubs. It's not expected that the user would have access to the full descriptor until all bip32 xpubs have been exported... at that time, an advanced multisig user should know to verify their wallet setup with a complete wallet descriptor.

@fedebuyito
Copy link
Contributor Author

Hi @jdlcdl . Thanks for reviewing and comments.

Sounds good that wording improvement. Note the headline with text "Check new wallet", below icon, is it useful? would you change it?

image
image

About this,

* Since multisig cannot work with a single xpub (though this pr does check and succeed address verifications), it might only be relevant to, and therefore available, after exporting single-sig xpubs.  It's not expected that the user would have access to the full descriptor until all bip32 xpubs have been exported... at that time, an advanced multisig user should know to verify their wallet setup with a complete wallet descriptor.

I agree, and think I'm almost there.

@jdlcdl
Copy link

jdlcdl commented Dec 31, 2024

Just noticing that this pr raises an error if an address is scanned before any seed has been loaded. What is expected instead is to land at the "load a seed" view so that user can load a seed in various ways.

Error looks like:

System Error
(!)
AttributeError
scan_views.py, 136, in run
'ScanView' object has no attribute 'seed_num'
(I Understand)

Will leave a marker in code comment if I see it.

Otherwise, things are a moving target lately, we'll catch all the bugs before merge/release.
Have a safe and wonderful end-of-year celebration @fedebuyito. All the best for 2025!

@@ -133,6 +133,8 @@ def run(self):
from seedsigner.views.seed_views import AddressVerificationStartView
address = self.decoder.get_address()
(script_type, network) = self.decoder.get_address_type()
seed_num = self.seed_num
Copy link

Choose a reason for hiding this comment

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

Cannot always be assumed that object has .seed_num, sometimes user will scan an address first, afterwards should be prompted to load a seed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed on 1e63527 commit.

only includes "seed_num" when this exists.
Only ask for verification xpub address option when SINGLE_SIG
Solves view wording
Fixes test flows regarding ask xpub address verification only when SINGLE_SIG
Resolves missing member declaration
@fedebuyito
Copy link
Contributor Author

Just noticing that this pr raises an error if an address is scanned before any seed has been loaded. What is expected instead is to land at the "load a seed" view so that user can load a seed in various ways.

Error looks like:

System Error
(!)
AttributeError
scan_views.py, 136, in run
'ScanView' object has no attribute 'seed_num'
(I Understand)

Will leave a marker in code comment if I see it.

Otherwise, things are a moving target lately, we'll catch all the bugs before merge/release. Have a safe and wonderful end-of-year celebration @fedebuyito. All the best for 2025!

Thank you! I was not realized that there are two ways to scan an address before load a seed (Tools/Verify and SCAN directly, last I did catch it, curiously the most obvious). I logged the fix on marked commented code.

I have solved you suggested about not to ask xpub address verification when multi-signature on workflow, updating workflow test, too (all pytested and emulator tested). On screen wording I left without that yellow words but I read your opinion, of course, so you can tell me what you think is better.

@jdlcdl Nice to meet you on passed 2024 and thanks again for your kindly reviews and all the best for you too right now! 2025 will rock!

@fedebuyito fedebuyito changed the title Resolves issue 621- Verify Address for exported Xpub Option Resolves issue 621 - Verify Address for exported Xpub Option Jan 2, 2025
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.

[Enhancement] Add option of address verification to XPUB export workflow
3 participants