Author

Topic: technical details for how a wallet move request works (Read 1869 times)

legendary
Activity: 1652
Merit: 2301
Chief Scientist
In a bank if you deposit X coins you can withdraw at most X.
My bank must be weird, they let me withdraw more than X and let me carry a negative balance for a little while (a service they charge for).

With the accounts feature, if you have an account containing X bitcoins there are two ways to overdraw it:

1. Using the move command. Negative balances have a lot of use-cases, and last time I checked accountants know how to deal with negative account balances.

2. Using the sendfrom command, if a transaction fee is required then the fee is charged to the "sendfrom" account and may take it negative.

Are you sometimes using "sendtoaddress" and sometimes "sendfrom" ? Or are you using both the GUI (designed for a single user's wallet) and the RPC?  If you want to use the accounts feature, don't do that, always use "sendfrom".

Better accounting for transaction fees is a valid complaint, always deducting the fee from the "sendfrom" account can be annoying. It doesn't violate accounting principles, though; if you want the transaction fee to be paid from some other account, then you just sendfrom() and then move() to adjust account balances.

If you really want to find something about the accounts feature to complain about, then you should complain that it doesn't scale.
donator
Activity: 1736
Merit: 1014
Let's talk governance, lipstick, and pigs.
I have no idea what 2112 is talking about RE: accountants having trouble figuring out how the accounts feature operates.  It is very much like separate accounts at a bank, where dollars and coins flow in, are credited to accounts, and then flow back out (debiting accounts).  If I take a bag of cash to the bank and have it deposited into my account, I don't expect to get exactly the same bills and coins out the next time I make a withdrawal, and I shouldn't be surprised if the bank uses those coins and bills for withdrawals from other accounts.
I know that you are trolling right now by pretending to be naive about how the bank works. I guess the real or feigned naivette about accounting is par for the Bitcoin course.

Quote from: Upton Sinclair
It is difficult to get a man to understand something, when his salary depends upon his not understanding it!

In a bank if you deposit X coins you can withdraw at most X.

I think the analogy he is making is if you deposit greenbacks and silver dimes into your bank account, when you withdraw you will most likely get crisp new bills and shiny new dimes.
legendary
Activity: 2128
Merit: 1073
I have no idea what 2112 is talking about RE: accountants having trouble figuring out how the accounts feature operates.  It is very much like separate accounts at a bank, where dollars and coins flow in, are credited to accounts, and then flow back out (debiting accounts).  If I take a bag of cash to the bank and have it deposited into my account, I don't expect to get exactly the same bills and coins out the next time I make a withdrawal, and I shouldn't be surprised if the bank uses those coins and bills for withdrawals from other accounts.
I know that you are trolling right now by pretending to be naive about how the bank works. I guess the real or feigned naivette about accounting is par for the Bitcoin course.

Quote from: Upton Sinclair
It is difficult to get a man to understand something, when his salary depends upon his not understanding it!

In a bank if you deposit X coins you can withdraw at most X.
donator
Activity: 1218
Merit: 1079
Gerald Davis
Quote
A is an account with a corresponding address, and likewise B (so there are two addresses in play with labels/accounts A and B).

Accounts don't have corresponding addresses on the send.  Addresses are linked to account for RECEIVING only (and only to determine which "account" the coins should be credited to. 

Quote
but when I use the "send" command the coins would still be sent from A (or any other accounts in the wallet that will make up the required sum).

Likely a typo I assume you mean address.

If you send from account "A" then account "A" balance will be reduced.  Funds can be sent from any address in the wallet.
As Gavin indicated like in a modern bank (or shared wallet) the coins are combined.  Accounts merely exists as an accounting mechanism. 

What would be more useful is a "multi-wallet" capability.  The ability for a single wallet.dat to contain 2+ discrete wallets or alternatively the ability for a client to load 2+ discrete wallet.dats.


sr. member
Activity: 243
Merit: 250
* A move does not create a tx on the network
* A move is really just an internal accounting ledger
* If I receive into A, move all coins into B, and then send from A, the coins will really be sent from B (since the move is just internal).
What do you mean "send from A" ?  Are A and B accounts or bitcoin addresses?

The reference client does not send coins "from" an address; when you send coins they are chosen from any of the available inputs in your wallet.

If you receive 50 BTC to an address associated with an empty account "A", then move those 50 bitcoins to account "B", then make the RPC call:
  sendfrom "A" 50

... you will get an error "Account has insuficient funds"


I have no idea what 2112 is talking about RE: accountants having trouble figuring out how the accounts feature operates.  It is very much like separate accounts at a bank, where dollars and coins flow in, are credited to accounts, and then flow back out (debiting accounts).  If I take a bag of cash to the bank and have it deposited into my account, I don't expect to get exactly the same bills and coins out the next time I make a withdrawal, and I shouldn't be surprised if the bank uses those coins and bills for withdrawals from other accounts.




Apologies if I was not clear.

A is an account with a corresponding address, and likewise B (so there are two addresses in play with labels/accounts A and B).

I think you did answer my question tho. From your description it seems that unless I use the sendfrom command, what will happen is that even though I did a "move" from A to B (which will just change how much is listed when I can do listaccounts, etc) but when I use the "send" command the coins would still be sent from A (or any other accounts in the wallet that will make up the required sum).

As a followup question (to make sure I understand correctly). If I wanted to have the sendfrom work, in that case I would need to actually send the coins from the address for A to the address for B and not simply use a move.
legendary
Activity: 1652
Merit: 2301
Chief Scientist
* A move does not create a tx on the network
* A move is really just an internal accounting ledger
* If I receive into A, move all coins into B, and then send from A, the coins will really be sent from B (since the move is just internal).
What do you mean "send from A" ?  Are A and B accounts or bitcoin addresses?

The reference client does not send coins "from" an address; when you send coins they are chosen from any of the available inputs in your wallet.

If you receive 50 BTC to an address associated with an empty account "A", then move those 50 bitcoins to account "B", then make the RPC call:
  sendfrom "A" 50

... you will get an error "Account has insuficient funds"


I have no idea what 2112 is talking about RE: accountants having trouble figuring out how the accounts feature operates.  It is very much like separate accounts at a bank, where dollars and coins flow in, are credited to accounts, and then flow back out (debiting accounts).  If I take a bag of cash to the bank and have it deposited into my account, I don't expect to get exactly the same bills and coins out the next time I make a withdrawal, and I shouldn't be surprised if the bank uses those coins and bills for withdrawals from other accounts.


legendary
Activity: 2128
Merit: 1073
This completely ignored my question. Regardless of how you feel about the current feature, it is present and I am looking for information as to how it works.
I was trying to give you a clue: the oldest and shrewdest accountants couldn't figure out how the account feature operates. I hereby refund all the money you've paid to get this clue from me. I'm sorry you wasn't satisfied. I got an impression that you are trying to account for the transaction fees in bitcoind.
sr. member
Activity: 243
Merit: 250
Please don't waste time on the "account" feature of the default wallet code. It is kind of a joke. If you need to do an accounting use the BerkeleyDB callbacks functions to record the changes to the wallet in your own separate database.

This completely ignored my question. Regardless of how you feel about the current feature, it is present and I am looking for information as to how it works.
legendary
Activity: 2128
Merit: 1073
Please don't waste time on the "account" feature of the default wallet code. It is kind of a joke. If you need to do an accounting use the BerkeleyDB callbacks functions to record the changes to the wallet in your own separate database.
sr. member
Activity: 243
Merit: 250
I have tried looking around for some docs/notes on how the 'move' rpc call works on a more technical level. From my understanding I have gathered the following (please correct any and all of the things I have listed and I might throw them up on the wiki).

* A move does not create a tx on the network
* A move is really just an internal accounting ledger
* If I receive into A, move all coins into B, and then send from A, the coins will really be sent from B (since the move is just internal).

Maybe I have missed something very fundamental about how the move command works but that is how I understand it to operate given what I have been able to find.
Jump to: