Title: Question about move() command Post by: Bitsky on September 15, 2011, 10:05:05 AM The API documentation states that one can move Bitcoins from one account to another one in your wallet with move() by specifying from, to and the amount.
Since addresses are assigned to accounts with setaccount(), I don't think that move() is just moving addresses, but actually doing a transaction (hence the amount option). Now if I want to use move() to reorganize / shuffle around the Bitcoins in my wallet, will I a) have to pay a transaction fee every time I move an amount and b) generate an entry in the blockchain? Also, the amount is rounded to the nearest 0.01. Will it be possible to move smaller amounts in the future? Title: Re: Question about move() command Post by: Pieter Wuille on September 15, 2011, 10:26:47 AM Accounts have very little to do with addresses, they're just virtual balances. Move does not perform a transaction, it only increases the balance of one account and decreases another.
Title: Re: Question about move() command Post by: JoelKatz on September 15, 2011, 11:09:24 AM Addresses are assigned to accounts only to determine which account's balance to increase if new coins arrive. Any coins you hold belong to your wallet. Account balances are purely for user convenience.
Title: Re: Question about move() command Post by: Bitsky on September 15, 2011, 11:23:38 AM Figured that accounts are only used for some sort of summaries.
Let's say I have two accounts in my wallet: - acc1 with addr1 holding 5btc - acc2 with addr2 holding 10btc When I do a move(acc2, acc1, 1), then 1btc should wander from acc2 into acc1. But how is this handled address-wise? The moved bitcoin needs to be removed from addr2 and added either to addr1 or to a new address which gets assigned to acc1. So either: - acc1 with addr1 holding 6btc - acc2 with addr2 holding 9btc or - acc1 with addr1 holding 5btc and addr3 holding 1btc - acc2 with addr2 holding 9btc Title: Re: Question about move() command Post by: Pieter Wuille on September 15, 2011, 11:44:52 AM Again, coins are not moved between addresses. There is only one pool of coins the client chooses from, and it represents the entire wallet.
Accounts are only summaries, and have no connection to the actual addresses the available coins were last sent to (in fact, coins do not necessarily have an address they were last sent to). Title: Re: Question about move() command Post by: JoelKatz on September 16, 2011, 12:08:21 AM Figured that accounts are only used for some sort of summaries. Right, which just requires changing the "5" to a "6" and the "10" to a "9".Let's say I have two accounts in my wallet: - acc1 with addr1 holding 5btc - acc2 with addr2 holding 10btc When I do a move(acc2, acc1, 1), then 1btc should wander from acc2 into acc1. Quote But how is this handled address-wise? The moved bitcoin needs to be removed from addr2 and added either to addr1 or to a new address which gets assigned to acc1. No, it doesn't. You've moved it from one account to another, not from one address to another.Quote So either: The fact that addr1 is associated with acc1 means *ONLY* that newly-received coins sent to addr1 are credited to acc1. If a new address needed to be created, there would be no reason to associate it with acc1 specifically and in fact it would be associated with the default account.- acc1 with addr1 holding 6btc - acc2 with addr2 holding 9btc or - acc1 with addr1 holding 5btc and addr3 holding 1btc - acc2 with addr2 holding 9btc |