Author

Topic: Do you use "account" for multi user systems? (Read 926 times)

legendary
Activity: 3682
Merit: 1580
The accounts system doesn't scale well, and if you begin to move funds between them you'll start to end up with negative balances, so its hard to rely on them.



How would i end up with negative balances? I  know it can get negative is the wallet(but not the account) has funds. But is not it just a matter of checking the account balance before doing any related transaction? like if $withdrawvalue > $accountbalance do not allow move/send.

If you have to do that in your application then why use bitcoind accounts at all? Make up your own accounts system.
sr. member
Activity: 364
Merit: 257
The accounts system doesn't scale well, and if you begin to move funds between them you'll start to end up with negative balances, so its hard to rely on them.



How would i end up with negative balances? I  know it can get negative is the wallet(but not the account) has funds. But is not it just a matter of checking the account balance before doing any related transaction? like if $withdrawvalue > $accountbalance do not allow move/send.
sr. member
Activity: 364
Merit: 257
Any time the question is "Accounts?" the answer is no.

Not that accounts aren't usable, or useful.  Just that if you are asking questions about them, you don't know enough about them to use them safely.

So how to use them safely? I always only get those vague warning like nobody knows...



The coin selector doesn't know or care about accounts.  A spend tagged with account "B" does not necessarily use a transaction that had come in to "B" before.  A spend that redeems a transaction that had come in to account "B" does not update account "B", unless you explicitly mention account "B" in the command.

I understand a spend does not consider accounts, but is not the account balance always updated as if the spend was from the specified account?

sendfrom     [minconf=1]

As far as the accounts balances are always correctly updated, it is not an issue to me where coins actually come from.

sr. member
Activity: 412
Merit: 287
The accounts system doesn't scale well, and if you begin to move funds between them you'll start to end up with negative balances, so its hard to rely on them.

I wrote a scraper for transactions being paid to addresses I generated from an electrum mpk. There are cleverer ways to set up a service that doesn't involve asking users to blindly send their btc to you.
kjj
legendary
Activity: 1302
Merit: 1026
Any time the question is "Accounts?" the answer is no.

Not that accounts aren't usable, or useful.  Just that if you are asking questions about them, you don't know enough about them to use them safely.

So how to use them safely? I always only get those vague warning like nobody knows...

The secret to account safety is understanding when they are updated, and which one is getting updated.

When a new transaction comes in, all accounts are checked to see if the destination address is tagged as an account member, if any are, that account is updated, if none are, the default account is updated.

When a new spend is created, the account explicitly mentioned in the command (which is usually the default account, is updated.

When a move command is executed, the two accounts explicitly mentioned are updated.

The first two big pits that people tend to run into are:

Tagging an address into an account does not update that account with transactions already known.

The coin selector doesn't know or care about accounts.  A spend tagged with account "B" does not necessarily use a transaction that had come in to "B" before.  A spend that redeems a transaction that had come in to account "B" does not update account "B", unless you explicitly mention account "B" in the command.
sr. member
Activity: 364
Merit: 257
What are you trying to do? If by "multi-user system", you mean an operating system with multiple user accounts, then no. On a multi-user system, each user gets their own data directory with their own wallet.dat file. If you mean a system that runs as a single user but is accessed by multiple clients, such as an exchange or online wallet, then you need to define your terms better.

I mean like an exchange, an online service. where users who signed up can create an account and deposit and withdraw their btc funds at any time.
sr. member
Activity: 364
Merit: 257
Any time the question is "Accounts?" the answer is no.

Not that accounts aren't usable, or useful.  Just that if you are asking questions about them, you don't know enough about them to use them safely.

So how to use them safely? I always only get those vague warning like nobody knows...
kjj
legendary
Activity: 1302
Merit: 1026
Any time the question is "Accounts?" the answer is no.

Not that accounts aren't usable, or useful.  Just that if you are asking questions about them, you don't know enough about them to use them safely.
legendary
Activity: 4536
Merit: 3188
Vile Vixen and Miss Bitcointalk 2021-2023
What are you trying to do? If by "multi-user system", you mean an operating system with multiple user accounts, then no. On a multi-user system, each user gets their own data directory with their own wallet.dat file. If you mean a system that runs as a single user but is accessed by multiple clients, such as an exchange or online wallet, then you need to define your terms better.
sr. member
Activity: 364
Merit: 257
Do you use the "account" feature of bitcoin daemon to a multi user/wallet system? If so, tell me how it is going on.

I've been recommended to not do it. But i'm doing extensive tests and it showed no problems.
Jump to: