Bitcoin Forum
April 25, 2024, 02:16:17 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: RPC for Send Address  (Read 1065 times)
sjk (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
May 06, 2011, 01:19:28 PM
 #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?
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714054577
Hero Member
*
Offline Offline

Posts: 1714054577

View Profile Personal Message (Offline)

Ignore
1714054577
Reply with quote  #2

1714054577
Report to moderator
BitterTea
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250



View Profile
May 06, 2011, 01:28:12 PM
 #2

listtranasctions <account> [count=10]

Where <account> is an optional account name (not address), and count is an optional parameter specifying how many record to return, defaulting to 10.
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
May 06, 2011, 01:32:21 PM
 #3

If you want each receiving address treated as its own account, you can:
setaccount <address> <address>
... and then use <address> as the name of the account.

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


How often do you get the chance to work on a potentially world-changing project?
sjk (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
May 06, 2011, 01:46:37 PM
 #4

listtranasctions <account> [count=10]

Where <account> 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
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1072
Merit: 1174


View Profile WWW
May 06, 2011, 01:56:03 PM
 #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.

I do Bitcoin stuff.
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
May 06, 2011, 01:56:42 PM
 #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.

How often do you get the chance to work on a potentially world-changing project?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!