Guide icon indicating copy to clipboard operation
Guide copied to clipboard

Create page for on-chain wallet recovery / account scanning

Open johnsBeharry opened this issue 4 years ago • 3 comments

parent: Recovery
title: Recovering an on-chain wallet
permalink: /guide/recovery/on-chain

How does the wallet arrive at it's balance and what are the problems that the user may encounter during the process?

  • Derivation Paths
  • Choosing Address Type
  • Selecting Account
  • Defaults
  • Gap Limit

johnsBeharry avatar Jan 11 '21 08:01 johnsBeharry

There are 3 versions of addresses currently in use and a new one that is being released soon.

The 3 address versions can be identified by a prefix.

Version 1: beings with 1 Version 2: begins with 3 Version 3: begins with bc

Payments with version 3 addresses are cheaper - because of reasons...

Questions

  1. Which version of accounts are being scanned during the recovery process?
  2. The user may not be aware of these version and can be coming from a wallet that used a older one.
  3. There could be another step which is for account discovery.

Accounts

Accounts can each contain a maximum of 4.6 billion addresses which will refer to as payment request as they should only be used once.

Account Discovery works by scanning the first payment request in each account to see if it has received transactions - then moves on to scan the next account.

In the end the user is presented with a list of accounts that they can scan more deeply (account scanning).

WHICH ACCOUNT TO SCAN?

Rescanning is an expensive operation as it has to make lots of requests to check for the existence of transactions in each account in order to arrive at the users final balance

This is why it would be better if the user is able to identify which wallet they were previously using, or at least which version of addresses they want to restore.

That being said, asking the user which wallet they were previously using may not be ideal as there may so many to keep track of (see walletrecovery.org)


Below illustrates a problem with account discovery which is the gap limit. It is the result of gaps of unused addresses which due to the default scanning settings wallets use that completely abstract this behaviour to a background process checking only the first payment request (address) of each account or the first 20 payment requests of the first account.

account-scanning-with-gap-limit

johnsBeharry avatar Jan 11 '21 23:01 johnsBeharry

@johnsBeharry considering we have https://bitcoin.design/guide/private-key-management/backups/ should we rephrase what exactly needs to be done in this issue? It's not quite clear what's our goal here since the page changes.

Also #400 can be added as a to-do.

pavlenex avatar Aug 02 '21 09:08 pavlenex

In the context of Daily Spending wallets, they should have a simple button that lets them re-scan the blockchain in the case there is some issue receiving a transaction. Outside of that we should focus this issue on a Savings Wallet section of the guide.

Bosch-0 avatar Feb 21 '22 06:02 Bosch-0

  1. Address types explained here
  2. Gap limit explained a bit here https://bitcoin.design/guide/glossary/#gap-limit
  3. This could potentially allow us to create Settings page in the saving wallet with the option to rescan users balance https://bitcoin.design/guide/savings-wallet/, we will open a new issue for this one to address Boschs' feedback.

pavlenex avatar Nov 22 '22 10:11 pavlenex