Multiple Wallets, one computer

2 messages Satoshi Nakamoto October 24, 2010 — October 25, 2010
Satoshi Nakamoto October 24, 2010 Source · Permalink

I have the beginning of something like this.  It’s mostly like what Gavin described.

Some more rpc interface:

move    Move from one internal account to another.  I think blank account name ("") will be your default account.  If you sell something to a user, you could do move “theiraccount” "" 123.45.    Is “move” the best name for this?  I shied away from “transfer” because that sounds too close to sending a transaction.

I’m thinking a new function getaccountaddress instead of overloading getnewaddress:

getaccountaddress    Gives you an address allocated from getnewaddress .  It’ll keep giving the same address until something is received on the address, then it allocates a new address.  (It automatically does what the sample code I posted some time ago did)

Would these commands make it possible in simple cases to implement your website without needing a database of your own?

Satoshi Nakamoto October 25, 2010 Source · Permalink

Here’s some pseudocode of how you would use the account based commands.  It sure makes website integration a lot easier.

print "send to " + getaccountaddress(username) + " to fund your account"
print "balance: " + getbalance(username, 0)
print "available balance: " + getbalance(username, 6)
// if you make a sale, move the money out of their account
move(username, "", amount, 6)

// withdrawal
sendfrom(username, bitcoinaddress, amount, 6)