Solved

Bitcoin - how to use the blockchain info - need help

Posted on 2013-05-13
4
760 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 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Any Third party toll for Integrating chat system on ASP.NET ? 2 34
updating the date data 12 23
Remove lines by logo 2 23
str_replace not working in php script 4 9
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
The viewer will learn how to dynamically set the form action using jQuery.
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.

920 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