<p>Most transactions contain a digital signature which signs a hash of the transaction. Usually this hash includes the entirety of the transaction, so changing any part of the transaction would invalidate the signature and thus invalidate the entire transaction. The miner won't be able to change the output values you signed, because it would change the hash.</p>

CC BY-SA 3.0
2017-10-25T08:34:33.690Z
I think the hash does not include the signatures, when compiling a tx, you fill the signatures in the TXIN sigscript with the spending condition (the TXOUT pubkey script, e.g. 76A914+hash+88AC), then build the hash of the tx.
pebwindkraft
CC BY-SA 3.0
2017-10-25T10:14:48.057Z
@pebwindkraft the hash did contain the signature (in the scriptSig of the input) before segwit, that is the cause of the transaction malleability. In a segwit transaction, the signature is not part of the TXID because it is part of the witness, so it is included in the WTXID hash
meshcollider
CC BY-SA 3.0
2017-10-26T02:58:19.400Z
the signature is computed on hash of the all the data, except on signature since it won;t be possible. But here when the mining node changes the output value, hash will be changed and mining node can't compute signature on that, and if we assume mining node is malicious that skips the validation of transaction and publishes the block. But when other nodes receives the block while they accepting the block they check all the transactions and they invalidate the block, so in that sense this malicious chain of mining node won't be grown any further by any other nodes, except by mining node itself.
sg777
CC BY-SA 3.0
2017-10-25T08:27:41.123Z
2017-10-25T08:27:41.123Z
BlackBeltBob
<p>I'm reading through bitcoin manuals and I got this question, please help me to correct my understanding.</p>

<p>I'm aware that changing the transaction output amount value can make the transaction unusable. What happens if the mining nodes lowers the output value to get more transaction fee, in such scenarios how the bitcoin protocol counterfeit that?</p>

<p>Thank You. </p>

CC BY-SA 3.0
2017-10-25T08:40:21.897Z
very good question, I'd like to understand as well, experts to the front!
a tx is hashed, before sent to any nodes. This hash also identifies a tx. A node does for sure a complete check of the tx (https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages). So if the miner receives a tx, and afterwards changes a value in the tx, the tx hash wouldn't be the same anymore. It would be a new tx. This makes the tx maybe unspendable, but the miner would have increased fees? How is block assembly preventing this misbehaviour?
pebwindkraft
CC BY-SA 3.0
2017-10-26T03:08:52.833Z
thank you, some clarity what I got is, the hash is computed on all the fields of transaction data except the signature field, any changes to tx data results in changed hash and for which malicious mining node can't compute the signature. But due to the changes the transaction is unusable any further. But still the mining node can compute POW and publish the block, and since each block verifies the block hash and tranaction signatures before assembling the blocks into blockchain at that point the other nodes simply reject the block.
sg777
CC BY-SA 3.0
2017-10-26T03:09:01.957Z
So mining node doesn't get any support from the networking nodes in growing up the malicious chain. Though it's hypothetical if the mining dominates the power of computation of other nodes in the network, then in that case the complete corruption of block chain is possible I think.
sg777
<transaction-fees>
transaction edit done by mining nodes
sg777
# transaction edit done by mining nodes

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

I'm reading through bitcoin manuals and I got this question, please help me to correct my understanding.

I'm aware that changing the transaction output amount value can make the transaction unusable. What happens if the mining nodes lowers the output value to get more transaction fee, in such scenarios how the bitcoin protocol counterfeit that?

Thank You.

**Tags:** transaction-fees

> **Comments:**
> **username_1**: very good question, I'd like to understand as well, experts to the front! a tx is hashed, before sent to any nodes. This hash also identifies a tx. A node does for sure a complete check of the tx (https://en.bitcoin.it/wiki/Protocol_rules#.22tx.22_messages). So if the miner receives a tx, and afterwards changes a value in the tx, the tx hash wouldn't be the same anymore. It would be a new tx. This makes the tx maybe unspendable, but the miner would have increased fees? How is block assembly preventing this misbehaviour?  
> **username_0**: thank you, some clarity what I got is, the hash is computed on all the fields of transaction data except the signature field, any changes to tx data results in changed hash and for which malicious mining node can't compute the signature. But due to the changes the transaction is unusable any further. But still the mining node can compute POW and publish the block, and since each block verifies the block hash and tranaction signatures before assembling the blocks into blockchain at that point the other nodes simply reject the block.  
> **username_0**: So mining node doesn't get any support from the networking nodes in growing up the malicious chain. Though it's hypothetical if the mining dominates the power of computation of other nodes in the network, then in that case the complete corruption of block chain is possible I think.  

---

## 1 answers

### Answer by username_2 on 2017-10-25. Score: 1

Most transactions contain a digital signature which signs a hash of the transaction. Usually this hash includes the entirety of the transaction, so changing any part of the transaction would invalidate the signature and thus invalidate the entire transaction. The miner won't be able to change the output values you signed, because it would change the hash.

> **Comments:**
> **username_1**: I think the hash does not include the signatures, when compiling a tx, you fill the signatures in the TXIN sigscript with the spending condition (the TXOUT pubkey script, e.g. 76A914+hash+88AC), then build the hash of the tx.  
> **username_3**: @username_1 the hash did contain the signature (in the scriptSig of the input) before segwit, that is the cause of the transaction malleability. In a segwit transaction, the signature is not part of the TXID because it is part of the witness, so it is included in the WTXID hash  
> **username_0**: the signature is computed on hash of the all the data, except on signature since it won;t be possible. But here when the mining node changes the output value, hash will be changed and mining node can't compute signature on that, and if we assume mining node is malicious that skips the validation of transaction and publishes the block. But when other nodes receives the block while they accepting the block they check all the transactions and they invalidate the block, so in that sense this malicious chain of mining node won't be grown any further by any other nodes, except by mining node itself.  

---

