Bitcoin Forum
December 04, 2016, 10:31:34 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: technical details for how a wallet move request works  (Read 1681 times)
shtylman
Sr. Member
****
Offline Offline

Activity: 243



View Profile
July 15, 2012, 11:06:55 PM
 #1

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.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480890694
Hero Member
*
Offline Offline

Posts: 1480890694

View Profile Personal Message (Offline)

Ignore
1480890694
Reply with quote  #2

1480890694
Report to moderator
1480890694
Hero Member
*
Offline Offline

Posts: 1480890694

View Profile Personal Message (Offline)

Ignore
1480890694
Reply with quote  #2

1480890694
Report to moderator
1480890694
Hero Member
*
Offline Offline

Posts: 1480890694

View Profile Personal Message (Offline)

Ignore
1480890694
Reply with quote  #2

1480890694
Report to moderator
2112
Legendary
*
Offline Offline

Activity: 1708



View Profile
July 15, 2012, 11:19:17 PM
 #2

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.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
shtylman
Sr. Member
****
Offline Offline

Activity: 243



View Profile
July 15, 2012, 11:36:38 PM
 #3

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.
2112
Legendary
*
Offline Offline

Activity: 1708



View Profile
July 15, 2012, 11:42:56 PM
 #4

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.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 16, 2012, 01:12:29 PM
 #5

* 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" <to_address> 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.



How often do you get the chance to work on a potentially world-changing project?
shtylman
Sr. Member
****
Offline Offline

Activity: 243



View Profile
July 16, 2012, 01:51:11 PM
 #6

* 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" <to_address> 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.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218


Gerald Davis


View Profile
July 16, 2012, 02:01:59 PM
 #7

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.


2112
Legendary
*
Offline Offline

Activity: 1708



View Profile
July 16, 2012, 02:58:10 PM
 #8

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.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
cbeast
Donator
Legendary
*
Offline Offline

Activity: 1722

Let's talk governance, lipstick, and pigs.


View Profile
July 16, 2012, 03:10:18 PM
 #9

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.

Any significantly advanced cryptocurrency is indistinguishable from Ponzi Tulips.
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
July 16, 2012, 03:13:08 PM
 #10

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.

How often do you get the chance to work on a potentially world-changing project?
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!