<blockquote>
  <p>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.</p>
</blockquote>

<p>Yes, absolutely.</p>

<blockquote>
  <p>Is a scriptSig also embedded in the blockchain?</p>
</blockquote>

<p>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.</p>

<p>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.</p>

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

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

<p>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.</p>

CC BY-SA 4.0
2019-04-01T20:26:44.917Z
When calculating the size of a transaction, is the scriptSig included? For e.g. fees
nick carraway
CC BY-SA 4.0
2019-04-01T20:44:40.797Z
Yes, absolutely.
Pieter Wuille
CC BY-SA 4.0
2019-04-01T20:51:11.423Z
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).
Pieter Wuille
CC BY-SA 4.0
2019-04-01T19:29:38.880Z
2019-04-01T19:29:38.880Z
Pieter Wuille
<p>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.</p>

<p>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?</p>

<script>
Which parts of a bitcoin script are embedded in the blockchain?
nick carraway
# Which parts of a bitcoin script are embedded in the blockchain?

(Asked by: username_0 on 2019-04-01)

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?

**Tags:** script


---

## 1 answers

### Answer by username_1 on 2019-04-01. Score: 3 | Accepted answer

> 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.

> **Comments:**
> **username_0**: When calculating the size of a transaction, is the scriptSig included? For e.g. fees  
> **username_1**: Yes, absolutely.  
> **username_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).  

---

