I've seen transactions with PkScripts as part of Inputs
Could anyone please explain how this PkScript is used ?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
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.