title_body: How do nodes access the validator code?
upvoted_answer: 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.