Bitcoin Forum
May 11, 2024, 01:45:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: satoshi-client: why are the balances in "listaccounts" bogus?  (Read 1083 times)
AvL42 (OP)
Full Member
***
Offline Offline

Activity: 216
Merit: 100


View Profile
September 30, 2012, 03:20:19 AM
Last edit: September 30, 2012, 03:31:18 AM by AvL42
 #1

When I enter command "listaccounts" in the debug-console, I see this:

{
"" : -1.48690711,
"foo" : 0.26174872,
"bar" : 1.28402884,
... (plus some accounts of miniscule but correct balances)
}

I've only recently started with bitcoins, collecting from free-bitcoin-sites
and never so far owned more than 0.1 bitcoins.

Where does it get these numbers from, and why is the empty account's
balance negative?  All the addresses in my wallet are assigned to
accounts.
1715435111
Hero Member
*
Offline Offline

Posts: 1715435111

View Profile Personal Message (Offline)

Ignore
1715435111
Reply with quote  #2

1715435111
Report to moderator
"I'm sure that in 20 years there will either be very large transaction volume or no volume." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715435111
Hero Member
*
Offline Offline

Posts: 1715435111

View Profile Personal Message (Offline)

Ignore
1715435111
Reply with quote  #2

1715435111
Report to moderator
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
September 30, 2012, 04:25:44 AM
 #2

If you add up those numbers you end up with 0.05887045 (so well under the 0.1 amount you mentioned) but how those numbers got there in the first place seems a little strange.

Did you use the "move" RPC command at all?

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
AvL42 (OP)
Full Member
***
Offline Offline

Activity: 216
Merit: 100


View Profile
September 30, 2012, 04:47:14 AM
 #3

If you add up those numbers you end up with 0.05887045 (so well under the 0.1 amount you mentioned) but how those numbers got there in the first place seems a little strange.

Did you use the "move" RPC command at all?

Yes, the total sum is correct.
I don't think I used "move" specifically. I haven't actually initiated any transaction
from my local client, yet. (I use blockchain.info wallet for that) I've only imported
a few of my blockchain-wallet privkeys into local satoshi-client - mainly for reasons
of a second viewpoint on the relevant transactions.

My surprise is really about how these numbers are arrived at.
How can it see more "activity" on an address than ever existed for it?
(I guess, the negative balance for "" then is just the difference to the
actual balance)
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
September 30, 2012, 05:14:27 AM
 #4

Yes, the total sum is correct.

That's good to know.

I don't think I used "move" specifically. I haven't actually initiated any transaction
from my local client, yet. (I use blockchain.info wallet for that) I've only imported
a few of my blockchain-wallet privkeys into local satoshi-client - mainly for reasons
of a second viewpoint on the relevant transactions.

My surprise is really about how these numbers are arrived at.
How can it see more "activity" on an address than ever existed for it?
(I guess, the negative balance for "" then is just the difference to the
actual balance)

I am pretty sure (but not 100% certain as I haven't played with it yet) that the Satoshi client will enable you to create negative balances via the "move" command. No actual tx is created when doing such an operation (it's wallet only data) and is allowed so that someone using bitcoin as a service could say issue a fee to an account before it has been paid.

If you didn't issue any "move" commands though then perhaps it is something more to do with the private key that was imported (perhaps check the blockchain info for the public key to see if the address was involved any tx's in the past).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
September 30, 2012, 06:52:37 AM
 #5

You created labels (accounts) for some addresses, and then you received bitcoins with them.  Then you spent them without specifying a label (account) that they should come out of, meaning they were deducted from the "" account.

Accounts are just an internal bookkeeping system.  The actual transactions in your wallet don't carry the tags with them.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
AvL42 (OP)
Full Member
***
Offline Offline

Activity: 216
Merit: 100


View Profile
September 30, 2012, 10:17:35 AM
 #6

You created labels (accounts) for some addresses, and then you received bitcoins with them.  Then you spent them without specifying a label (account) that they should come out of, meaning they were deducted from the "" account.

Accounts are just an internal bookkeeping system.  The actual transactions in your wallet don't carry the tags with them.

Now that's new to me.  I thought, by assigning some address to an account,
I'd essentially tell the satoshi-client to consider any tx-endpoint (input or output)
involving that address (no matter how or where it was generated) as belonging
to that account. Kind of like partitioning the wallet.  (I didn't really understand
how "move" worked in that model, but when one is new to a concept then
perceived inconsistencies are not immediately minded, but sometimes kept until
it becomes clear how to really resolve them.)

As it seems to me now, each transaction's money itself is associated with an
account. Received outputs are associated to the respective address's account,
but spends (at least, those not generated by the satoshi-client itself) get booked
on the "" account. And "move" may be used to update the inter-account balances.

Getting money to one account and paying from another (already negative
balanced) account now seems oh so "real-world-money"-ish to me ;-)
b!z
Legendary
*
Offline Offline

Activity: 1582
Merit: 1010



View Profile
September 30, 2012, 01:18:25 PM
 #7

You created labels (accounts) for some addresses, and then you received bitcoins with them.  Then you spent them without specifying a label (account) that they should come out of, meaning they were deducted from the "" account.

Accounts are just an internal bookkeeping system.  The actual transactions in your wallet don't carry the tags with them.

Now that's new to me.  I thought, by assigning some address to an account,
I'd essentially tell the satoshi-client to consider any tx-endpoint (input or output)
involving that address (no matter how or where it was generated) as belonging
to that account. Kind of like partitioning the wallet.  (I didn't really understand
how "move" worked in that model, but when one is new to a concept then
perceived inconsistencies are not immediately minded, but sometimes kept until
it becomes clear how to really resolve them.)

As it seems to me now, each transaction's money itself is associated with an
account. Received outputs are associated to the respective address's account,
but spends (at least, those not generated by the satoshi-client itself) get booked
on the "" account. And "move" may be used to update the inter-account balances.

Getting money to one account and paying from another (already negative
balanced) account now seems oh so "real-world-money"-ish to me ;-)


Yes, you can consider Bitcoin real world money. Smiley
AlexWhite
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
September 30, 2012, 02:57:48 PM
 #8

Received outputs are associated to the respective address's account,
but spends (at least, those not generated by the satoshi-client itself) get booked
on the "" account. And "move" may be used to update the inter-account balances.

You can use the 'sendfrom' RPC command to send from an account other than ""
This wiki page explains it:  https://en.bitcoin.it/wiki/Accounts_explained
AvL42 (OP)
Full Member
***
Offline Offline

Activity: 216
Merit: 100


View Profile
September 30, 2012, 03:22:18 PM
 #9

Received outputs are associated to the respective address's account,
but spends (at least, those not generated by the satoshi-client itself) get booked
on the "" account. And "move" may be used to update the inter-account balances.

You can use the 'sendfrom' RPC command to send from an account other than ""
This wiki page explains it:  https://en.bitcoin.it/wiki/Accounts_explained


I've read a couple of pages of that wiki already (mostly lowlevel stuff, like scripts, ...),
but have so far missed this one. Thanks for pointing to it.

Quote
from the mentioned wiki:
 There is no way to ask Bitcoin to "create a payment transaction using the coins received
 from these previously received transactions."

I find this a pity.  blockchain at least lets me pick which address's transactions to make
the new payment from, but the satoshi-client doesn't seem to even allow that.
AlexWhite
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
September 30, 2012, 03:24:42 PM
 #10

That wiki page needs updating, the new 'raw transactions' api lets you create transactions from specific previous transactions.

See:  https://en.bitcoin.it/wiki/Raw_Transactions
AvL42 (OP)
Full Member
***
Offline Offline

Activity: 216
Merit: 100


View Profile
October 01, 2012, 11:29:02 PM
 #11

That wiki page needs updating, the new 'raw transactions' api lets you create transactions from specific previous transactions.
See:  https://en.bitcoin.it/wiki/Raw_Transactions

It seems I'm too dumb to use this API.

Usage is:
  createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}

Assuming "9a8b7c6d5e4f" and 1 were the "txid" and "vout" of a previous
output and "1abc" some target address, I tried (within the debug-console):

Code:
createrawtransaction [{"txid":"9a8b7c6d5e4f","vout":1}] {"1abc":42}
Error: Error parsing JSON:[{txid:9a8b7c6d5e4f,vout:1}]

and

Code:
createrawtransaction '{["txid":"9a8b7c6d5e4f","vout":1}]' '{"1abc":42}'
Error: Error parsing JSON:{["txid":"9a8b7c6d5e4f","vout":1}]

What am I missing?
AlexWhite
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
October 02, 2012, 12:51:44 PM
 #12

[
Code:
createrawtransaction '{["txid":"9a8b7c6d5e4f","vout":1}]' '{"1abc":42}'
Error: Error parsing JSON:{["txid":"9a8b7c6d5e4f","vout":1}]
What am I missing?

You started with curly-brace then square-brace.  Try [{...}]
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!