Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Bitcoin - how to use the blockchain info - need help

Posted on 2013-05-13
4
Medium Priority
?
836 Views
Last Modified: 2013-05-30
Related to general question I started here
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28102652.html

Can someone give me a simple Hello World type of direction so that I can make my prototype web application (in Classic ASP) 'hear' a transaction from 'Alice to Bob' (Person A to person B)?

For example, (1) how can my application 'listen' (2) what will it 'hear' and (3) then I need to translate that to the From Address and To Address and how many bitcoins. That's all for this stage.

I'm guessing and hoping that I can use the Simple Query API shown here.
http://blockchain.info/q

I'm hoping that I can get that by a Request.QueryString("????")

Thanks.
0
Comment
Question by:hindersaliva
  • 2
  • 2
4 Comments
 
LVL 35

Expert Comment

by:Terry Woods
ID: 39163382
So are you wanting to detect the transaction before it's confirmed in a block?
0
 

Author Comment

by:hindersaliva
ID: 39164400
Terry, hey thanks.
No, I'm at an even earlier stage of Hello World - so to detect the transaction at any time (after confirmed).

I'm challenged by:
I'm classic ASP and the code samples are PHP. So got to so a crash-course in PHP or translate the samples to classic ASP to understand what's going on.

I got a classic ASP/JSON demo to work.

So, in short, a PHP page that will detect a transaction is a good start for me at this (early) point.
0
 
LVL 35

Accepted Solution

by:
Terry Woods earned 2000 total points
ID: 39169860
I wonder if this page is of use? http://blockchain.info/api/api_receive

It provides details of a mechanism where the blockchain.info server sends your server a confirmation when a payment has been received (or confirmed - you choose the number of confirmations to wait for).

If you are receiving bitcoins to an address that has just been created, then just checking the balance may be adequate. I think this command should work in PHP:
print file_get_contents("http://blockchain.info/q/addressbalance/12L9q9Z9kc4wXq7AoosMprc2Furt9iC9Rg?confirmations=6");

Open in new window


The response appears to be a balance in satoshis. ie Divide it by 100,000,000 to get a balance in BTC.

You can also just browse to the URL in your browser:
http://blockchain.info/q/addressbalance/12L9q9Z9kc4wXq7AoosMprc2Furt9iC9Rg?confirmations=6

Adjust the confirmations parameter to suit your purposes. The higher the transaction value, the more confirmations you should wait for, depending on the nature of your product.
0
 

Author Comment

by:hindersaliva
ID: 39209383
Thanks Terry. I'm taking a break from this project for a few months. So shall close the question.

I appreciate your help over and above the call of duty :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question