Author

Topic: How are double spends and dropped transactions represented BlockChains API (Read 539 times)

full member
Activity: 120
Merit: 100
I am currently using Blockchain's API to do payment verification with, but have a few questions.

How i am using it (i think it i am using it in the right way....):

i am issuing a new/clean address to for each sale.
i am then checking the balance of the address and the transactions (tx->out) to get the time of the transaction, the value and the blockHight (of which i am using to get the confirmed count from)
i then add the transaction details to my DataBase/System and display the relevant message to the user.
an ustomated script then runs to collect/update the confirmed count (and updates this info into my DataBase).
I have been building this by making bitcoin transactions to myself, but of course all my test transactions are genuine, so i dont know how "bad" transactions will be represented!

What i am unsure on, is how will double spends (or dropped transactions/spends/fraud) be represented? Will the transaction simply disappear? and will this then effect the Balance shown against the address? or will the blockHeight simply change to 0/NULL?

Any advice on this would be greatly welcomed!

Best Regards Ford

If there are two competing unconfirmed double spends blockchain.info will display one transaction it predicts will confirm first.

If a transaction is successfully double spent (i.e. its competing transaction confirms first) then it will simply disappear from the transactions list. If you are checking for 6 or more confirmations this shouldn't ever be a problem.

Have you considered using https://blockchain.info/api/api_receive rather than polling address balances?


Thank you very much for your reply, it is of great help!
I am checking for 6 confirms before classing it as "paid" but i also need to let the user know what we received the payment instantly (but also letting them know it is yet to fully confirm.... automated scripts pick up the confirmed counts later)

I have looked at the api_receive, but i also need to get details for addresses that are not in my wallet (i dont even own these addresses), so by my understanding, this would not be the tool for me?
(i may use your API to send payments, for another aspect of my "project", but i am yet to code this part!)

I am trying to build something "a little different" (taken 4 months to far. (Basically a website)) and once done it could be making 1000's of checks per day against blockchain.info. Would this still be OK?

If you are able to, i would be grateful of any help you can offer (or maybe some form of partnership?) that would allow me someone technical to communicate with (and maybe for you to have some input too)
(at present i don't want to publicly say what i am working on though! apart from it is to be a community based co-op and will hopefully be seen as "in keeping with the spirit of bitcoin" ).
Please PM me if you can help.

Best Regards
Ford
hero member
Activity: 910
Merit: 1005
I am currently using Blockchain's API to do payment verification with, but have a few questions.

How i am using it (i think it i am using it in the right way....):

i am issuing a new/clean address to for each sale.
i am then checking the balance of the address and the transactions (tx->out) to get the time of the transaction, the value and the blockHight (of which i am using to get the confirmed count from)
i then add the transaction details to my DataBase/System and display the relevant message to the user.
an ustomated script then runs to collect/update the confirmed count (and updates this info into my DataBase).
I have been building this by making bitcoin transactions to myself, but of course all my test transactions are genuine, so i dont know how "bad" transactions will be represented!

What i am unsure on, is how will double spends (or dropped transactions/spends/fraud) be represented? Will the transaction simply disappear? and will this then effect the Balance shown against the address? or will the blockHeight simply change to 0/NULL?

Any advice on this would be greatly welcomed!

Best Regards Ford

If there are two competing unconfirmed double spends blockchain.info will display one transaction it predicts will confirm first.

If a transaction is successfully double spent (i.e. its competing transaction confirms first) then it will simply disappear from the transactions list. If you are checking for 6 or more confirmations this shouldn't ever be a problem.

Have you considered using https://blockchain.info/api/api_receive rather than polling address balances?
full member
Activity: 120
Merit: 100
I am currently using Blockchain's API to do payment verification with, but have a few questions.

How i am using it (i think it i am using it in the right way....):

i am issuing a new/clean address to for each sale.
i am then checking the balance of the address and the transactions (tx->out) to get the time of the transaction, the value and the blockHight (of which i am using to get the confirmed count from)
i then add the transaction details to my DataBase/System and display the relevant message to the user.
an ustomated script then runs to collect/update the confirmed count (and updates this info into my DataBase).
I have been building this by making bitcoin transactions to myself, but of course all my test transactions are genuine, so i dont know how "bad" transactions will be represented!

What i am unsure on, is how will double spends (or dropped transactions/spends/fraud) be represented? Will the transaction simply disappear? and will this then effect the Balance shown against the address? or will the blockHeight simply change to 0/NULL?

Any advice on this would be greatly welcomed!

Best Regards Ford
Jump to: