0

I am wondering if ie. miner cannot change outputs from transaction. We have example of transaction:

      {
"version": 1,
"locktime": 0,
"vin": [
{
"txid":
"7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18",
"vout": 0,
"scriptSig" :
"3045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204
b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e3813[ALL]
0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d1
72787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf",
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.01500000,
"scriptPubKey": "OP_DUP OP_HASH160
ab68025513c3dbd2f7b92a94e0581f5d50f654e7 OP_EQUALVERIFY OP_CHECKSIG"
},
{
"value": 0.08450000,
"scriptPubKey": "OP_DUP OP_HASH160
7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8 OP_EQUALVERIFY OP_CHECKSIG",
}
]
}

I signed UTXO from txr 7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18 by my private key. I put this signature to scriptSig and added my targets addresses to vout and send transaction to bitcoin network. How can I be sure that anyone can't change vout values? Maybe I am wrong and my scriptSig includes additional data from transaction. How this scriptSig is created?

3
  • As a very simple way to understand what's happening (and I'm not making this an answer because it lacks detail) there is a signature for each input that signs the outputs according to the requirements to claim that particular input. So if you modify any output, all signatures for inputs that require signatures will be invalid and the transaction cannot claim those inputs. Commented May 28, 2021 at 16:25
  • David you mean that scriptSign contains data from vout. Other words, data what I am signing are tx, vin, vout? Am I right?
    – MMC
    Commented May 28, 2021 at 16:39
  • That's correct. The signature binds that input to that output and, assuming you use the standard scripts, varying either the input or the output invalidates the signature. Commented May 28, 2021 at 18:01

0