public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [Bitcoin-development]  Multiwallet support
@ 2012-12-21  8:53 Eric Lombrozo
  2012-12-21 13:20 ` Gregory Maxwell
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Lombrozo @ 2012-12-21  8:53 UTC (permalink / raw)
  To: Bitcoin Dev

[-- Attachment #1: Type: text/plain, Size: 2199 bytes --]

I started working on a new feature to allow for watch-only addresses in wallets. https://github.com/bitcoin/bitcoin/pull/2121

In order to integrate this feature nicely into bitcoin / bitcoin, it will be necessary to disable signing and privkey export operations for watch-only addresses. Since disabling these things for only some of the keys in a wallet but not others is an API nightmare and complicates CreateTransaction logic, I propose adding multiple wallet capabilities and specifying upon creation whether a wallet is a:

1)  full signing wallet
	- importaddress is disabled.

2) watch-only wallet
	- signing and privkey export operations are disabled.
	- importprivkey only saves the associated address but not the private key. (behaves like importaddress <address for privkey>)

In order to do the above, it will be necessary to add multiple wallet support. Anyhow, that was my initial motivation for multiple wallets - but obviously, there are a number of other reasons why people might want multiple wallet support.

----------------------

Adding the ability to specify multiple wallets with associated names and passphrases in the config file should be fairly straightforward. However, exposing multiple wallets via RPC will be tricky as the existing RPC is not designed to support multiple wallets.

As to not break compatibility with the existing RPC calls, we can have a main wallet which is always used as the default wallet. If the user wants to use a different wallet, the name of the wallet would have to be specified in the call. Unfortunately, it doesn't look like we can use many of the existing RPC calls (sendfrom, sendmany,sendtoaddress, etc...) since they all have optional parameters already and it would be awkward to just tack on the wallet name parameter at the end. Also, walletpassphrase is problematic as it is not stateless. So it looks like we need a whole separate set of calls which require a wallet name and passphrase (if the wallet is encrypted).

For instance,
	walletsendtoaddress <walletname> <passphrase> <bitcoinaddress> <amount> [comment] [comment-to]

I welcome any proposals or suggestions as to how this should be done.



[-- Attachment #2: Type: text/html, Size: 3880 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bitcoin-development] Multiwallet support
  2012-12-21  8:53 [Bitcoin-development] Multiwallet support Eric Lombrozo
@ 2012-12-21 13:20 ` Gregory Maxwell
  2012-12-21 18:11   ` Eric Lombrozo
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Maxwell @ 2012-12-21 13:20 UTC (permalink / raw)
  To: Eric Lombrozo; +Cc: Bitcoin Dev

On Fri, Dec 21, 2012 at 3:53 AM, Eric Lombrozo <elombrozo@gmail.com> wrote:
> I started working on a new feature to allow for watch-only addresses in
> wallets. https://github.com/bitcoin/bitcoin/pull/2121
>
> In order to integrate this feature nicely into bitcoin / bitcoin, it will be
> necessary to disable signing and privkey export operations for watch-only
> addresses. Since disabling these things for only some of the keys in a
> wallet but not others is an API nightmare and complicates CreateTransaction
> logic, I propose adding multiple wallet capabilities and specifying upon
> creation whether a wallet is a:
>
> 1)  full signing wallet
> - importaddress is disabled.
>
> 2) watch-only wallet
> - signing and privkey export operations are disabled.
> - importprivkey only saves the associated address but not the private key.
> (behaves like importaddress <address for privkey>)
>
> In order to do the above, it will be necessary to add multiple wallet
> support. Anyhow, that was my initial motivation for multiple wallets - but
> obviously, there are a number of other reasons why people might want
> multiple wallet support.
>
> ----------------------
>
> Adding the ability to specify multiple wallets with associated names and
> passphrases in the config file should be fairly straightforward. However,
> exposing multiple wallets via RPC will be tricky as the existing RPC is not
> designed to support multiple wallets.
>
> As to not break compatibility with the existing RPC calls, we can have a
> main wallet which is always used as the default wallet. If the user wants to
> use a different wallet, the name of the wallet would have to be specified in
> the call. Unfortunately, it doesn't look like we can use many of the
> existing RPC calls (sendfrom, sendmany,sendtoaddress, etc...) since they all
> have optional parameters already and it would be awkward to just tack on the
> wallet name parameter at the end. Also, walletpassphrase is problematic as
> it is not stateless. So it looks like we need a whole separate set of calls
> which require a wallet name and passphrase (if the wallet is encrypted).
>
> For instance,
> walletsendtoaddress <walletname> <passphrase> <bitcoinaddress> <amount>
> [comment] [comment-to]
>
> I welcome any proposals or suggestions as to how this should be done.
>

How about a rpc like "usewallet <foo> <normal RPC>"  that simply
generalizes all the rpcs?

And instead of explicitly deactivating rpcs that don't make sense,
simply have them return an error.  Or, for example,  sendtoaddress on
a watching wallet should actually return an unsigned raw transaction
and a wallet specific message that tells you where to find the private
key.

I think it's desirable to not break compatibility but for this kind of
feature compatibility should not get in the way of doing it right.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bitcoin-development] Multiwallet support
  2012-12-21 13:20 ` Gregory Maxwell
@ 2012-12-21 18:11   ` Eric Lombrozo
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Lombrozo @ 2012-12-21 18:11 UTC (permalink / raw)
  To: Gregory Maxwell; +Cc: Bitcoin Dev

I like that idea. I'm close to having something working along those lines. Hopefully I'll be able to push something by tonight.

> 
> How about a rpc like "usewallet <foo> <normal RPC>"  that simply
> generalizes all the rpcs?
> 
> And instead of explicitly deactivating rpcs that don't make sense,
> simply have them return an error.  Or, for example,  sendtoaddress on
> a watching wallet should actually return an unsigned raw transaction
> and a wallet specific message that tells you where to find the private
> key.
> 
> I think it's desirable to not break compatibility but for this kind of
> feature compatibility should not get in the way of doing it right.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-21 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-21  8:53 [Bitcoin-development] Multiwallet support Eric Lombrozo
2012-12-21 13:20 ` Gregory Maxwell
2012-12-21 18:11   ` Eric Lombrozo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox