<p>The <a href="http://en.wikipedia.org/wiki/Digital_signature" rel="nofollow">digital signature</a> (with the SHA-hashed message) required for peers to accept the transaction.</p>

CC BY-SA 3.0
2014-01-04T12:15:56.987Z
2014-01-04T12:15:56.987Z
Jori
<p>In a typical transaction, every signature in the transaction is a signature over <a href="https://en.bitcoin.it/wiki/OP_CHECKSIG#Hashtype_SIGHASH_ALL_.28default.29" rel="nofollow">all the outputs</a>. So you can't change any of the outputs without invalidating all the signatures.</p>

CC BY-SA 3.0
2014-01-05T01:14:32.727Z
Thanks. For some reason I thought scriptsig just signed the output of the old tx, didn't realize it was a sort of combo of old and new TXs together.
pinhead
CC BY-SA 3.0
2014-01-04T17:47:40.783Z
2014-01-04T17:47:40.783Z
David Schwartz
<p>I'm reading the technical FAQs on the wiki, and what I don't see is, if I create a transaction with signed prev_outs and new outputs, do I also sign the ENTIRE new tx before broadcasting? I don't see any field in the spec for a final overall signature. </p>

<p>So what I'm asking is, if I receive a tx from a peer, what is stopping me from altering that tx message so the output is now my own address, and trying to broadcast my new fraudulent tx to the network faster and to more peers than the original honest tx?</p>

<transactions><signature>
Can an attacker steal a very recent tx and alter it, broadcasting a new tx with his address on the output?
pinhead
# Can an attacker steal a very recent tx and alter it, broadcasting a new tx with his address on the output?

(Asked by: username_0 on 2014-01-04)

I'm reading the technical FAQs on the wiki, and what I don't see is, if I create a transaction with signed prev\_outs and new outputs, do I also sign the ENTIRE new tx before broadcasting? I don't see any field in the spec for a final overall signature.

So what I'm asking is, if I receive a tx from a peer, what is stopping me from altering that tx message so the output is now my own address, and trying to broadcast my new fraudulent tx to the network faster and to more peers than the original honest tx?

**Tags:** transactions, signature


---

## 2 answers

### Answer by username_2 on 2014-01-04. Score: 4 | Accepted answer

In a typical transaction, every signature in the transaction is a signature over [all the outputs](https://en.bitcoin.it/wiki/OP_CHECKSIG#Hashtype_SIGHASH_ALL_.28default.29). So you can't change any of the outputs without invalidating all the signatures.

> **Comments:**
> **username_0**: Thanks. For some reason I thought scriptsig just signed the output of the old tx, didn't realize it was a sort of combo of old and new TXs together.  

---

### Answer by username_1 on 2014-01-04. Score: 1

The [digital signature](http://en.wikipedia.org/wiki/Digital_signature) (with the SHA-hashed message) required for peers to accept the transaction.


---

