Filomena
Filomena

Reputation: 55

How a transaction is verified in a blockchain?

If a miner A creates a block containing a transaction A and a miner B creates a block NOT containing the transaction A about at the same time, then some of the other miners will first receive the block of the miner A and the others will receive the block of the miner B.

If the chain of the miner B grows faster than the chain of the miner A, then the transaction A will never be accepted (like it never happened). So, how the user A who created the transaction A can be sure that the transaction A was accepted/verified by the blockchain?

Also, is there a possibility that the transaction A is verified by the blockchain at some point and then in the future another subchain not containing the transaction A will grow faster, thus rejecting transaction A ?

Are there any time checkpoints created that all the miners should agree upon ?

Upvotes: 1

Views: 202

Answers (1)

JBaczuk
JBaczuk

Reputation: 14589

Note: Since blockchains are all very different, I'll assume we're talking about Bitcoin.

If block B is mined first, transaction A goes back into the mempool (memory) of the nodes and is candidate to be included in the next block. The mempool kicks transactions out after 2 weeks if they have not been mined.

It is possible that another chain not containing the block could grow faster, but highly unlikely because each block takes 10 min on average and miners are incentivized to work on the main chain (as opposed to a forked chain) so they would switch over immediately when the main chain mines a new block. They would not be working on a forked chain for long enough to outpace the network, wasting time and resources. It requires at least 51% (on average) the hashpower of the network to outpace the main chain and is called a 51% attack. This has never happened to Bitcoin, but has happened to smaller chains like Bitcoin Gold for example.

Upvotes: 2

Related Questions