Skip to content

Redeemers assoc list is not actually ordered on ScriptPurpose #125

@TotallyNotChase

Description

@TotallyNotChase

The documentation suggests that the redeemers "map" in the Transaction type is sorted on ScriptPurpose (also defined nearby):

/// > Redeemers are ordered by ascending [ScriptPurpose](./transaction.html#ScriptPurpose).

However, this is not the case unless there is some preprocessing. The plutus-ledger-api ScriptPurpose is different from the cardano-ledger script purpose. Like most things in the script context, the ordering follows the ledger types and specs, not the plutus types. For whatever reason, IOG decided to make the plutus ScriptPurpose ordering different...

Concretely, minting redeemers do not seem to appear at the beginning of redeemers in aiken code, as one might expect looking at ScriptPurpose. It's actually spending redeemers that appear first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions