Since each payment references the last transactions where each of the coins has been spent, coin expenditure can be easily traced in the network, as shown in Figure 4.2. Moreover, since all transactions are broadcasted in the entire network, all peers in the network can verify their correctness.
Namely, whenever a peer in the network (including the payee) receives a transaction, it checks its signature, format, the correctness of its fields, and that the sum of the coins referenced by the inputs matches that of the outputs (and the fees). Additionally:
- • Each peer verifies that the input coins have not been spent earlier by checking against the history of all executed transactions in the network
- • Each peer verifies that the input coins refer to correct transactions that have already been confirmed in the network.
By doing so, Bitcoin prevents the double-spending of coins in the system. This is mainly achieved since the details and order of all transactions are publicly
Figure 4.2 Coin expenditure in the Bitcoin network. Here, we show an example comprising of four transactions spending a coin from Owner 0 to Owner 1, Owner 2, Owner 3, and Owner 4.
announced in the system, and since the communication in Bitcoin is synchronous. All verified transactions are included temporarily in the peer’s memory pool until they are confirmed by the network (see Section 4.1.4).
A study in  has shown that transactions are propagated in the network in few seconds. Recently, several attacks [2, 3] were reported on the delivery of transactions and blocks in Bitcoin. In what follows, we discuss these attacks in greater detail.
-  As described later, fees are collected by miners who include the transaction in their newly generatedblock.