1

From time to time I encounter transactions which contain UTXOs associated to script addresses with datum hashes for which no corresponding entries are available in the datum table of a fully-synched cardano-db-sync postgres.

Here is a randomly selected example:

select data_hash from tx_out where tx_id = (select id from tx where hash = '\xfc6536534b03f818494f21698994d387c879a121b263153a06975d056d9cf13e');

This will output \x4a664c584e552af70dcc255921811b5f62637fd781a43e5c289d9e571a227117. Then:

select * from datum where hash = '\x4a664c584e552af70dcc255921811b5f62637fd781a43e5c289d9e571a227117';

finds 0 rows.

As datums values are included in the witness set of the corresponding transactions I would expect all hashes to have a matching entry in the datum table.

  • Is this a bug on cardano-db-sync?
  • Is there any other way to retrieve those datum values directly, maybe by using cardano-cli to query the blockchain directly?

1 Answer 1

1

As datums values are included in the witness set of the corresponding transactions

This is not true all of the time. When you create a new script UTxO by sending some amount of tokens to it, you don't necessarily need to provide the datum, since there is no validation being made yet. You can if you want, though, by using (in cardano-cli) the tx-out-embeded-datum argument.

When you consume it, however, you'll need the actual datum, since the script validation depends on it. In your case, I assume you are inspecting an UTxO that didn't have any datum attached to it.

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.