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 .

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.

  • 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 Apr 27 '15 at 12:22
  • @HaddarMacdasi The signature type is chosen by the signer at signing time. See bitcoin.org/en/developer-guide#signature-hash-types – Nick ODell Apr 27 '15 at 22:08
  • @HaddarMacdasi Also, I noticed that my answer was wrong, so I fixed it. – Nick ODell Apr 27 '15 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.