0

When using a Trezor to sign a transaction with a script address as the receiver, I get the message "The following transaction output contains a script address, but does not contain a datum. Continue?".

If I confirm the signing of the transaction and complete sending, the transaction goes through and the balances are updated as expected.

From what I've read in various documentation, it's mentioned that a datum hash should be attached to the UTXO at the script address. Does that mean that it is mandatory to have one in order for the script address to use the UTXO?

In my case where I did not attach a datum hash to the transaction, can the receiving script address spend the UTXO it was sent?

1 Answer 1

2

Currently, Cardano has two types of addresses, verification key witnessed addresses and script witnessed address. The former allows spending of value (in the form of UTxOs) from that address if the transaction that specifies the spending contains the signature of the associated signing key. The latter allows the spending of value if the script that hashes to the address validates true given three arguments of the transaction. These are, the datum, the redeemer, and the context.

Without one of these, a script cannot validate, this is because the lowest level of code on the ledger (untyped plutus core) must have these inputs to derive its return value. The reason it needs inputs, is that it is a lambda calculus. This is a functional way of doing computation, and to return anything you need to reduce the lambda functions(1). With a missing argument, you can only reduce to a certain point.

So, if a script requires a datum, but the UTxO at its address has none, it is unspendable (currently).

DISCLAIMER: Besides plutus scripts, which I mainly touched upon, there are also simple scripts (2). These are also scripts, but they do not need a datum! It is currently not possible to distinguish a plutus script address from a simple script address from solely their address. This means that your Trezor, will also flag the simple script address with that warning, though it is not needed. There is a CIP (Cardano improvement proposal) that tries to fix this by annotating each address with a script version indication (3).

Your Answer

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

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