<p>There is more to a blockchain than just a linked list of hashes and a proof of work. There's more to Bitcoin than just a linked list of hashes and a proof of work. What defines Bitcoin and its blockchain are the consensus rules. These are a set of rules that determine what constitutes a valid block and a valid transaction. The blockchain is a linked list of blocks which contain transactions that conform to the consensus rules. Every block in the blockchain must also conform to these consensus rules.</p>

<p>One of the consensus rules is that a transaction cannot create more value in its outputs than it spends in its inputs. It can create less value, and the difference is the transaction fee. But it cannot create more value as that would lead to infinite inflation and Bitcoin would not work as a monetary system. This rule is completely independent of the linked list of hashes and completely independent of the Proof of Work.</p>

<p>Furthermore, there is no such an object as a Bitcoin. What people refer to as Bitcoin are simply values associated with transaction outputs. There aren't actually Bitcoins; it is solely based around the transactions and their outputs.</p>

CC BY-SA 3.0
2018-04-16T23:13:52.303Z
**transaction cannot create more value in its outputs than it spends in its inputs** So how does the network verify inputs?
btc
CC BY-SA 3.0
2018-04-16T23:22:12.617Z
A transaction creates transaction outputs. These transaction outputs are spent as inputs in other transactions. They have an associated value and a set of conditions required to spend that output. So verification means that a node will look up the transaction output that is being spent from (as it is directly referenced in the input) and makes sure that the transaction spending that output provides the necessary information required to spend that output as well as recording its value for use later in validating the transaction.
Ava Chow
CC BY-SA 3.0
2018-04-17T01:48:04.763Z
So a miner verifies the contract it puts into the blockchain? And what if it cheated and put it in even if it was illegal? Does every miner upstream verify each contract?
btc
CC BY-SA 3.0
2018-04-17T02:28:03.577Z
Not just miners, full nodes (which miners are a subset of) verify all blocks and transactions. If a block contains an invalid transaction, then all full nodes (including other miners) will reject that block for violating the consensus rules and continue as if that block did not exist. The miners are not the ones who determine whether a transaction is valid; full nodes determine that for themselves.
Ava Chow
CC BY-SA 3.0
2018-04-17T06:10:00.643Z
Thanks for this answer!! Just one small question, according to [this answer](https://bitcoin.stackexchange.com/questions/5564/how-many-transactions-have-been-included-into-the-blockchain), as of six years ago there were almost 10 million transaction recorded in the blockchain. How far back is each transaction verified (in the official software)? And (just curious here) have there been any (in the wild) attempts at double-spending in collusion with a miner that were stopped by others?
btc
CC BY-SA 3.0
2018-04-17T15:35:30.633Z
Transactions are verified "all the way back", i.e. every transaction in the chain of transactions is verified. However there are smart ways to do this besides verifying every single transaction for each new transaction. For Bitcoin Core, it maintains a separate database that contains the set of Unspent Transaction Outputs. Any UTXO in this database means that it is unspent and that the transaction it is from was valid. So when verifying a transaction, it can pull up the UTXOs it spends. If they exist, it can safely assume that all of the transactions in the transaction chain are valid.
Ava Chow
CC BY-SA 3.0
2018-04-16T22:20:52.027Z
2018-04-16T22:20:52.027Z
Ava Chow
<p>So I understand how blockchains work[1]. I understand how proof-of-work works[2]. And I understand how they work together. I also understand (or at least I think I do :) how transactions work (A block can contain arbitrary data inside of it, so it can contain a message signed by A that he transfers 5 btc to B).</p>

<p>But where does the bitcoin itself fit in this picture?</p>

<p>Is it a recalculated number every time (so if A gives 1 btc to B, then if I want to confirm, I verify that A has 1 btc to give away by checking who sent him anything, and make sure that <em>he</em> has what to give away, etc. up until the miner's bounty)? If so, this would have to be done whenever a block is mined (if not, I (who have 0 btc in my "wallet") can certify that I give B 100 btc, mine a block, and include that transaction. And while the blockchain on its own would still work (meaning that the hashes work out and solve the proof-of-work), the accounting wouldn't). </p>

<p>Am I making sense or am I totally off?</p>

<p>[1]. It's a linked list, but instead of linking-by-address, it's a link-by-hash.</p>

<p>[2]. Change a part of the Node so that the node's hash would start with 100 zeros, for example.</p>

<transactions><mining-theory><transaction-verification>
What exactly is a bitcoin?
btc
# What exactly is a bitcoin?

(Asked by: username_0 on 2018-04-16)

So I understand how blockchains work[1]. I understand how proof-of-work works[2]. And I understand how they work together. I also understand (or at least I think I do :) how transactions work (A block can contain arbitrary data inside of it, so it can contain a message signed by A that he transfers 5 btc to B).

But where does the bitcoin itself fit in this picture?

Is it a recalculated number every time (so if A gives 1 btc to B, then if I want to confirm, I verify that A has 1 btc to give away by checking who sent him anything, and make sure that *he* has what to give away, etc. up until the miner's bounty)? If so, this would have to be done whenever a block is mined (if not, I (who have 0 btc in my "wallet") can certify that I give B 100 btc, mine a block, and include that transaction. And while the blockchain on its own would still work (meaning that the hashes work out and solve the proof-of-work), the accounting wouldn't).

Am I making sense or am I totally off?

[1]. It's a linked list, but instead of linking-by-address, it's a link-by-hash.

[2]. Change a part of the Node so that the node's hash would start with 100 zeros, for example.

**Tags:** transactions, mining-theory, transaction-verification


---

## 1 answers

### Answer by username_1 on 2018-04-16. Score: 0 | Accepted answer

There is more to a blockchain than just a linked list of hashes and a proof of work. There's more to Bitcoin than just a linked list of hashes and a proof of work. What defines Bitcoin and its blockchain are the consensus rules. These are a set of rules that determine what constitutes a valid block and a valid transaction. The blockchain is a linked list of blocks which contain transactions that conform to the consensus rules. Every block in the blockchain must also conform to these consensus rules.

One of the consensus rules is that a transaction cannot create more value in its outputs than it spends in its inputs. It can create less value, and the difference is the transaction fee. But it cannot create more value as that would lead to infinite inflation and Bitcoin would not work as a monetary system. This rule is completely independent of the linked list of hashes and completely independent of the Proof of Work.

Furthermore, there is no such an object as a Bitcoin. What people refer to as Bitcoin are simply values associated with transaction outputs. There aren't actually Bitcoins; it is solely based around the transactions and their outputs.

> **Comments:**
> **username_0**: **transaction cannot create more value in its outputs than it spends in its inputs** So how does the network verify inputs?  
> **username_1**: A transaction creates transaction outputs. These transaction outputs are spent as inputs in other transactions. They have an associated value and a set of conditions required to spend that output. So verification means that a node will look up the transaction output that is being spent from (as it is directly referenced in the input) and makes sure that the transaction spending that output provides the necessary information required to spend that output as well as recording its value for use later in validating the transaction.  
> **username_0**: So a miner verifies the contract it puts into the blockchain? And what if it cheated and put it in even if it was illegal? Does every miner upstream verify each contract?  
> **username_1**: Not just miners, full nodes (which miners are a subset of) verify all blocks and transactions. If a block contains an invalid transaction, then all full nodes (including other miners) will reject that block for violating the consensus rules and continue as if that block did not exist. The miners are not the ones who determine whether a transaction is valid; full nodes determine that for themselves.  
> **username_0**: Thanks for this answer!! Just one small question, according to [this answer](https://bitcoin.stackexchange.com/questions/5564/how-many-transactions-have-been-included-into-the-blockchain), as of six years ago there were almost 10 million transaction recorded in the blockchain. How far back is each transaction verified (in the official software)? And (just curious here) have there been any (in the wild) attempts at double-spending in collusion with a miner that were stopped by others?  
> **username_1**: Transactions are verified "all the way back", i.e. every transaction in the chain of transactions is verified. However there are smart ways to do this besides verifying every single transaction for each new transaction. For Bitcoin Core, it maintains a separate database that contains the set of Unspent Transaction Outputs. Any UTXO in this database means that it is unspent and that the transaction it is from was valid. So when verifying a transaction, it can pull up the UTXOs it spends. If they exist, it can safely assume that all of the transactions in the transaction chain are valid.  

---

