Skip to content

Wallet v2 #2169

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

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Wallet v2 #2169

wants to merge 16 commits into from

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented May 18, 2025

Description

Close #1495

High level overview

  • ✅ refactor vault (Migrate vault entries to new schema #2092)
    • ℹ️ new Vault table no longer contains foreign keys to wallets or users
    • ℹ️ wallets now point to the vault within their config, not separated from it
  • ✅ support multiple receive and send protocols per wallet on the backend (Wallet schema v2 #2146)
    • ℹ️ new wallet schema consists of the following tables:
      • WalletTemplate
      • UserWallet
      • ProtocolWallet
      • table for each send and recv protocol (WalletSendNWC, WalletRecvNWC, ...)
  • ✅ store send and receive config in separate tables for easier integrity checks (Wallet schema v2 #2146)
  • 🚧 JSDoc for protocols
    • ✅ client
    • 🚧 server
  • 🚧 always store all wallet logs on the server
    • ℹ️ no code to manage different sources
    • ℹ️ consistent logs across all devices
  • ✅ separate wallets from protocols in frontend for better UX
    • ℹ️ we now show cards of wallets which have protocols inside of them
    • ℹ️ users can easier find a wallet to attach by just looking at their names/logos, instead of having to know if they have a wallet that supports a protocol that we also support
  • 🚧 create a list of wallets with the protocols they support
    • ✅ insert wallets with protocol support into static WalletTemplate table
    • 🚧 double-check protocol support per wallet and if I missed any
    • 🚧 add placeholder protocols?
  • ✅ restructure wallets/ folder
    • ℹ️ client/server wallet imports are now split on the highest level: client only imports stuff from wallets/client/ and server only from wallets/server
    • ℹ️ everything (exclusively) wallet related, including validation, was moved to the wallets/ folder
  • 🚧 wallet I/O
    • ✅ load plaintext wallets
    • ✅ load encrypted wallets
    • 🚧 save plaintext wallets
    • 🚧 save encrypted wallet
  • 🚧 let users search for their wallet
    • ℹ️ (fuzzy) search should have autocomplete for wallet names
  • include wizard / multi-step forms probably not in this PR
  • 🚧 remove the requirement to have device sync enabled for a gun
  • 🚧 show status of wallet tests on attach in dedicated UI instead of relying on wallet logs 🚧
  • 🚧 set wallet send/recv status via trigger instead of deriving from logs 🚧
  • 🚧 don't show "logs", show wallet events like a wallet
    • ℹ️ this means that there won't be multiple log messages for the same payment. we will just show the current status of a payment, just like a wallet would do.

Screenshots

tbd

Additional Context

tbd

Checklist

Are your changes backwards compatible? Please answer below:

tbd

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

tbd

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

tbd

Did you introduce any new environment variables? If so, call them out explicitly here:

tbd

@ekzyis ekzyis added the wallets label May 18, 2025
Copy link

gitguardian bot commented May 18, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
16991000 Triggered Generic High Entropy Secret 0188e8d docker/db/wallet-seed.sql View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@ekzyis ekzyis marked this pull request as draft May 18, 2025 05:22
@ekzyis ekzyis force-pushed the wallet-v2 branch 16 times, most recently from 8ab0a08 to afcc412 Compare May 23, 2025 22:58
ekzyis added 5 commits May 25, 2025 18:45
* Migrate existing vault entries to new schema

* Read+write new vault schema

* Drop VaultEntry table

* Refactor vaultPrismaFragments

* Remove wrong comment

* Remove TODO

* Fix possible race condition on update of vault key

* Remove lib/object.js
@ekzyis ekzyis force-pushed the wallet-v2 branch 2 times, most recently from 1f1d8bd to 9422b4a Compare May 26, 2025 08:41
* useWalletQuery now returns decrypted wallets
* Refactor useIndexedDB because its only purpose will be to store the key, so no need for pagination code etc.
* There is still a bug: if the wallet is not decrypted on first render, the form will not see the decrypted value. See TODO.
it no longer uses a JSON file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

redesign of attached wallet page
1 participant