The definition of web3.eth.Contract.transactionconfirmationblocks is here. But I don't quite understand the meaning. The default value is 24, does it mean a transaction will not be confirmed (i.e. the Promise returned by sendTransaction() is resolved) until 24 more blocks are mined after the transaction are mined?


The transaction is confirmed right away on the node you are connected to. It may be possible that somewhere else, another group of nodes has generated a chain that is different than the node you are connected to. This other chain, when synced with your node, may be considered as the correct chain (likely because it has a higher block number).

So, in order to fully determine if your transaction is correct (meaning: it is considered part of the "true" chain), "we" wait x blocks (24 in your case) to be mined in order to say: "hey, this transaction is valid, and I'm sure at 99.99999%".

If it happens that your transaction is not part of the "true chain", I believe it is in an "uncle block". You can find quite a good definition here

| improve this answer | |
  • Thanks for your answer. If it turns out my transaction is not part of the canonical chain, what will happen to my transaction? Will it be put back to the transaction pool and included again in future blocks? – Aaron Nov 28 '19 at 11:32
  • @Aaron I do not know. It goes beyond my knowloedge. – Florian Castelain Nov 28 '19 at 12:18

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.