Interesting project!
Thanks!
Can you elaborate on the JSON-RPC interface you provide? This runs on a single Bitcoin wallet but isolates different Bitcoin Pouch accounts from each other? How exactly do you achieve that?
Basically the interface works as a proxy to bitcoind's JSON-RPC interface. Every address created by a user is associated with that user's account and stored in a MySQL database. Also, every address created is given a label: the user's username if they don't specify a label, or a label in the format of
"username:label" "username+label" if they do. Before the interface returns any information on a user's own account, it strips the user's username and the extra
colon addition symbol. This works because
colons addition symbols are not allowed in a user's username. Any calls to aggregate accounts (such as "getbalance" with parameters omitted) is handled by retrieving all the user's addresses from the MySQL database, making the appropriate call to the bitcoind server on each account, and then folding the results together.
The upswing of this naming scheme, aside from keeping accounts effectively separated, is that bitcoins can be sent from user to user on Bitcoin Pouch using only the user's username, or their username and a label if you want the coins to go to a specific account. For example, say I have an address which I've assigned the label of "donations." If you wanted to send bitcoins to that particular address via Bitcoin Pouch, you could simply specify
"ryepdx:donations" "ryepdx+donations" instead of the full bitcoin address.
Edit:Changed references to colons into addition symbols instead. Colons were used in a previous version of the code, which led to my confusion.