I've seen transactions with PkScripts as part of Inputs

eg : Example of such a transaction

Could anyone please explain how this PkScript is used ?


This is additional information displayed by blockchain.com, and not part of the transaction data (for the transaction being viewed).

The PkScript is the locking script set by the previous transactions that created the outputs being used as inputs for the selected transaction. The selected transaction does not include this information, only a reference to it (in the form of the previous output txid + vout).

Blockchain.com uses this reference to lookup the PkScript from the previous transaction, and displays it alongside the scriptSig and witness data here.

The PkScript is used to ensure that the transaction is valid - it is also known as a locking script, and is a Bitcoin Script program that sets the requirements for the output to be spent. For example, a p2pkh locking script sets the requirement to "the input must be signed with a private key for which the public key's HASH160 equals the HASH160 in the locking script".

The input's scriptSig (and witness, in segwit transactions) is fed to the locking script as input. If the program evaluates to true, the scripts are valid. If it evaluates to anything else, it is invalid.

  • It looks like they're showing the scriptPubKey of the output being spent. I first downvoted because it sounded like you were saying it's a blockchain.info specific transaction comment, but re-reading I think what you're trying to say is they're doing additional interpretation of the data, which is right. Nov 25 '19 at 4:27
  • 1
    @PieterWuille Yup, they are - afaik, the only way to get that data is to look up the previous transaction and read it from the vout being used, and it is not part of the transaction data for the tx being viewed. Perhaps my phrasing is a bit off, I'll revise it a little Nov 25 '19 at 4:29
  • 2
    So what does it mean that blockchain.com shows "Pkscript Invalid / ASM" in OP's link? The transaction is confirmed so it can't be an invalid transaction. Dec 24 '20 at 5:48

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.