Author

Topic: How to Verify and Validate Bitcoin Transactions of Other Users ?? (Read 4513 times)

legendary
Activity: 3682
Merit: 1580
danystatic take a closer look at the documentation of bitcoind. IT is possible to configure it so that it runs a command when it sees a transaction. So you can have it GET your script each time that happens. Of course you need to put it some authentication system in place to ensure your script is not being called by an outside user pretending to be bitcoind.
full member
Activity: 235
Merit: 100
I was relying on Blockchain but its time to improve this.

Note: This is using my own wallet in my system

I am receiving BTC from couple of friends now !! Smiley looking to do a  btc-startup

please some advice or help...

Note: using jsonRPCClient and PHP (the basic process could be similar to others lang..  I believe)

The website asks them to POST their address before sending, because I am not able to extract automatically the Senders Address.

1.  Create a new address for each sender, using ->getnewaddress('payments');

2.  Then I listen for payment with -->getreceivedbyaddress()
     This way I do not obtain any information about the Tx

3. Find the txid  ?? how?

4. While a better method is found, using ->listtransactions() to read a received tx

5. I can see the senders address is inside this array, How can I be sure I extract the "correct" senders address without comparing it with the one POSTed via the website?
legendary
Activity: 3682
Merit: 1580
Oh I see,
So I have to ask Pedro for the transaction ID ?

Because as of today I am using Blockexplorer.com 
example: http://blockexplorer.com/address/1CdBBMyK9jdBP9jqCRpgBWB5uyMdx3L3Ci

From here I can see, but if I do it with an application I would have to get the page source and with code search for the corresponding string to find the senders or receivers address and verify and validate with regular expressions  or string functions. But if done this way the transaction ID is not needed.

The code returned from Blockexplorer didn't needed the txid

blockchain.info( bci) provides an API to look up this sort of stuff in a machine friendly format:

http://blockchain.info/q
http://blockchain.info/api/blockchain_api

They have a bunch of different APIs and you would do well to bookmark this page on their site for future reference:

http://blockchain.info/api/
legendary
Activity: 3472
Merit: 4801
Oh I see,
So I have to ask Pedro for the transaction ID ?

Because as of today I am using Blockexplorer.com  
example: http://blockexplorer.com/address/1CdBBMyK9jdBP9jqCRpgBWB5uyMdx3L3Ci

From here I can see, but if I do it with an application I would have to get the page source and with code search for the corresponding string to find the senders or receivers address and verify and validate with regular expressions  or string functions. But if done this way the transaction ID is not needed.

The code returned from Blockexplorer didn't needed the txid

Pedro shouldn't be providing a bitcoin address.  A transaction can have multiple inputs coming from multiple addresses, and there could potentially be multiple transactions between Carmen and Pedro.  Pedro should be providing a transaction ID.

Carmen could provide a bitcoin address, but I don't think monitoring a bitcoin address that doesn't belong to the Bitcoin-Qt wallet is a feature in Bitcoin-Qt.  You'd probably have to dump the entire blockchain and search through all of its contents for all transactions that use Carmen's address as an output.  Then you'd have to look at the inputs of each of those transactions and see how many of them refer to transactions that had Pedro's address as an output.  Then you'd have to figure out if any of those possibly multiple transactions are the specific one you are concerned about.
full member
Activity: 235
Merit: 100
Oh I see,
So I have to ask Pedro for the transaction ID ?

Because as of today I am using Blockexplorer.com 
example: http://blockexplorer.com/address/1CdBBMyK9jdBP9jqCRpgBWB5uyMdx3L3Ci

From here I can see, but if I do it with an application I would have to get the page source and with code search for the corresponding string to find the senders or receivers address and verify and validate with regular expressions  or string functions. But if done this way the transaction ID is not needed.

The code returned from Blockexplorer didn't needed the txid
legendary
Activity: 3472
Merit: 4801
thanks for the answer

txindex = 1    ; is running

------------------------
however I'm still missing something very important

I have not been able to understand this, here I describe :

decoderawtransaction     <<------- I only know the address of the user, I do not know how to obtain the needed
getrawtransaction [verbose=0]  <<----- How can I get the of the transaction if I only know both of the user's address ?

I have not been able to figure this out

I assumed that when Carmen claimed that she didn't receive the bitcoins, Pedro provided you with the transaction ID.
full member
Activity: 235
Merit: 100
thanks for the answer

txindex = 1    ; is running

------------------------
however I'm still missing something very important

I have not been able to understand this, here I describe :

decoderawtransaction     <<------- I only know the address of the user, I do not know how to obtain the needed
getrawtransaction [verbose=0]  <<----- How can I get the of the transaction if I only know both of the user's address ?

I have not been able to figure this out
full member
Activity: 126
Merit: 100
As Danny said, getrawtransaction and decoderawtransaction is the easiest way to go.

If you checking transactions not related to your wallet, you need to enable the transaction index. Bitcoin uses another method since some version (forget which), due to the tx index being more resource intensive.

To do this, just add:

Code:
txindex=1

to your config, shut down bitcoin-qt or bitcoind (if already up), and run

Code:
bitcoind -reindex

This will take some time, as it has to go through all 10GB of data to make the tx index. In a production environment this can be seen as unacceptable, but easy enough to get around.
legendary
Activity: 3472
Merit: 4801
Code:
getrawtransaction

and

Code:
decoderawtransaction

come to mind.
full member
Activity: 235
Merit: 100
Pedro sends from [Pedro's Btc Address] X amount of Bitcoins to Carmen with [Y Btc Address]
 

Carmen says she did not received the Bitcoins.

I can review Pedro's and Carmen Addresses in Blockexplorer.com

Is there an API or  an API Call  from bitcoin so that I can verify this information without blockexplorer.com ??
Jump to: