1

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.

3
  • 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 (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? Oct 25, 2017 at 8:40
  • 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
    Oct 26, 2017 at 3:08
  • 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
    Oct 26, 2017 at 3:09

1 Answer 1

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.

3
  • 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. Oct 25, 2017 at 8:34
  • 1
    @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 Oct 25, 2017 at 10:14
  • 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
    Oct 26, 2017 at 2:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.