13

Essentially, there is no such thing as a "suspicous transaction" and bitcoin is already set up to work in the way that you want. Double spending is handled like this -- if two transactions spending the same input(s) happen in the same block, both will be rejected. If one transaction makes it into a block before the other, the first one will be accepted and ...


13

Every full Bitcoin node maintains a database of which unspent outputs are left. When verifying a transaction, all its inputs are fetched from the database. If one is missing, validation fails. Among the data retrieved is the value of those unspent outputs, and their script (od address), which define the conditions under which the output can be spent. This ...


11

There are multiple definitions of the term "double spending" at play here. First, there is the actual definition of double spending: to spend the same money multiple times. A simple example of this is the coin on a string in a vending machine. You put tie a string to a coin, when you put the coin in the machine, it thinks you paid, you get whatever you want ...


10

This is definitely a concern, and is the reason why Bitcoin users are encouraged to wait for several confirmations before accepting a transaction and delivering goods. It's not quite as easy as you suggest, though. When you made your transaction at the cafe, it was, as you say, broadcast across the network. Barring connectivity problems, every node on the ...


10

Double-spending has nothing to do with double clicking the send button. It involves a malicious user, who will not use the standard client. It will hack one to avoid any client-side limits, sending two transactions to a different side of a blockchain fork, so both sides don't know about the transaction sent to the counterpart and includes the transaction in ...


10

Each full node must maintain a list of all unspent outputs. Currently there are 15 million unspent outputs with a total size of 525 MB. To check whether a new transaction is a double-spend, Bitcoin sees whether the outputs being spent are in this unspent transaction output (UTXO) database. If they are, the new transaction is not a double-spend, and if the ...


9

My question then is: why doesn't bitcoin specify a maximum duration of time and/or a maximum number of confirmations, after which a competing/forking block is rejected even if it's backed by a longer chain of (secretly premined) child blocks? Because you can't prove that to nodes that weren't on the network at the time of the attack. Which means that either:...


8

First, a quick clarification: assuming two chains both have valid blocks, it's the chain with the most proof of work that wins, not necessarily the chain with the most blocks. Second, thanks for the psuedocode. It's always nice answering a question written in clear code. The answer is that we want nodes to be able to agree on the best block chain based ...


8

How to Double Spend You can double spend using Electrum quite easily. Even without duplicating your wallet, be it on the same or on 2 different machines. Btw.: Duplicating wallets is super easy with Electrum. Just go to Tools → Preferences → Transactions and check View transaction before signing. Close the settings, go to the "Send" tab, and enter the ...


7

At the moment there's very little orphaning of blocks, and next to no occurrence of two-block side chains. Unless you're dealing with large amounts (larger than two block rewards worth, probably), your chances of attack are incredibly incredibly low. If you're dealing with amounts less than a few BTC, I'd personally be happy accepting one-confirmation ...


7

The other two answers explain what has to be done to discover doublespends. I'll try to explain how it works. There are no "balances", there are "coins" A common misunderstanding is that there is a register of balances for addresses, and when you spend bitcoins, some of your balance gets deducted from your address. Actually, that's not a good description of ...


7

Double spending is not about doubling, but about using the same UTXO twice. So, you won't gain anything by double spending coins to yourself. Let me explain you, with a simple example, how double-spending works: Lets Alice be an attacker trying to double spend some coins. Alice goes to Bob's store to buy some goods. In order to pay for the goods, she ...


7

So are bitcoins, or the smallest allowable bitcoin fractions, distinctly labeled entities? They are unspent amounts (outputs of prior transactions) associated with addresses. Unspent transaction outputs are abbreviated UTXO. Bitcoins or fractions (millibits, Satoshis etc) don't exist as entities in computers running Bitcoin software. The computers just ...


6

From http://www.cryptocoinsnews.com/news/the-mathematically-secure-way-to-accept-zero-confirmation-transactions/2014/02/13, here is what services like MyCelium and BitPay may be doing: More specifically, with every additional second a larger percentage of active Bitcoin nodes will have heard the original transaction and everyone viewing the blockchain can ...


6

Both Bitcoin and Ripple are systems made of many components. One such component is a method to synchronize transactions and secure against double-spending; Bitcoin uses mining based on proof of work for that, while Ripple uses a consensus mechanism. Another component is the initial issuing of coins - Bitcoin uses mining for that as well, while Ripple uses ...


6

When a node hears about a new transaction, they try to accept it to their in-memory pool of transactions. If a node hears about a transaction that conflicts with one of the transactions that is already in their mem-pool, then they simply won't accept it to their mem-pool. The default client also won't forward the transaction on to any other nodes, either. ...


6

Occasionally, minor alternate chains emerge if multiple blocks are found for a given blockheight. Usually, these alternate chains only last for a single blocked, and are quickly dropped once another block has been found, allowing one chain to become longer (and thus have more work). More rarely, these chains might last for a couple of blocks. Block 525890 ...


6

First of all, what is the goal? The Bitcoin consensus rules already completely eliminate the possibility of an "double spend" within any individual version of history ("chain"). The concern is about individual wallets accepting a transaction as a fullfilled payment, before it is certain that that transaction will end up in the winning ...


5

The easiest way to do a double spend against someone who accepts zero-confirmation transactions is with a Finney attack. To perform a Finney attack, you must first mine a block and be willing to risk losing that block. So the answer is that if the value of the transaction is small relative to the risk of losing a block reward, you don't have to worry about ...


5

@David's answer essentially doesn't talk about an attack scenario where the room is full of dishonest nodes. This is essentially what the proof-of-work was designed to fix. If you get a hold of a lot of IPs (nodes in the Ripple network) you could become a majority in the room. The difference is that it's really easy to get an IP, but extremely hard to prove ...


5

The original design assumes a common behavior of processing the incoming transaction on FIFO basis. That means the first transaction received by a miner wins and all conflicting transactions received after it will be ignored (no matter if the first one is already confirmed or not). While this standard behavior is beneficial for the Network as a whole, some "...


5

Every single Bitcoin node in the network will reject and ignore the block as invalid if there is a double spend in it. The block won't even spread very far, because the peers that first receive it will ban the miner who sent it and not forward on the block to any other nodes. It is not a big disruption as the check for this is fast. Other mining pools don't ...


5

Selfish Mining cannot be used to change transactions in any way, therefore, it is impossible to steal funds in such fashion. Also, Selfish Mining is somewhat the opposite of Double-Spending, as double-spending would require you to publish your own blocks as quickly as possible in order to overtake the network, while selfish mining is based on keeping ...


5

just off the top of my head, here are some things a dishonest miner can do: fail to include one or more transactions in the block. this is not technically 'dishonest', since the protocol does not require that all transmitted transactions be included in the current block. for example it would be considered perfectly ok for a miner to never include a ...


5

Yes, miners check the blockchain to ensure all new transactions are valid before including them into a block. However, it also depends on your definition of "miner". If you mean the people running ASIC miners as part of a mining pool, then no, they do not generally check for the validity of transactions or blocks. They simply hash block headers to ...


5

In a bitcoin transaction, A's address is not scanned for spendable Unspent Transaction Outputs (UTXOs). Full nodes simply check if the inputs of the transaction are really unspent. There is no scanning of addresses involved. UTXOs are stored as the transaction id (txid) and the output index of the transaction that created them. You cannot reference the ...


5

There are tests for that. The specifically broken pattern was a block containing a single transaction spending the same output, which originated from an earlier block, twice. Testing it without putting it in a block, or splitting up the double spend across multiple transactions weren't sufficient tests.


5

Then the blochain of the "hacker" will have 1 block more than the others, thus it should be, at least for a few minutes, the "valid" blockchain This is incorrect. A block that contains an invalid transaction is invalid, period. The network's rule is that the longest(*) valid chain is the one to be treated as correct. A chain with any invalid blocks in it ...


5

Miners have complete perogative over what transactions to include. They may include random transactions, the highest fee paying transactions, just their own transactions, or no transactions at all. If a miner doesn't include a particular transaction from their mempool, it stays there. It will be available for later miners to pick it up and include in their ...


4

September/October 2013 - GHASH.IO Pool Operators were accused of double-spending against BetCoin Dice: https://bitcointalk.org/index.php?topic=321630.0 Excerpt: "I'm saying ghash.io was likely involved in that double-spending. I got a report from a pool's user that there were no blocks (rewards) between 25th and 27th of september. It means that user's ...


Only top voted, non community-wiki answers of a minimum length are eligible