-
Notifications
You must be signed in to change notification settings - Fork 394
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
[Rootstock] Use network as derivation path #2673
[Rootstock] Use network as derivation path #2673
Conversation
cc: @alepc253 @0xDaedalus |
760f5da
to
df4944c
Compare
Also since this is user-facing, cc @VladUXUI @mr-michael. |
Need to digest a little bit more here, as i feel we need a better fix for this. Some addresses might be for Ethereum+RSK, so having the derivation path source isn't ideal and can cause some confusion down the line. Once user has onboarded with ETH, can't we add the derivation paths for RSK? thus user will see the assets in RSK (And vice-versa) Also this
can you say a bit more about "might" here? |
So in this PR i am trying to solve both "create" and "import" wallet flow with right derivation path based on selected network. Nifty wallet uses this kind of approach. Feel free to share further thoughts and ideas so that we could come with right approach. That's the goal of this PR. |
Thanks for the detailed answer @ahsan-javaiid I'm also good to create new recovery phrase based on what chain you are ok. But this isn't that user friendly, as it's not intuitive. I also understand your point about showing labels. I was under the impression that most users will just use the same address they have on Ethereum. But showing label for everything isn't that good, since most of them will say Ethereum, but for the user that might not be the case, not everybody knows that Ethereum address = L2, so it might cause some confusion. I need to do more mock-up work and thinking about how to extend this functionality more, so users have a better understanding and handholding while onboarding and beyond. Adding Select Network as first step of onboarding (Even with Ledger) Account selection after recovery phrase (similar to Ledger), this address has assets in this network and so on... But that is on me atm and should not block this release. Happy to ok this with the following changes:
Let me know if these make sense to you all and if there is anything i'm missing here |
df4944c
to
32216c2
Compare
Thanks Update from my side:
Tally tech team 👋 Feel free to share thoughts or review this pull request. |
Hi Tally team 👋 Let me know if you get a chance to review this pull request. There are benefits of keeping derivation path inside network:
Most welcome if tally team want to share any further thoughts. |
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.
Code-wise I think it is ok ✅
I don't like the UX and the onboarding flow while importing existing wallets.
When user is importing a wallet for the first time there is no way currently to get to the rsk derivation path flow. The user is stuck with the Ethereum default derivation path and you can't "change" the path once the wallet is imported - at least not in any intuitive way. I think we have to allow users to choose the path they want to import during onboarding to make sense of it. Otherwise, it will be like a "hidden" solution.
We may consider allowing importing the same wallet with two derivation paths (I haven't checked if this is possible technically).
That being said - a lot more prototyping and design work is needed to make it perfect so I'm ok with merging it at this stage as this is not breaking anything. What do you think team?
One small improvement that can be done if we will agree to merge it soon - we can add a warning on the onboarding page that the derivation path that is being used is different from the Ethereum default one and to change it the user has to change the network. (cc @VladUXUI)
|
||
const areKeyringsUnlocked = useAreKeyringsUnlocked(true) | ||
|
||
const [recoveryPhrase, setRecoveryPhrase] = useState("") | ||
const [errorMessage, setErrorMessage] = useState("") | ||
const [path, setPath] = useState<string>("m/44'/60'/0'/0") | ||
const [path, setPath] = useState<string>( | ||
selectedNetwork.derivationPath ?? "m/44'/60'/0'/0" |
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.
Can we make new variables in background/constants...
for these derivation paths (so we are not using plain strings)?
There actually is @jagodarybacka, what this PR introduces is also a derivation path selector. Need to flip off HIDE_IMPORT_DERIVATION_PATH. |
@VladUXUI I remember that we have this hidden dropdown for derivation paths 😉 Right now this PR is not flipping the flag but I think it would benefit from turning it on. Right now if we will merge it the derivation path dropdown will still be hidden but the behaviour of making the So my point is - we can flip the derivation path selector flag or we can inform our users during the onboarding process that the wallet import will use the derivation path based on the current network so this is not as opaque as it is now |
Ohhh, in that case let's flip Derivation Path on. The default derivation path when adding a second account can still be defaulted to current network. |
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.
As the derivation path selector is not working out of the box we can unblock this and improve it later by fixing the selector #2809
3c1016b
to
a897b7e
Compare
a897b7e
to
0f8c009
Compare
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.
Sorry for the delay here - LGTM!
Proposal:
Use network as derivation path to connect keychain with selected network
Reasons
1:
Rootstock
uses different derivation path as compared toethereum
. Tally uses onlyethereum
derivation path while importing or creating a wallet due to which users have to useethereum
dpath and they might not be able see funds onrootstock
accounts.2:
On the accounts screen user can see their wallets(technically keychain) with list of addresses inside it.
ethereum
network and imported a keychain using seed phrase. Now if user switches to other network(rootstock) then that wallet(keychain) still remains there. That can cause problem because user may use the same address on other network. But realistically that keychain belongs toethereum
network.So i think on the accounts screen there should be some labeling to show that this address is originally from ethereum or rootstock network.
or
Discuss if we need to show only those keychains that belongs to selected network or discuss side effects
Suggested solution
Use network as dpath to connect with keychain so that right addresses could be generated
Type of Change
Testing information
Accounts screen:
May be we have to show only those keychains that belongs to selected network or add some label to highlight which address or keychain corresponds to which network dpath. Check above diagram.
Checklist
Latest build: extension-builds-2673 (as of Wed, 25 Jan 2023 14:19:26 GMT).