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

Wallet batch operation #175

Closed
polymorpher opened this issue Oct 28, 2021 · 1 comment
Closed

Wallet batch operation #175

polymorpher opened this issue Oct 28, 2021 · 1 comment

Comments

@polymorpher
Copy link
Owner

The current 1wallet (smart contract) implementation only allows a single operation per transaction. Here, a transaction means a single OTP used by the user (and the wallet client) to commit and reveal the operation to the blockchain. A single operation means one of the OperationTypes as defined in

enum OperationType {

Even though CALL is expanded to encompass multiple contract calls in a single operation in v12.1 release, it cannot be used to execute multiple operations from the 1wallet itself. The absence of such batch operation is the root cause of poor user experience for wallet upgrade, token and collectible tracking, and domain transfer. For example, during an upgrade, the following operations should be completed on the wallets, ideally using only a single OTP provided by the user:

  1. Creating a new wallet using identical parameters of the old wallet, but with backlinks set to the old wallet's backlinks plus the old wallet's address
  2. OVERRIDE_TRACK: Synchronize locally tracked tokens with the old wallet's smart contract (so these tokens can be automatically forwarded to the new wallet)
  3. FORWARD: set the forwarding address of the old wallet to the new wallet (and automatically forward tracked assets, including ONE within daily spend limit)
  4. RECLAIM_DOMAIN_FROM_BACKLINK (on new wallet): transfer the domain owned by old wallet to the new wallet and register the new wallet on the reverse registrar
  5. OVERRIDE_TRACK (on new wallet): Synchronize locally tracked tokens with the new wallet's smart contract.

Since steps 1-4 each is an operation, without batch operation, each of them would require separate OTP authentication to complete. It would be a horrendous user experience if we ask the user to type four different OTPs separately. As a compromise, the current version of 1wallet only performs the second step during an upgrade. The user has to do (3) later if they want (see Reclaim feature in https://github.com/polymorpher/one-wallet/releases/tag/v0.13.1). Token and collectible tracking is reset (except for assets automatically forwarded to the new wallet, in which case the collectibles are automatically tracked upon recipient)

With batch operation, all of the above can be combined and performed in one go at the time of wallet upgrade, delivering a consistent, pleasant upgrade experience.

This feature will be made available within the next two major versions.

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

No branches or pull requests

1 participant