0LNetworkCommunity / carpe

Apache License 2.0
97 stars 48 forks source link

[Feature Request] Importing legacy accounts #263

Open ghost opened 7 months ago

ghost commented 7 months ago

🚀 Feature Request

Many users report they're unable to access their legacy address funds after importing their mnemonic, seeing a different address. I believe carpe currently performs a reverse lookup on chain to get address and if there is connectivity issues this can sometimes result in a new address being imported based on their authkey rather than their legacy account prepended with 32 0's. Further issues arise if users are confused and attempt to onboard the newly created account.

My suggestion would be to simply include a checkbox for "legacy account" when importing mnemonic/privatekey and so derivation is hardcoded in this scenario.

BBK912 commented 7 months ago

@siliconbits If the user just imports a V5 account, Carpe will show the correct address, only if the user onboard it again with the onboardkey will the address be different.

ghost commented 7 months ago

@BBK912 that's the expected behaviour yes however in some circumstances importing a V5 account results in a different address with 0 balance. I've been able to reproduce this issue when I'm unable to connect to the network, I simply disabled my internet connection before running Carpe to achieve this state. Below is a breakdown:

Carpe v0.5 Address: 4CAA3A8296233E4DEE2809F440602E31 Authkey: 1951A472115EB983D0CD4429D0A8200B4CAA3A8296233E4DEE2809F440602E31 This address has previously received coins: https://0l.fyi/accounts/4CAA3A8296233E4DEE2809F440602E31

When importing this accounts mnemonic into Carpe v1.0.3 there are 2 possible outcomes:

Address derived correctly (when no connectivity issues): 000000000000000000000000000000004caa3a8296233e4dee2809f440602e31 Showing expected balance.

Address derived incorrectly (when there's a connection issue): 1951a472115eb983d0cd4429d0a8200b4caa3a8296233e4dee2809f440602e31 0 balance - user is instructed to onboard the address.

As mentioned further problems arise when a user thinks they need onboard this new address. Onboarding the 1951a.. address results in the 0000... address no longer being accessible in Carpe. The 1951a... address is now derived by default when importing the mnemonic (even on a clean Carpe install).

Note, the 0000 address is still derived when instead importing the mnemonic with the mobile wallet Oollet.

BBK912 commented 5 months ago

280