Bitcoin Forum
April 25, 2024, 08:40:31 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How are double spends and dropped transactions represented BlockChains API  (Read 518 times)
Ford (OP)
Full Member
***
Offline Offline

Activity: 120
Merit: 100



View Profile WWW
October 09, 2013, 04:39:32 AM
 #1

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

1714034431
Hero Member
*
Offline Offline

Posts: 1714034431

View Profile Personal Message (Offline)

Ignore
1714034431
Reply with quote  #2

1714034431
Report to moderator
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714034431
Hero Member
*
Offline Offline

Posts: 1714034431

View Profile Personal Message (Offline)

Ignore
1714034431
Reply with quote  #2

1714034431
Report to moderator
piuk
Hero Member
*****
Offline Offline

Activity: 910
Merit: 1005



View Profile WWW
October 11, 2013, 05:55:05 PM
Last edit: October 11, 2013, 06:38:40 PM by piuk
 #2

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?

Ford (OP)
Full Member
***
Offline Offline

Activity: 120
Merit: 100



View Profile WWW
October 11, 2013, 10:37:20 PM
 #3

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

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!