<p>A validator script is compiled into Plutus Core by the Plutus Tx compiler. (It's actually a bit more complicated: see <a href="https://iohk.io/en/blog/posts/2021/02/02/plutus-tx-compiling-haskell-into-plutus-core/" rel="noreferrer">https://iohk.io/en/blog/posts/2021/02/02/plutus-tx-compiling-haskell-into-plutus-core/</a>)</p>
<p><strong>This compiled script is shipped within the transaction.</strong></p>
<p>Hashing the validation script ensures that funds potentially located at a script address can only be consumed by transactions that include the exact same script.</p>

CC BY-SA 4.0
2021-05-23T09:04:22.000Z
2021-05-23T09:04:22.000Z
Johannes Sirsch
<p>Someone managed to write some code which retrieves the scripts from the chain <a href="https://forum.cardano.org/t/proving-a-particular-policy-script-constraint-i-e-before/57443/11" rel="nofollow noreferrer">https://forum.cardano.org/t/proving-a-particular-policy-script-constraint-i-e-before/57443/11</a></p>

CC BY-SA 4.0
2021-05-25T18:00:22.723Z
2021-05-25T18:00:22.723Z
wutzebaer
<p>As far as I know, script address is the hash of the validator script. (Or has the hash of the validator script. I don't know which). So when a node wants to validate that address, It needs to run the validator script. So how does the node access the script?</p>

CC BY-SA 4.0
2022-12-11T04:36:13.130Z
Provided answer to a similar question here https://cardano.stackexchange.com/a/9610/1275
Pizza Knight
<plutus><node><script-addresses>
How do nodes access the validator code?
# How do nodes access the validator code?

(Asked by: username_0 on 2021-05-22)

As far as I know, script address is the hash of the validator script. (Or has the hash of the validator script. I don't know which). So when a node wants to validate that address, It needs to run the validator script. So how does the node access the script?

**Tags:** plutus, node, script-addresses
> **Comments:**
> **username_1**: Provided answer to a similar question here https://cardano.stackexchange.com/a/9610/1275  

---

## 2 answers

### Answer by username_2 on 2021-05-23. Score: 6

A validator script is compiled into Plutus Core by the Plutus Tx compiler. (It's actually a bit more complicated: see <https://iohk.io/en/blog/posts/2021/02/02/plutus-tx-compiling-haskell-into-plutus-core/>)

**This compiled script is shipped within the transaction.**

Hashing the validation script ensures that funds potentially located at a script address can only be consumed by transactions that include the exact same script.


---

### Answer by username_3 on 2021-05-25. Score: 1

Someone managed to write some code which retrieves the scripts from the chain <https://forum.cardano.org/t/proving-a-particular-policy-script-constraint-i-e-before/57443/11>


---

