Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: DannyHamilton on December 07, 2012, 03:25:42 PM



Title: Modifying outputs before forwarding?
Post by: DannyHamilton on December 07, 2012, 03:25:42 PM
I'm sure I'm missing something simple and obvious, but as I look through the protocol I'm not seeing what keeps me from creating a client that modifies the tx_out of all transactions that it receives before relaying them.

The tx_in is already signed in the transaction, so I don't need the private key.  All I need to do is change the address in the pk_script of tx_out to one that I have the primary key to before relaying it.

What am I missing here?


Title: Re: Modifying outputs before forwarding?
Post by: casascius on December 07, 2012, 03:40:05 PM
The signatures sign a hash of the whole transaction with blanks in place of the signatures (obviously, since the signatures aren't known before signing).

Changing a txout will change the hash and therefore require a different signature.


Title: Re: Modifying outputs before forwarding?
Post by: DannyHamilton on December 07, 2012, 03:42:48 PM
The signatures sign a hash of the whole transaction with blanks in place of the signatures (obviously, since the signatures aren't known before signing).

Changing a txout will change the hash and therefore require a different signature.
I knew it would be something simple and obvious, I just wasn't seeing it.  Thanks.