spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.35k stars 3.06k forks source link

Suggestion: Add multiple wallet support in single Electrum instance #4180

Open minecraft2048 opened 6 years ago

minecraft2048 commented 6 years ago

Use case: Lets say that someone have multiple wallets, either one segwit and one other non-segwit wallet, or they have multiple wallets to help with their budgeting, like using envelope budgeting but with bitcoins. They want to be able to spend bitcoins from their correct wallet.

Current situation: 1 Electrum instance can only open 1 wallet, and if someone clicked on a bitcoin: URI, Electrum with default_wallet wallet will open, which is probably not their correct wallet that they want to spend bitcoins from. There is no way to look up the total of all of their wallet balances without opening them one by one and adding them manually.

Suggestion: Add support for opening multiple wallet in single Electrum window, then add a new tab named Wallet where we can see balances for each wallet, and the sum of all balances inside that wallet tab. For send and receive tab, we can add a dropdown menu showing which wallet that we want to use to send and receive bitcoins respectively

SomberNight commented 6 years ago

I don't think we should do this.

I think this would complicate interface/UX too much; and somewhat the code too. (multiple files on disk or just one? multiple passwords or just one? would all wallets be automatically combined into a "mega-wallet" or would you choose which ones to "combine"? and if you manually combined them then how would you open them the next time? what would you see in history? ...)

Also, newbies would get confused what is backed up by their seed words.

What you are asking for sounds similar to the "account"-system (bip44-like) that existed before version 2.7, that was removed because of the UI complications; but your suggestion is even more general (and thus complex). IMHO this would imply many complications for little benefit.

Is your main problem with the current setup that clicking URIs opens the wrong wallet? Because the problem of having to manually sum up balances does not look too serious to me :)

When I started reading you comment I thought you are going to ask for the use case of spending from multiple wallets in a single transaction which would have been a more interesting thing to ask :P

minecraft2048 commented 6 years ago

Is your main problem with the current setup that clicking URIs opens the wrong wallet?

Yes. For now there is no way to select which wallet would open when clicking URIs, and the current solution of renaming 'correct wallet' default_wallet so that Electrum will open that as the default wallet fails when I'm using multiple wallets to manage budgeting (to be honest I'm not doing that right now, Steam stops accepting bitcoins and I don't know where to use bitcoins right now)

What you are asking for sounds similar to the "account"-system (bip44-like) that existed before version 2.7, that was removed because of the UI complications

Actually that is exactly what I wanted to have, and (re)supporting this instead of my original suggestion solves several complexity problems and newbie seed problem, but that UI complications means that we have more UI research that need to be done. And we probably need to start to do it now because if we decided to support Lightning Network then we have in effect 2 wallets in 1, then we need to have UI and codes to support selecting payment method, showing history of 2 'different' wallets transactions, ... Of course supporting only 1 more wallet is much easier than supporting arbitrary amounts of wallets inside 1 seed words

We don't need to implement this right now though

SomberNight commented 5 years ago

note: since https://github.com/spesmilo/electrum/commit/361ffc062053436f4625dbe54a6dd22d7adc8af7, if you click a URI, Electrum will use the 'gui_last_wallet' wallet (which is the wallet that was open when you last closed the whole app)