Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: rupy on April 07, 2013, 11:23:15 AM



Title: JSON API Accounts
Post by: rupy on April 07, 2013, 11:23:15 AM
Why does the API have accounts?

I mean you wan't the thirdparty to handle accounts since you'll be able to put parts of the BTC in cold storage AND transfer BTC between accounts without creating a transaction in the blockchain!


Title: Re: JSON API Accounts
Post by: CIYAM on April 07, 2013, 11:27:54 AM
If you transfer amounts between "accounts" (via move) then I am pretty sure that no blockchain tx occurs (the accounts are to help with handling "user accounts" for a Bitcoin service).


Title: Re: JSON API Accounts
Post by: rupy on April 07, 2013, 12:00:12 PM
Ok, thanks!

How are these implemented, is the database fast and scalable?


Title: Re: JSON API Accounts
Post by: CIYAM on April 07, 2013, 12:04:01 PM
Am pretty sure the information is stored in your wallet (so Berkley DB) but I have no idea how well indexed it is.


Title: Re: JSON API Accounts
Post by: rupy on April 07, 2013, 12:35:55 PM
Ok, I guess there's no way to configure passwords independently on these accounts?

One ugly way of solving this is to name the account "<name>:<pass>" but otherwise you need a separate database for auth. data.


Title: Re: JSON API Accounts
Post by: CIYAM on April 07, 2013, 12:38:15 PM
It doesn't have any support for passwords (so you need to use your own DB for that) - it is really just a way of putting labels against tx's (and "moves") and then being able to check "balances" (which btw can be negative).

I might be mistaken but I don't believe that many Bitcoin projects actually use the accounts feature.


Title: Re: JSON API Accounts
Post by: rupy on April 07, 2013, 12:40:10 PM
Yes, just realized one user can have multiple accounts... thanks for the "move" clarification!

Yes, agree accounts should be handled by my own database, the wallet will be bloated enough with just addresses, can't imagine what the Mt.Gox wallet looks like for example, it must be HUUUUGE!

Maybe they have multiple? Or their own wallet implementation?


Title: Re: JSON API Accounts
Post by: CIYAM on April 07, 2013, 12:53:53 PM
I understand that Gox uses their own custom bitcoind - other than that I don't know much more (although I would be sure they are also using a separate DB to manage user accounts).


Title: Re: JSON API Accounts
Post by: rupy on June 01, 2013, 02:55:06 PM
It seems labels are deprecated? Why?

I would like to associate addresses with both accounts and labels!

Code:
account -+- address --- label
         |
         +- address --- label

So I guess the way to do this is to create an address either by label or account and then associate the address with the other.

Code:
getnewaddress
setaccount

OR

getaccountaddress
setlabel



Title: Re: JSON API Accounts
Post by: CIYAM on June 02, 2013, 02:57:38 AM
Unfortunately you are probably not going to find Bitcoin's accounts helpful here (as they are only in effect *tied* to an address for the purpose of detecting an incoming tx).

They are simply not designed for any purpose other than for labeling tx's and moves - if you want something more then an external DB is going to be your best option.


Title: Re: JSON API Accounts
Post by: rupy on June 02, 2013, 12:49:01 PM
Yea, I'm going to use one account per user (so that you can transfer coins internally without hitting the blockchain) and then I'll do a separate database label system for both addresses and transactions so people can tag their stuff.