0

I assume the scriptPubKey is contained in a UTXO, and therefore embedded in the blockchain. Since, this is the script used to unlock the input.

Is a scriptSig also embedded in the blockchain? Or is it only held in memory by miners to verify signatures before confirming a block, then discarded?

1 Answer 1

3

I assume the scriptPubKey is contained in a UTXO, and therefore embedded in the blockchain. Since, this is the script used to unlock the input.

Yes, absolutely.

Is a scriptSig also embedded in the blockchain?

They're part of transactions, and transactions in their entirety are part of the blockchain. All data that is directly or indirectly needed to validate blocks must be part of the blockchain, or the network wouldn't necessarily come to an agreement.

For example, if scriptSigs were not part of the chain, you could create a valid and invalid version of a transaction, broadcast the valid one, but then once you saw it in a block, replace it with the invalid one. Now the node you're passing it onto would think that block was invalid, while others thought it was valid - leading to a permanent fork in the chain.

Or is it only held in memory by miners to verify signatures before confirming a block, then discarded?

That's an implementation detail, and completely independent from the rest your question.

Yes, some nodes only download (all) blocks, validate them fully, and then throw them away after validation ("pruning"). Those blocks and everything in them are still part of the blockchain - these nodes simply don't store the full blockchain.

3
  • When calculating the size of a transaction, is the scriptSig included? For e.g. fees Apr 1, 2019 at 20:26
  • Yes, absolutely. Apr 1, 2019 at 20:44
  • 1
    In fact, one of the things SegWit changes is that the signatures are "discounted" for the purposes of resource limitations (and thus indirectly for fees), precisely because while they go in the blockchain just like outputs, they never enter the UTXO set (whose size growth is concerning on itself). Apr 1, 2019 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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