Solved

Bitcoin - how to use the blockchain info - need help

Posted on 2013-05-13
4
787 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

738 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