Solved

Bitcoin - how to use the blockchain info - need help

Posted on 2013-05-13
4
748 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
Comment Utility
So are you wanting to detect the transaction before it's confirmed in a block?
0
 

Author Comment

by:hindersaliva
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Read about why website design really matters in today's demanding market.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now