Skip to content

[FR] - Extra ScriptData for reference inputs with hashed datums #803

Closed
@mmontin

Description

@mmontin

Internal/External
External

Area
Plutus

Describe the feature you'd like

In july 2024 I posted an issue to report that cardano-api was not providing a way to add extra script data to a transaction body that does not correspond to an output being paid with a datum hash.

Later on, this feature was implemented in this PR.

However, it was very quickly removed in this commit.

Recently, I dove deeper into the ledger rules and realized that my original feature request was only half relevant. It turns out that the ledger rules forbid to add a resolved datum for a PK input with a datum hash, which I was not aware off (and which I don't know the reason for). I am assuming this is the reason why this new feature was quickly removed after being introduced following my issue.

However, I say half relevant, because the ledger does allow to provide extra resolved datums for reference inputs with hashed datums, which, following the removal of this feature, is still not possible to achieve from within cardano-api, as far as I can see. Feel free to let me know if either this feature is already present elsewhere, or if it is a deliberate choice not to provide it.

I wish this feature would be brought back, even if solely dedicated to reference inputs. Whenever a reference input would be defined in a transaction body, users could be given the opportunity to bind a ScriptData to that reference input, similarly to how they can be attached to outputs. It does not necessarily need to be a full new field within a body, which, I agree, was a reasonable solution if those extra datums could come from different places.

Describe alternatives you've considered

I am currently relying on the hack I described in my original issue, where i have to manually deconstruct the generated ShelleyTxBody, add the script data and re-bundle it after recomputing the script integrity hash. In case anybody is interested, this hack is performed here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions