Author

Topic: How are double spends and other fraud transactions dealt with by the blockchain? (Read 194 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
Lets say in my Electrum wallet I have 0.5 BTC which I send to an address, and then a few seconds later send the same 0.5 BTC from my Electrum wallet to another address. (How will this even be allowed by the wallet? does it require hacking into wallet software?)
Your wallet and the server (connected node) won't allow it.
If you try to send another 0.5 BTC, your wallet will find another UTXOs to spend, not the already used ones.

There are certain conditions before double-spend can be achieved; like marked as "replaceable" or connection to a miner's node that configured to accept double-spend TXs.
but by using default settings and normal transaction creation procedures, it's not possible to double spend.
full member
Activity: 322
Merit: 151
They're tactical
You could have same address in two different wallets, in two different computers, in two different places, and if you make the two transactions at the same time, it can take some time for them to be propagated on the network, and two differents versions of the chain can exist at the same time, the version that has the more confirmations will be selected by nodes and the others removed after a few blocks. Its up To each miner which transaction it will include in the block, but each node can recieve the two transactions in different orders, chronology is often difficult to establish in open distributed system, so each miner can have its own policy when choosing which version it will include in the block.
legendary
Activity: 2268
Merit: 18711
It's not chronological. The higher fee one will get confirmed before the low fee one. Low fee one will then rejected because it has already spent input.
Not necessarily.

When a node receives the details of an unconfirmed transaction, it adds it to its memory pool. Default behavior of nodes is to reject a transaction if it conflicts with another transaction already in their memory pool, and flag it up as a potential double spend. These nodes will essentially keep whichever transaction they saw first, regardless of the fee. They also won't broadcast this conflicting transaction to other nodes, therefore impeding its dissemination through the network.

One of the two transactions will arrive first at the miner which will mine the next block. This can be down to various things, such as which transaction was broadcast first, which node or nodes it was broadcast to, and luck. Provided it has an acceptable fee, then it will be mined first, regardless of what fee the other transaction has.
hero member
Activity: 1358
Merit: 851
(How will this even be allowed by the wallet? does it require hacking into wallet software?)
As long as you have unconfirmed transaction, you can create another transaction by the same input. That doesn't necessarily mean you can send & use the 0.5 BTC twice. Answer in the 2nd quote.

Quote
How is this double spend resolved? Is it chronological order, i.e. will the first transaction be accepted by the blockchain and the second one be rejected as the address does not now have enough balance?
It's not chronological. The higher fee one will get confirmed before the low fee one. Low fee one will then rejected because it has already spent input.

Edit- Looking forward to someone expert to confirm my statement is correct or wrong.
sr. member
Activity: 882
Merit: 301
How Blockchain prevents Double-Spending?

Let us take a scenario where a person makes a cryptocurrency transaction and tries to spend it twice.  Well, the person would not be able to do so because, once the transaction is initiated, it goes in the pool of unconfirmed transactions. In Blockchain, only the first transaction gets the confirmation and verification by the miners. But the other transaction or the second similar transaction, doesn’t get enough confirmation because the miners get to know that it is invalid.

Now you might be thinking, what if both the transaction takes place at the same time? In such cases, the transaction which gets the maximum number of confirmations from the miners is included in the Blockchain while others get discarded. The merchants are advised to wait for at least six confirmations. It means that after a particular transaction gets added to the Blockchain, six more blocks should be added on top of that particular block. Each transaction and blocks are mathematically associated with the previous one. Once the transaction gets an entry in the DLT or Blockchain, it becomes difficult to change or alter the transactions, thus making it safe.

Thus, if the merchant gets a minimum of six confirmations then he/she is assured that the transaction is not double–spent. The reason the merchant can be guaranteed is that if the sender wishes to double-spend, then he/she has to go back and reverse all the transaction in the six blocks which are computationally impossible.

The above should answer all your questions.
newbie
Activity: 25
Merit: 27
Lets say in my Electrum wallet I have 0.5 BTC which I send to an address, and then a few seconds later send the same 0.5 BTC from my Electrum wallet to another address. (How will this even be allowed by the wallet? does it require hacking into wallet software?)

How is this double spend resolved? Is it chronological order, i.e. will the first transaction be accepted by the blockchain and the second one be rejected as the address does not now have enough balance?
Jump to: