-
Notifications
You must be signed in to change notification settings - Fork 123
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
feat: Extension - Add view and import Spending Key #1744
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e8ded1d
to
edea9b9
Compare
9acf0a8
to
0c7e882
Compare
mateuszjasiuk
approved these changes
Feb 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested! LGTM
889cc23
to
c362e50
Compare
pedrorezende
approved these changes
Feb 27, 2025
This was referenced Feb 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1720
Testing
NOTE I think it's a good idea while running this locally, to take an existing dev extension installation based on
main
(or older), then loading it with this branch, just to simulate an upgrade. I didn't change any values in storage for this branch, but I think it's good to confirm the logic in place is correct for all existing accounts! That's a good practice for any Keychain update.We want to make sure that the viewing key (and default address) we derived from a mnemonic matches what is imported when we import the spending key directly. Also, and most critically, we need to ensure that this works with previous extension data in place, and doesn't affect the normal account flows in any way!
Since the PR introduces "Access Spending Key", we can test with any mnemonic import:
Access Spending Key
- copy this value and make note of Viewing key and payment address (default address)Testing accounts
Here are a few accounts we can test with:
m/32'/877'/0'
zvknam1q080khy2qqqqpqp3qmymr4d28kgmwy0frpv89csgpd0azueh2deuu6t97cztywgh3mgkp4zhvjfxy2zjuk6y7j5w45f2mk94cnd4kqsndjtp6e7ezv59rm8czavrwjpw0dqtmmq6lrfnvrj57qspy2vlrv7gkmw3zktr5yyplmmp5hsf3reqnnuyfdt30zpkxzjdkq9t3d79z2cwx7y99dtdtrr48n9q7wphhwqxg9lxnass4njj6v09j48atd49kfj589ej5rk0gpswcm8qf
zsknam1q080khy2qqqqpqp3qmymr4d28kgmwy0frpv89csgpd0azueh2deuu6t97cztywgh36uz5vhuw5wg5en4vlprudwkshg9t435c9stne4dvt64n02z2susqewexquafzcsplgd37d5wzta4ypmfamx43vxsde2p63r2y34xngflmmp5hsf3reqnnuyfdt30zpkxzjdkq9t3d79z2cwx7y99dtdtrr48n9q7wphhwqxg9lxnass4njj6v09j48atd49kfj589ej5rk0gpsc8tuen
m/32'/877'/1'
zvknam1q080khy2qyqqpqr5w2asdwt4knzw92c5zenpz0ccj2f6m8u4t670wgja23hh38xwc07qjt96pze42mhyw3wrxglj2anjwffafl3ggkuutpwde7rftp7ekkzdznm577wdrkheacgglrqpfasnyw7ecknqpqzzcack0ng6vny33nt7z0hyw647g8gw9sr2585732d7cnfvmvkwqsd3efw96haa4k2pnmfmyh2rf9uknstm6dzwe97nkqw3nxltzj9pwrm06zmzqxlwt3g45ts0e
zsknam1q080khy2qyqqpqr5w2asdwt4knzw92c5zenpz0ccj2f6m8u4t670wgja23hh38xwcw08c7cp64hauuf8uv44d3uy4gh6zwr9c6cegsy66exmgah2rlqseydkzl5rydtz3sr6dtm0yxhd4eagmre8vjrpyppzjpcm98ynx6gz3nt7z0hyw647g8gw9sr2585732d7cnfvmvkwqsd3efw96haa4k2pnmfmyh2rf9uknstm6dzwe97nkqw3nxltzj9pwrm06zmzqxlwt3g47ty63
m/32'/877'/2'
zvknam1q080khy2qgqqpqrp6vhyc2d39vpn5rty473yzycelycdlmlzxkj6jyevtw4x4ycm2jujg3463hx2nlgwuw45yfgl2dr86te7u4t4s6p57fzuvsxmkumk8mwpafv8cfdqcalrt9h2vngqag3q2hae0mp6ptv3zdgyjh0ycv38j07f0ckn9mkszd4kc6t3lpn37engast5lct67ef6dg3uezqzmxpmps43xlvgfjkxhlhd07k8c5klqhl0ymxpk0wlvr22wnshnqvuc0crg6tme
zsknam1q080khy2qgqqpqrp6vhyc2d39vpn5rty473yzycelycdlmlzxkj6jyevtw4x4ycm2smstj8dh97jssumgnz6zx9me40fz4yvfgv26jp20anf0yct2p3smjaqtydk6zd3u96c5v4y95e4dplygxzywn8m8nknfu52kjcf6lqgj07f0ckn9mkszd4kc6t3lpn37engast5lct67ef6dg3uezqzmxpmps43xlvgfjkxhlhd07k8c5klqhl0ymxpk0wlvr22wnshnqvuc0cd753f6
Screenshots
Spending Key auth prompt:

Spending Key view (Pending final copy):

Button appears before

Viewing Key
and should only display on non-Ledger shielded accounts:Spending Key Import - New Tab:
