6

How can a node verify a transaction with a script address without the script?

I mean when i start a node months after the transaction has been minted into a block. How can my node verify that the script conditions were met since only the hash is persisted in the chain?

4

By inspecting the current ledger CDDL specifications, you can see that each block contains a transaction_witness_sets field, where each transaction_witness_set is defined as:

transaction_witness_set =
  { ? 0: [* vkeywitness ]
  , ? 1: [* native_script ]
  , ? 2: [* bootstrap_witness ]
  }

Here, native_script, if present, contains some rules that need to be respected in order for the transaction to be valid (for instance, some minting policy):

native_script =
  [ script_pubkey
  // script_all
  // script_any
  // script_n_of_k
  // invalid_before
     ; Timelock validity intervals are half-open intervals [a, b).
     ; This field specifies the left (included) endpoint a.
  // invalid_hereafter
     ; Timelock validity intervals are half-open intervals [a, b).
     ; This field specifies the right (excluded) endpoint b.
  ]

So not only the script hash is included in the chain, but also the actual rules it contains.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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