Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would consider a double spend transaction to be invalid.


Which one was the first spend and which one was the double-spend?

You are talking about a distributed network where there is no universal time by which this can be measured.

The blockchain is the solution to this problem. It provides an ordering which is to be universally agreed upon, because the only way to disagree with the ordering is to use >51% of the amount of electricity securing the network to state your disagreement.

A spend is invalid if the consensus in the network is that the TXO being used as an input for a transaction has already been spent in a transaction which has been mined into a valid block. Until that happens, any valid transaction which spends a TXO may be the correct one.


> Which one was the first spend and which one was the double-spend?

The answer to that question is actually that it doesn't matter. Seems weird at first but if you think about it, no one who uses the system cares which one is "the first" the only thing people care about is that once one is picked it will not change later on aka finality. And for that a majority must agree on one. Which one again doesn't matter at all.

FBA (Federated Byzantine Agreement) "blockchains" make use of that. Each node signals which Tx it saw first but if no super-majority can be reached it simply switches to the Tx that has more votes. The sole purpose is to agree on one which makes the second Tx unfunded and thus fail.

Bitcoin and bitcoin-like system cant do this. They always have some kind of lottery that decides who writes the Tx. There is no agreement and thus no finality and that's the whole reason why double-spends can happen.


I agree. It seems to me that pow is specifically designed to make adding new transactions to the blockchains take a certain amount of time. If anyone could add to the blockchain instantaneously, imagine the same account being used to spend money on both sides of the earth at the same "time". Afaik general relativity says it would be virtually impossible to tell which one happened "first" in a decentralized way. So by slowing everything down, we force there to be a window for transactions to propagate.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: