I am currently building a Bridge Adaptor to emulate the Bitcoin Api and connect bitcoind-api calls to the NXT server.
Unfortunately, I am a bit confused by the 'accounts' features in the wallet.
The most pertinent question I have to solve is this:
since the bitcoin call 'sendtoaddress' always debits the default account in the wallet (wiki), which one of the addresses that may be associated with the default account is debited?
It appears to me that if the default account (denominated by the empty string "") is associated with multiple addresses, then the 'sendtoaddress' call would have to choose one of these addresses.
Is this correct?
And if the amount to be sent would exceed the amount in any of the individual addresses associated with the default account, but be smaller than the sum of the amounts in the addresses in the default account, would this result in multiple transactions being sent from the multiple addresses in the default account?
And how would the addresses to be sent from be chosen?
I would be grateful for tips from BTC wallet experts, Thank You!
en.bitcoin.it/wiki/Accounts_explained#The_Default_AccountAccount Names
Accounts are named with arbitrary strings; you may use any JSON string other than "*" (JSON strings are sent and returned as UTF-8 encoded Unicode).
Bitcoin creates two accounts automatically: it implicitly creates a default account with the empty string as its name, and it explicitly creates an account named Your Address when a new wallet is created.
The Default Account
The default account is named with the empty string ("" in JSON). Generated coins are always credited to the default account, and the sendtoaddress method always debits the default account.
Accounts and Receiving Addresses
Each account is associated with zero or more receiving addresses, and every receiving address is associated with exactly one account. Coins sent to a receiving address in the wallet are credited to the associated account.