1

So i am going over the plutus-pionner-program right now and he keeps on iterating this point. Transaction that spends a script output need to provide the datum of that script. Transaction that send money to a script address just need to provide the hash of that script. What is the point of all this ? I thought datum was used to keep track of the state of the script.What role does datum play in using a output from a script address and what role does datum play in sending to a script address.

1 Answer 1

2

I thought datum was used to keep track of the state of the script.

It can be and often is. This is how its used in a StateMachine, for example.

The cardano chain is 'lean': only the necessary information to ensure the integrity of the chain is required and kept on the chain.

A script is required and run only if a transaction spends from the address, and that script requires the datum to be available.

Sending to a script address from a payment address doesn't require the script to be run. In the minimalist spirit the chain needs only to record the hash of the datum to ensure that when the UTXO is spent this spending transaction has provided the right datum.

The design requires "off-chain" components of a DApp to take a much greater role for handling state than, say, ethereum. Whatever builds a transaction is responsible for ensuring that all datums and hashes are sensible ones.

Use of datum hashes has been flagged as a pain point: https://github.com/cardano-foundation/CIPs/tree/master/CIP-0032

Your Answer

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

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