Evolution SDK
Smart contracts

Redeemers

Provide data to script validators when spending or minting

Redeemers

Redeemers are the data you provide to a Plutus script when spending from it or minting with it. The validator receives this data and uses it to decide whether to authorize the transaction.

Evolution SDK supports three redeemer modes that handle a key challenge: redeemer indices aren't known until after coin selection, because coin selection can add or reorder inputs.

The Index Problem

Cardano redeemers reference inputs by their sorted position in the transaction. When coin selection adds wallet UTxOs to cover fees, all indices can shift. Evolution SDK solves this by deferring redeemer construction until after coin selection completes.

Static Mode

The simplest mode — provide a direct Data value. Use this when your redeemer doesn't need to know its input index:

import { , , type  } from "@evolution-sdk/evolution"

const  = ({
  : "preprod",
  : { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
  : { : "seed", : ..!, : 0 }
})

declare const : .[]
declare const : any

// Static redeemer — the value is fixed
const  = await 
  .()
  .({
    : ,
    : .(0n, []) // "Claim" action
  })
  .({ :  })
  .()

When to use: Most cases. Simple action tags (Claim, Cancel, Update), fixed parameters, or any redeemer that doesn't depend on transaction structure.

Self Mode

A callback that receives the input's final index after coin selection. Use this when the redeemer needs to encode its own position:

import { , , type  } from "@evolution-sdk/evolution"

const  = ({
  : "preprod",
  : { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
  : { : "seed", : ..!, : 0 }
})

declare const : .[]
declare const : any

// Self redeemer — callback receives { index, utxo }
const  = await 
  .()
  .({
    : ,
    : () => .(0n, [(.)])
  })
  .({ :  })
  .()

The callback receives an IndexedInput object:

interface IndexedInput {
  readonly index: number  // Final 0-based index in sorted tx inputs
  readonly utxo: UTxO     // The original UTxO
}

When to use: Validators that need the input's own index for self-referential checks.

Batch Mode

A callback that sees all specified inputs with their final indices. Use this when multiple script inputs need coordinated redeemer values:

import { , , type  } from "@evolution-sdk/evolution"

const  = ({
  : "preprod",
  : { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
  : { : "seed", : ..!, : 0 }
})

declare const : .[]
declare const : any

// Batch redeemer — callback sees all specified inputs
const  = await 
  .()
  .({
    : ,
    : {
      : () => .(0n, [
        .( => (.)) as .
      ]),
      : 
    }
  })
  .({ :  })
  .()

When to use: DEX batch fills, multi-UTxO state transitions, or any validator that needs to see indices of multiple inputs simultaneously.

Minting Redeemers

Redeemers also apply to minting policies. The same three modes work:

import { , ,  } from "@evolution-sdk/evolution"

const  = ({
  : "preprod",
  : { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
  : { : "seed", : ..!, : 0 }
})

declare const : any

let  = .(2_000_000n)
 = .(, "abc123def456abc123def456abc123def456abc123def456abc123de", "", 100n)

const  = await 
  .()
  .({
    ,
    : .(0n, []) // "Mint" action
  })
  .({ :  })
  .()

Type-Safe Redeemers with TSchema

Define redeemer schemas for compile-time validation:

import { , ,  } from "@evolution-sdk/evolution"

const  = .({
  : {},
  : {},
  : {
    : .,
    : .
  }
})

type  = typeof .
const  = .()

// Type-safe redeemer creation
const  = .({ : {} })
const  = .({ : {} })
const  = .({
  : {
    : 1735776000000n,
    : .("def456abc123def456abc123def456abc123def456abc123def456ab")
  }
})

Choosing the Right Mode

ModeRedeemer ValueUse Case
StaticFixed Data valueAction tags, simple parameters
Self(input) => DataSelf-referential index checks
Batch{ all: (inputs) => Data, inputs }Multi-input coordination, DEX batching

Start with static mode. Only use self or batch when your validator specifically needs input indices.

Next Steps