When to check for confirmationsl

2

When monitoring incoming transactions for a web wallet, should I check for confirmations on a timer, e.g. every minute? Or should I check once every block by using blocknotify?

Avram

Posted 2014-03-17T02:15:00.813

Reputation: 1 629

Answers

2

Every 30-60 seconds should be sufficient, but if you have access to a service that will notify you when blocks are found, that would be the fastest. A confirmation is just a block being found. Once the transaction is included in a block, that's its first confirmation (and it is no longer unconfirmed). Every block that stems from that block afterward is another confirmation.

Dr. McKay

Posted 2014-03-17T02:15:00.813

Reputation: 146

1Well this was kinda my thought. bitcoind uses the blocknotify config parameter to notify you on every block, so is there any need to check more than once per block?Avram 2014-03-17T11:19:32.930

4No, a block is a confirmation. Therefore it's impossible for a confirmation to happen between blocks.Dr. McKay 2014-03-17T13:02:15.540

2

This is a nice chart on the average transaction confirmation time: https://blockchain.info/charts/avg-confirmation-time that will give you a better estimation on how often you should check.

Also related: What keeps the average block time at 10 minutes?

George Kimionis

Posted 2014-03-17T02:15:00.813

Reputation: 2 824

I guess what I want to ask is this - given that bitcoind can notify me when a new block is received, is there any point checking more than once per block?Avram 2014-03-17T11:22:20.780

@George, Did the chart at https://blockchain.info/charts/avg-confirmation-time really sample all transactions? Or do they only sample like 1 transaction per day?

Pacerier 2014-05-23T14:33:36.060

2

It depends how quickly you would like to notify the customer of their payment being accepted. When I make a deposit/payment, I would like to see it as soon as possible. I always get that uneasy feeling during the time between when I send coins and when I see it confirm in my account.

If I were you I would say every minute is acceptable (and easy to set up a cron for), I would notify when the payment has been seen (rawmempool), and when it has been confirmed the required amount of times to send or spend.

Mark

Posted 2014-03-17T02:15:00.813

Reputation: 1 647

1I guess what I want to ask is this - given that bitcoind can notify me when a new block is received, is there any point checking more than once per block?Avram 2014-03-17T11:20:31.663

If you would like to check for new unconfirmed transactions, yes, otherwise it would not be needed. I like seeing that my deposit was accepted asap, but truth be told this is not critical for payment processing. If you'd like to notify your customers that you have seen their payment sooner, then you can write a cron; if you just want to notify them their payment has been processed block notify should do the trick. Either way, the user will get used to how you process transactions. If you go with using block notify only you should expect clients to send you emails while they wait.Mark 2014-03-17T17:14:12.737

Thanks Mark. I use the walletnotify option to pick up transactions as soon as they are broadcast, and there doesn't seem to be any point in checking more than once per block. Think I have my way forward :)Avram 2014-03-18T02:30:31.787