Author

Topic: RPC for Send Address (Read 1088 times)

legendary
Activity: 1652
Merit: 2301
Chief Scientist
May 06, 2011, 08:56:42 AM
#6
No, the send-from address is not available, for a couple of reasons:

1)  When people using a shared wallet service like MyBitcoin or MtGox send payments the "from address" could belong to any of the other users of the service (or could be a "change" address that doesn't belong to anybody).  It is a bad idea to think that "address == person".

2) If more complicated transaction types are ever "turned on" in bitcoin, there might be more than one "from address".   Satoshi designed-in support for complicated transactions like "this payment can only be spent if 2 of these 3 keys sign the transaction".   In that case, there would be two "from addresses".

If you need this to refund coins, you'll need to ask the customer for a refund address.
legendary
Activity: 1072
Merit: 1181
May 06, 2011, 08:56:03 AM
#5
In general, bitcoin transactions do not have a "from" address. A transaction could be originating from one or from many addresses, or even from none at all, theoretically. What blockexplorer shows you is just the address the previous output was sent to, but you shouldn't rely on this information.

If you want to distinguish transactions from eachother, the advised way is to use a separate to address for each. In the future, it may be possible to add a memo field to a transaction output as well, but this is still being discussed.
sjk
newbie
Activity: 10
Merit: 0
May 06, 2011, 08:46:37 AM
#4
listtranasctions [count=10]

Where is an optional account name (not address), and count is an optional parameter specifying how many record to return, defaulting to 10.

This almost seems like what I need.

When I make that RPC call for my wallet, I see that someone sent me 1 BTC and it provides the time as well. However, it seems like what is missing is the address of the person who sent me 1 BTC. However, it does provide me with a txid and if I search for that on blockexplorer it shows the from address and the to address.

Is that information available from the client? I would prefer not to scrape block explorer if at all possible
legendary
Activity: 1652
Merit: 2301
Chief Scientist
May 06, 2011, 08:32:21 AM
#3
If you want each receiving address treated as its own account, you can:
setaccount

... and then use
as the name of the account.

And validateaddress will tell you what account is associated with an address.

sr. member
Activity: 294
Merit: 252
May 06, 2011, 08:28:12 AM
#2
listtranasctions [count=10]

Where is an optional account name (not address), and count is an optional parameter specifying how many record to return, defaulting to 10.
sjk
newbie
Activity: 10
Merit: 0
May 06, 2011, 08:19:28 AM
#1
Looking over the API, it is not immediately clear if there is a way to list information about a transaction. What I would like to do is basically say, in this receiving address, give me the address, time and amount that was sent.

Is this information available from the api from somehow?
Jump to: