Author

Topic: How to confirm that bitcoins have been transferred? (Android Bitcoin Game) (Read 767 times)

legendary
Activity: 3192
Merit: 1348
From a technical side, I would say that you'd have to incorporate some code that would fetch data to check if the wallet has been funded.
One way to do this would be to auto-generate new wallets for every transaction and have the script check for 1-3 confirmations before verifying the payment. Thatvway no two transactions would get mixed up in the system. The Bitcoin transaction themselves would act as a unique payment ID in that sense.

From a practical side however, I would say that given the lengthy transaction times, is it worthwhile for your app? As much as I'm pro BTC, I can't see many people waiting 30+ minutes for an in-app purchase to process. That's just something to consider (unless you opt to go for a very high fee per every transaction but that would make the in-app purchases even pricier).
sr. member
Activity: 364
Merit: 250
This is a nice project and i will like to play the game when launched.
In order to get a better assistance you need to answer some questions
1, will you have only one btc address for the game?
2, Does every user have their own unique btc address?
3, Will those btc address(es) be static or dynamic ?
You can check the codes here https://blockchain.info/api/api_websocket
Let me know if this does not solve the problem.
newbie
Activity: 12
Merit: 0
Well I'd recommend using some 3rd party API and wait for at least 3 confirmation so it's sure that the btc has arrived.You could also run a wallet and check it periodically whether new transactions have arrived and if they did then track them until 3 comfirmation then you can be sure that it's arrived.
hero member
Activity: 692
Merit: 569
An easier way would be listen to websocket notification on your address and you will now when the tx has arrived.
You can use Blockchain.info API / blockonomics API .
full member
Activity: 204
Merit: 100
Maybe you could use blockchain.info wallet and addresses and benefit from their notifications by e-mail or sms upon receiving and use api to see the first confirmation in a block.
staff
Activity: 3458
Merit: 6793
Just writing some code
So my application has to connect to android btc walelt?
For example https://play.google.com/store/apps/details?id=de.schildbach.wallet&hl=en
Not necessarily. Presumably you, as the app developer, are operating your own servers with players' account information so that you can unlock their purchases after they pay. Your server should be running its own wallet, and it can check its own wallet to see if a payment has confirmed.

Still few questions:
1. Where my app can get Transaction ID to check its status? (I suppose only manual enter by user).
You should be checking it on your own servers and informing the app that the payment has confirmed. Your own servers should be handing out a new address for every single purchase so that it is easier to track people's payments to you. All you need to do is watch for transactions for each address, and then notify the app when those transactions confirm.

2. I am not sure that there is programming interface in this wallet to interact with another apps. My goal is to get payment confirmation programatically.
Again, your servers check this, and then relay the information to the app. The app should not be looking for this information itself.
newbie
Activity: 5
Merit: 0
You should check whether the transaction has been confirmed, i.e. it has been included in a block.

Most wallets that you would use for this will tell you whether the transaction has been confirmed and how many confirmations it has.

So my application has to connect to android btc walelt?
For example https://play.google.com/store/apps/details?id=de.schildbach.wallet&hl=en
Still few questions:
1. Where my app can get Transaction ID to check its status? (I suppose only manual enter by user).
2. I am not sure that there is programming interface in this wallet to interact with another apps. My goal is to get payment confirmation programatically.
legendary
Activity: 1512
Merit: 1057
SpacePirate.io
In short, you're going to want to generate a bitcoin address for the purchase and record the value you expect. Then you want to watch for when the transaction has been confirmed on the blockchain. There are a couple of methods to do the later, either check the amount received by that address on a recurring basis or setup a node to run a script when that address has received a value. You can also use a 3rd party to do the transaction for you, there are payment API's offered by several companies. The trade-off to using them is of course, trust.

This thread has a lot of information that you might find helpful with your app:
https://bitcointalksearch.org/topic/so-you-want-to-use-bitcoin-on-your-website-990348
staff
Activity: 3458
Merit: 6793
Just writing some code
You should check whether the transaction has been confirmed, i.e. it has been included in a block.

Most wallets that you would use for this will tell you whether the transaction has been confirmed and how many confirmations it has.
newbie
Activity: 5
Merit: 0
Hello, Bitcoin community. I am developing an android application using Unity Engine.
There are in-app purchases inside this application (items, gamepoints) that user would buy for the btc.
I have few questions about payment confirmations. Let's say I can generate link similar to "bitcoin://12A1MyaddResshRAZEqofac5jCQQjwEPBu?amount=1.00" to parse it by any android btc wallet. But how to get a confirmation that payment has been sent/received? How to make this confirmation safe and secure?
Maybe another approach?
Jump to: