user6332: Looking at the db-sync schema, I see the tx_out table has a data_hash column, but I can't make sense of why this column is not on the tx table instead. From the Alonzo CDDL, I can see the scripts are part of the transaction_witness_sets, which is part of the block, so I don't see how one could match a script data from a witness to an output in a transaction.

user6332: According to CDDL, the transaction output itself has a data_hash: https://github.com/input-output-hk/cardano-ledger/blob/37322df14d44d1370e8a72b677815d64a92baa00/alonzo/test/cddl-files/alonzo.cddl#L73
PS: I can't believe I missed that...

6332: <p>Looking at the <a href="https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/schema.md#tx_out" rel="nofollow noreferrer">db-sync schema</a>, I see the <code>tx_out</code> table has a <code>data_hash</code> column, but I can't make sense of why this column is not on the <code>tx</code> table instead. From the <a href="https://github.com/input-output-hk/cardano-ledger/blob/37322df14d44d1370e8a72b677815d64a92baa00/alonzo/test/cddl-files/alonzo.cddl" rel="nofollow noreferrer">Alonzo CDDL</a>, I can see the scripts are part of the <code>transaction_witness_sets</code>, which is part of the block, so I don't see how one could match a script data from a witness to an output in a transaction.</p>
 6332: <p>According to CDDL, the transaction output itself has a <code>data_hash</code>: <a href="https://github.com/input-output-hk/cardano-ledger/blob/37322df14d44d1370e8a72b677815d64a92baa00/alonzo/test/cddl-files/alonzo.cddl#L73" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-ledger/blob/37322df14d44d1370e8a72b677815d64a92baa00/alonzo/test/cddl-files/alonzo.cddl#L73</a></p>
<p>PS: I can't believe I missed that...</p>
