Is it possible to copy other scriptSig for using in different transaction?

2

To use a UTXO one must supply correct scriptSig or "unlocking script" to the given scriptPubKey "lock script", I know the scriptSig in PTPKH locking is sig and pubkey. My question is what makes the sig be unique to the specific UTXO ? It must be, otherwise I can take it and use it in different UTXO which has the same scriptPubKey .

Haddar Macdasi

Posted 2015-04-26T15:46:23.767

Reputation: 845

Answers

1

No, because clients use SIGHASH_ALL in their transactions by default, which signs the outpoint you're spending in addition to the rest of the transaction.

People also sometimes add the flag SIGHASH_ANYONECANPAY to SIGHASH_ALL which still signs the outpoint you're spending.

Nick ODell

Posted 2015-04-26T15:46:23.767

Reputation: 26 536

By saying client sometimes use 'SIGHASH_ANYONECANPAY' , Do you mean the <sig> part of the scriptSig is created using 'SIGHASH_ANYONECANPAY' ? If so, how different signature type 'SIGHASH_ANYONECANPAY' and 'SIGHASH_ALL' can unlock same scriptPubKey ?Haddar Macdasi 2015-04-27T12:22:59.333

@HaddarMacdasi The signature type is chosen by the signer at signing time. See https://bitcoin.org/en/developer-guide#signature-hash-types

Nick ODell 2015-04-27T22:08:43.623

@HaddarMacdasi Also, I noticed that my answer was wrong, so I fixed it.Nick ODell 2015-04-27T22:13:10.993