In my application, I am using events/logs to capture and display information. So, to decrease the response time, I am returning the result as soon as the block is mined and not waiting for 5-6 block confirmations. As waiting for block confirmations will increase the response time.

So can I trust that all transactions in these blocks will be in the main chain?


So can I trust that all transactions in these blocks will be in the main chain?

In a word (or two): not necessarily :-)

I wrote a quick (dumb) script a while back to scrape data from Etherscan relating to chain reorganisations (i.e. ephemeral chain fork events).

Running the script again, for the last 10 day's worth of blocks, gives:

Forks of length 1: 742
Forks of length 2: 8

I believe that forks of length 3 and 4 have happened in the past.

Although these forks happen often, and blocks get rejected, there's a chance that the same transactions will be present in the block that is ultimately accepted.

  • Thank You. I understood that I cannot trust the blocks with 1 confirmation to be in the main chain. I have one more doubt that if the transaction ends on an uncle block then the transactions gets returned back to mempool to be picked by any other block. So can we ensure that no matters what happens, the transaction will always end up in the main chain. – krritik Feb 21 at 10:27
  • Correct - if the block get made an uncle, then the transactions go back into the mempool. However, once they go back into the mempool there's no guarantee that they will be included in a later block (although it's likely they will be). – Richard Horrocks Feb 21 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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