Title: [RFC] reporting addresses, listtransactions/gettransaction Post by: Gavin Andresen on December 18, 2010, 04:27:20 PM We're pretty close to being able to duplicate the bitcoin GUI using the RPC.
I think the only thing missing is reporting bitcoin addresses in listtransactions. That gets a little sticky with multisends (one transactions that sends coins to multiple recipients); here's what I'm thinking of implementing after doing some brainstorming with theymos/jgarzik/nanotube in IRC chat and running a couple of 'multisend' tests on the test network: Code: "category" : "receive", (account/txid/confirmations/time/comment). That's the "received on" address, of course. On the send side, I'm leaning towards: Code: "category" : "send", (account/txid/confirmations/time/comment). I don't like that the common case looks kind of ugly; I'd much prefer just Code: "address" : "bitcoinaddress" That could be done by having listtransactions report multiple category:send entries for a multisend... except it is not obvious which one should report the fee, if there is a fee. First one? All of them? I'm also a worried that websites might get their accounting wrong if they're not prepared to deal with multisends; making "toaddress" an Object makes it obvious that multisends are possible. The only way a website would get a multisend would be if they allow users to import keys from their local bitcoin wallet, which nobody is doing... yet. Here's how listtransactions currently reports a complex multisend: Code: { Title: Re: [RFC] reporting addresses, listtransactions/gettransaction Post by: genjix on December 18, 2010, 09:07:12 PM Could toaddresss be destination instead? I don't think having an object for toaddress is ugly- fine by me. It's just nit-picking. A lot less worse than the inconsistent naming scheme used.... (grumbles back to basement).
Code: "toaddress" : { "address" : amount } Code: "destination" : { "address" : amount } Now my code will read: transaction["destination"]["address"] Which reads exactly like the English: transaction destination address Clear, simple and logical. However is category really that necessary? Amount is already + or -. Or is move also in there too? BTW I don't see any addresses in that output you pasted. Title: Re: [RFC] reporting addresses, listtransactions/gettransaction Post by: Gavin Andresen on December 19, 2010, 02:19:03 AM However is category really that necessary? Amount is already + or -. Or is move also in there too? BTW I don't see any addresses in that output you pasted. move is its own category (and may be + or -, never has a txid or fees). And the output I pasted is what listtransactions does right now (it doesn't report bitcoin addresses). After some private feedback, I'm now leaning towards listtransactions giving multiple category:send entries (with the same txid) for the multisend case. That matches what is done for the category:receive end. transaction fee... I think I'll do what is easiest to implement which is repeat it in all of them. So the example would look like this, with three receives and three sends: Code: { |