Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: CoinBeyond on April 12, 2014, 02:31:29 AM



Title: Problems with multisig transactions in bitcoind with default account in regtest.
Post by: CoinBeyond on April 12, 2014, 02:31:29 AM
I've been attempting to do transactions to and from a multisig address for a couple of days, but I'm finding that my default account "" keeps paying for things, even though I'm explicitly saying other accounts should pay for things via the txid field in createrawtransaction.

For a quick example, if I create a transaction like:

bitcoind createrawtransaction [{\"txid\":\"504aa16418fbb871d307249448bcecdaa5699872a4d22b84d170ae64a2fe89ca\",\"vout\":0}], {\"2NASaVRks1dFupX1e6y3SK8BomjhvSv7xGh\":50}

(It's formatted this way because I'm running this in a windows command prompt at the moment, hope to be able to run linux soon!)

the account associated to the address in the transaction's vout where n=0 is "test", but after I sign and send this raw transaction and check listaccounts, "" is debited 50 instead of "test".

If it helps at all, 2NASaVRks1dFupX1e6y3SK8BomjhvSv7xGh is a 2 of 3 address of which "test" is a part of.

Am I doing something wrong, or is this just how bitcoind handles situations where all of the addresses in a (multisig) transaction are associated with accounts in my wallet? And if so, why??

It's also all being done in regtest mode, but I wouldn't expect bitcoind to handle transactions differently in that mode.


Title: Re: Problems with multisig transactions in bitcoind with default account in regtest.
Post by: fbueller on April 12, 2014, 09:36:33 AM
The accounts feature is broken, can't scale up to many users, and has even once told me all ihad a balance available using  accounts were empty (even though I had a balance on getinfo.).

So before you go and code something, don't use accounts to store keys for different users!


Title: Re: Problems with multisig transactions in bitcoind with default account in regtest.
Post by: CoinBeyond on April 12, 2014, 11:19:56 PM
Good to know it's a problem with accounts and not me. Has anyone filed a big report?


Title: Re: Problems with multisig transactions in bitcoind with default account in regtest.
Post by: fbueller on April 13, 2014, 09:32:47 AM
It seems to be just 'known.' - this sort of thing has happened https://bitcointalk.org/index.php?topic=550366.msg5987199#msg5987199

Also, as you have probably seen in the move command, (and although BTC are spent by redeeming an unspent BTC (and the whole TxOut must be spent in the new transaction)) you can move arbitrary amounts. What happens if your wallet has only only has one unspent outpout and keeps that money in two accounts, but you spend the balance of one?


Title: Re: Problems with multisig transactions in bitcoind with default account in regtest.
Post by: Gavin Andresen on April 13, 2014, 04:43:23 PM
transactions send via sendrawtransaction are always debited from the default "" account. Raw transactions and accounts are not designed to work together, use one or the other .

And preferably not accounts: unless somebody steps up and volunteers to make the accounts feature "industrial-strength" (scalable, integrates with whatever back-end database your company is using to track user information, can be robustly backed up, etc) it is very likely it will be deprecated and then dropped.


Title: Re: Problems with multisig transactions in bitcoind with default account in regtest.
Post by: CoinBeyond on April 14, 2014, 02:58:54 AM
Thanks for the clarity!  With the rising popularity and power-limitation of multisig, I guess that the accounts feature wouldn't be worth investing to be modified to use industrially, since we may be moving away from online bitcoin hosts having direct control over one's bitcoins.

Quote
and the whole TxOut must be spent in the new transaction

I learned this the hard way too.  Does this mean that any unspent TxOut in the new transaction are sent as miner's fees?