Bitcoin - double spending transaction

286 views Asked by At

Alice issues 2 transactions:

  1. Alice -> Bob, 5 Bitcoins (uses Input 1, Input 2)
  2. Alice -> Alice, 5 Bitcoins (uses Input 1, Input 2)

Initially, both of the transactions are in the state "Unordered" until one of them gets committed into the block which is generally accepted by the ecosystem. If single block would include both of them, we still have the double spending issue. Is the block making sure, each transaction it includes is valid? I.e. it consumes the particular input just once and does not allow for double spending? Is each node accepting the block verifying the block's correctness?

2

There are 2 answers

0
ogw_yuya On BEST ANSWER

Miner won't accept the second transaction because the first transaction is in the mempool.

When you broadcast Tx1, miners receive it and check if it is already in mempool, and they accept Tx1 and it goes to mempool. Next, when you try to broadcast Tx2, miners won't accept it because it is going to be double spend transaction even if Tx1 is not included into a block.

0
Faisal shahzad On

Double Spending: It is process of using crypto concurrency more than one at the same time. For example, Alice has one crypto-coin on his account. He sends one coin to Bob and one coin to Jerry at same time. This is known as double spending problem through which crypto account holder tries to cheat or deceive blockchain network. So blockchain developers and researchers have developed some advanced algorithm like proof of work (It is utilized by Ethereum), etc., to handle this issue.