<p>The bitcoin protocol rules <a href="https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages</a> (rule 14) prevent this. It is a reject criteria for nodes. </p>

CC BY-SA 3.0
2017-10-25T08:45:23.067Z
2017-10-25T08:45:23.067Z
pebwindkraft
<p>Such transactions would be invalid. While you could create them, all nodes would reject them as invalid and such transactions would never confirm. If this were possible, then it would be possible to create money out of nothing (except in Coinbase transactions) and that should be impossible.</p>

<p>You have either constructed your transaction incorrectly, or are interpreting it incorrectly.</p>

CC BY-SA 3.0
2017-10-25T02:59:46.983Z
So if this were to have happened on a blockchain, is there an issue in the codebase?
Pixxl
CC BY-SA 3.0
2017-10-25T03:32:11.677Z
It means that there is possibly a problem in a given client's validation code, not necessarily a problem with the consensus rules themselves or with the coin. That a client would accept such an invalid transaction means that the client has a problem.
Ava Chow
CC BY-SA 4.0
2018-08-28T16:08:30.920Z
Coming back to this later, it seems this is because this is related to a Proof of Stake blockchain!
Pixxl
CC BY-SA 3.0
2017-10-25T01:43:22.303Z
2017-10-25T01:43:22.303Z
Ava Chow
<p>I have a transaction. This transaction was taking a value from <code>AddrX</code> and sending it to itself in a "split" of sorts. In the transaction there is one <code>VIN</code> of <code>98000000</code>. This transaction split the stack and has two <code>VOUT</code>. They are both <code>49000000.5</code>. There is a transaction fee of <code>1.00</code>.</p>

<p>In this case, the total <code>VOUT</code> is <code>98000001</code> which exceeds the total <code>VIN</code> of <code>98000000</code>. However, that difference is found in the transaction fee.</p>

<p>From what I have understood about the blockchain and transactions, the transaction fee is: <code>Fee: sum(vin) - sum(vout)</code> so it results in a <code>-1</code> transaction fee.</p>

<p>My issue here is that if I were building a database to track this address I would end up subtracting <code>98000000</code> from their balance, and then would add the two incoming values of <code>49000000.5</code> which would end up placing their total balance after this transaction to <code>98000001</code> which would be incorrect. Now, I could add logic to remove the transaction fee incurred from this manually; however I would have assumed that this transaction would be invalid because the total <code>VOUT</code> was greater than the total <code>VIN</code>.</p>

<p>Could this situation be possible? So far from transactions I've seen, the transaction fee has already been applied to one of the <code>VOUT</code> and thus would not cause this error. If it is possible, how can I detect this and remedy it?</p>

<transactions><blockchain><transaction-fees>
sum(VOUT) > sum(VIN) -- Is this a possible scenario?
Pixxl
# sum(VOUT) > sum(VIN) -- Is this a possible scenario?

(Asked by: username_0 on 2017-10-25)

I have a transaction. This transaction was taking a value from `AddrX` and sending it to itself in a "split" of sorts. In the transaction there is one `VIN` of `98000000`. This transaction split the stack and has two `VOUT`. They are both `49000000.5`. There is a transaction fee of `1.00`.

In this case, the total `VOUT` is `98000001` which exceeds the total `VIN` of `98000000`. However, that difference is found in the transaction fee.

From what I have understood about the blockchain and transactions, the transaction fee is: `Fee: sum(vin) - sum(vout)` so it results in a `-1` transaction fee.

My issue here is that if I were building a database to track this address I would end up subtracting `98000000` from their balance, and then would add the two incoming values of `49000000.5` which would end up placing their total balance after this transaction to `98000001` which would be incorrect. Now, I could add logic to remove the transaction fee incurred from this manually; however I would have assumed that this transaction would be invalid because the total `VOUT` was greater than the total `VIN`.

Could this situation be possible? So far from transactions I've seen, the transaction fee has already been applied to one of the `VOUT` and thus would not cause this error. If it is possible, how can I detect this and remedy it?

**Tags:** transactions, blockchain, transaction-fees


---

## 2 answers

### Answer by username_2 on 2017-10-25. Score: 3 | Accepted answer

Such transactions would be invalid. While you could create them, all nodes would reject them as invalid and such transactions would never confirm. If this were possible, then it would be possible to create money out of nothing (except in Coinbase transactions) and that should be impossible.

You have either constructed your transaction incorrectly, or are interpreting it incorrectly.

> **Comments:**
> **username_0**: So if this were to have happened on a blockchain, is there an issue in the codebase?  
> **username_2**: It means that there is possibly a problem in a given client's validation code, not necessarily a problem with the consensus rules themselves or with the coin. That a client would accept such an invalid transaction means that the client has a problem.  
> **username_0**: Coming back to this later, it seems this is because this is related to a Proof of Stake blockchain!  

---

### Answer by username_1 on 2017-10-25. Score: 0

The bitcoin protocol rules <https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages> (rule 14) prevent this. It is a reject criteria for nodes.


---

