<p>A full node is a computer running full node software like bitcoin core that has verified every transaction in the blockchain and continues to verify new ones as and when it hears about them. Every full node validates transactions and rejects double spends. If it has learned of a transaction that spends certain coins it will reject any new transaction that tries to spend those same coins unless the original transaction has been marked as replaceable.</p>

<p>Because of the nature of computer networks it is possible that not every node has heard of every transaction. It is also possible that different nodes will have heard of the same transactions in different order. The blockchain fixes the order and history of the transactions so that everyone agrees on the state of the ledger. Once a transaction has been committed to the blockchain and enough blocks have been added to the chain after the block containing the transaction that transaction cannot be modified. </p>

<p>So every node individually prevents double spends that it hears about and the collective consensus of what transactions happened or did not happen comes through the blockchain.</p>

<blockquote>
  <p>What exactly the process that minors follow to detect that a certain transaction is spending the bitcoins twice?</p>
</blockquote>

<p>Miners aren't the only ones validating transactions. Like I said every full node validates transactions to make sure that there are no double spends. </p>

<p>Miners follow the same process as full nodes. The full list of validation rules is given <a href="https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages" rel="nofollow noreferrer">here</a>.</p>

<blockquote>
  <p>Why don't minors (voters) simply accept a new block without even check if it's truly valid or not? what are the consequences?</p>
</blockquote>

<p>There is no voting in bitcoin. It's not just miners who need to check the validity of blocks. Full nodes run by users check it too. If a miner generates an invalid block then full nodes will reject it and the miner will lose money because he will have wasted electricity and time producing that block.</p>

CC BY-SA 3.0
2018-02-07T12:14:09.763Z
Actually, there is voting on consensus changes. There was a slogan 'One CPU, one vote.' early on.
Willtech
CC BY-SA 3.0
2018-02-08T06:15:09.963Z
@Willtech I was told by gmaxwell that there is no voting in bitcoin because voting implies electing a third party to represent you. He said that only thing that comes close to the concept of voting is the "hashrate based quorum" which i take to mean the consensus formed using proof of work regarding the state of the ledger.
Abdussamad
CC BY-SA 3.0
2018-02-08T07:34:35.967Z
Okay, @gmaxwell uses correct terminology and his statements as you have relayed them are certainly without error. Personally, I do not only call it voting when electing somebody to represent me, but also for the case of a quorum, where the members' proceedings are valid and a determination is made.
Willtech
CC BY-SA 3.0
2018-02-08T10:00:59.330Z
What if all full nodes decide to accept any block regardless of its validity (why do they even waste their resources checking blocks?) ? what can prevent this situation??
user971961
CC BY-SA 3.0
2018-02-08T13:01:23.990Z
@user971961 the rules of bitcoin require you to verify blocks. if you don't verify them then it's not bitcoin. if you allowed invalid blocks then someone could move money that doesn't belong to them. it would be an insecure and worthless system.
Abdussamad
CC BY-SA 3.0
2018-02-07T11:54:03.853Z
2018-02-08T13:03:23.493Z
2018-02-08T13:03:23.493Z
Abdussamad
<p>I recently started reading about Bitcoin, the idea seems hard to get, and I'm trying to understand the basics now. </p>

<p>I read the white paper by Satoshi Nakamoto but I still have some confusions</p>

<p>First, it has been said that the main advantage of the Bitcoin is its capability to prevent the Double spending attacks, my questions are:</p>

<ul>
<li>Is this because of the idea of blockchain or the proof of work? </li>
<li>Can anyone spend his bitcoins twice in two different transactions and
two different blockchain? if not, how does the protocol prevent
prevent such a case?</li>
<li>What exactly the process that minors follow to detect that a
certain transaction is spending the bitcoins twice?</li>
<li>Why don't minors (voters) simply accept a new block without even
check if it's truly valid or not? what are the consequences?</li>
</ul>

<p>I'm sorry if my questions seem very basic,</p>

<p>Thanks in advance </p>

<bitcoin-core><blockchain><block><doublespend>
How does the bitcoin exactly prevent Double spending attacks?
user971961
# How does the bitcoin exactly prevent Double spending attacks?

(Asked by: username_0 on 2018-02-07)

I recently started reading about Bitcoin, the idea seems hard to get, and I'm trying to understand the basics now.

I read the white paper by Satoshi Nakamoto but I still have some confusions

First, it has been said that the main advantage of the Bitcoin is its capability to prevent the Double spending attacks, my questions are:

* Is this because of the idea of blockchain or the proof of work?
* Can anyone spend his bitcoins twice in two different transactions and
  two different blockchain? if not, how does the protocol prevent
  prevent such a case?
* What exactly the process that minors follow to detect that a
  certain transaction is spending the bitcoins twice?
* Why don't minors (voters) simply accept a new block without even
  check if it's truly valid or not? what are the consequences?

I'm sorry if my questions seem very basic,

Thanks in advance

**Tags:** bitcoin-core, blockchain, block, doublespend


---

## 1 answers

### Answer by username_1 on 2018-02-07. Score: 1

A full node is a computer running full node software like bitcoin core that has verified every transaction in the blockchain and continues to verify new ones as and when it hears about them. Every full node validates transactions and rejects double spends. If it has learned of a transaction that spends certain coins it will reject any new transaction that tries to spend those same coins unless the original transaction has been marked as replaceable.

Because of the nature of computer networks it is possible that not every node has heard of every transaction. It is also possible that different nodes will have heard of the same transactions in different order. The blockchain fixes the order and history of the transactions so that everyone agrees on the state of the ledger. Once a transaction has been committed to the blockchain and enough blocks have been added to the chain after the block containing the transaction that transaction cannot be modified.

So every node individually prevents double spends that it hears about and the collective consensus of what transactions happened or did not happen comes through the blockchain.

> What exactly the process that minors follow to detect that a certain transaction is spending the bitcoins twice?

Miners aren't the only ones validating transactions. Like I said every full node validates transactions to make sure that there are no double spends.

Miners follow the same process as full nodes. The full list of validation rules is given [here](https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages).

> Why don't minors (voters) simply accept a new block without even check if it's truly valid or not? what are the consequences?

There is no voting in bitcoin. It's not just miners who need to check the validity of blocks. Full nodes run by users check it too. If a miner generates an invalid block then full nodes will reject it and the miner will lose money because he will have wasted electricity and time producing that block.

> **Comments:**
> **username_2**: Actually, there is voting on consensus changes. There was a slogan 'One CPU, one vote.' early on.  
> **username_1**: @username_2 I was told by gmaxwell that there is no voting in bitcoin because voting implies electing a third party to represent you. He said that only thing that comes close to the concept of voting is the "hashrate based quorum" which i take to mean the consensus formed using proof of work regarding the state of the ledger.  
> **username_2**: Okay, @gmaxwell uses correct terminology and his statements as you have relayed them are certainly without error. Personally, I do not only call it voting when electing somebody to represent me, but also for the case of a quorum, where the members' proceedings are valid and a determination is made.  
> **username_0**: What if all full nodes decide to accept any block regardless of its validity (why do they even waste their resources checking blocks?) ? what can prevent this situation??  
> **username_1**: @username_0 the rules of bitcoin require you to verify blocks. if you don't verify them then it's not bitcoin. if you allowed invalid blocks then someone could move money that doesn't belong to them. it would be an insecure and worthless system.  

---

