<p>The outputs of a transaction are signed by the inputs. Changing the outputs would cause it to become invalid, and it would not be able to be included in a valid block.</p>

CC BY-SA 4.0
2021-08-05T11:52:56.980Z
2021-08-05T11:52:56.980Z
Claris
<p>I am a noob. Currently, I am reading Mastering Bitcoin book. If I understand correctly, output of a bitcoin transaction is just a locking script with this format:</p>
<pre><code>scriptPubKey: &quot;OP_DUP OP_HASH160 (PubKHash of reciever) OP_EQUALVERIFY OP_CHECKSIG&quot;
</code></pre>
<p>My Question is: What prevents miners from modifying PubKHash section of the above script and changing it to their addresses and stealing bitcoins from sender?</p>

<security><transaction-malleability>
Integrity of Bitcoin transaction outputs
noooooob
# Integrity of Bitcoin transaction outputs

(Asked by: username_0 on 2021-08-05)

I am a noob. Currently, I am reading Mastering Bitcoin book. If I understand correctly, output of a bitcoin transaction is just a locking script with this format:
scriptPubKey: "OP_DUP OP_HASH160 (PubKHash of reciever) OP_EQUALVERIFY OP_CHECKSIG"

My Question is: What prevents miners from modifying PubKHash section of the above script and changing it to their addresses and stealing bitcoins from sender?

**Tags:** security, transaction-malleability


---

## 1 answers

### Answer by username_1 on 2021-08-05. Score: 2

The outputs of a transaction are signed by the inputs. Changing the outputs would cause it to become invalid, and it would not be able to be included in a valid block.


---

