Author

Topic: Question about move() command (Read 856 times)

legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
September 15, 2011, 07:08:21 PM
#6
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.
Right, which just requires changing the "5" to a "6" and the "10" to a "9".

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:
- 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
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.
legendary
Activity: 1072
Merit: 1181
September 15, 2011, 06:44:52 AM
#5
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).
hero member
Activity: 576
Merit: 514
September 15, 2011, 06:23:38 AM
#4
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
legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
September 15, 2011, 06:09:24 AM
#3
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.
legendary
Activity: 1072
Merit: 1181
September 15, 2011, 05:26:47 AM
#2
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.
hero member
Activity: 576
Merit: 514
September 15, 2011, 05:05:05 AM
#1
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?
Jump to: