I am developing JSP web. User will be redirected to another page only if he sends the certain amount of BTC, is there any listener which could check if money arrived to my wallet from the certain wallet address? And after leaving the page is there possibility to automatically send the money back to the user?

Maybe some good tutorial on bitcoinj or something? Any suggestions?

3 Answers 3


I would suggest using a Web API to get notified when a transaction happens on the address(es) you're interested in, it's by far the simpler. Something like this may help:



for small amounts 6 confirmations are overkill, you could just listen for the payment to be relayed by some bitcoin nodes which happens in seconds.

For your question, clone bitcoinj and look at the examples (more specifically the 'Kit' example). Use that as a basis and then read the chapter on 'Watching Wallets' in the docs: https://bitcoinj.github.io/working-with-the-wallet

You can specify a listener which is called when there's activity on your address/wallet.


I don't know about bitcoinj but I suppose it has some kind of Api that you could poll for the wallet state. What really seems strange to me is the fact of redirecting. taking into account that you should have to wait for 6 blocks for a transaction to be confirmed with some security you'll have the user waiting for about an hour to redirect :)

Bitcoin payment verification is not instantaneous as you seem to imply from your post.

  • I am sorry it looks like I dont know how long it takes to send the BTC, I want to make it with different cryptocurrencies later on I just need to understand how it works that's why I have written BTC - its the most common. And yeah I am looking for that API. May 21, 2014 at 20:18
  • don't be sorry!:)
    – perencia
    May 21, 2014 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.