Andamio LogoAndamio
Protocol/Protocol V2/Transactions/Course/Teacher/Modules

Modules Manage

Mint, update, or burn course modules

Course Teacher Modules Manage

Mint, update, or burn course modules (SLT collections). Teachers can batch multiple operations in a single transaction.

API Endpoint

POST /v2/tx/course/teacher/modules/manage

Cost Summary

Cost TypeAmountNotes
Transaction Fee~0.27 ADANetwork fee
Module Deposit~1.59 ADAPer module minted
Protocol Fee0 ADANo service fee
Total (1 module)~1.86 ADAScales linearly

Scaling: ~8.4 ADA for 5 modules, ~16.5 ADA for 10 modules.

Request Body

{
  "alias": "james",
  "course_id": "23a6bbce3a8deca8985764e847594f6956c9dc643e3f6c8efdba04e4",
  "modules_to_mint": [
    {
      "slts": ["I can mint an access token.", "I can complete an assignment."],
      "allowed_students_v2": [],
      "prerequisite_assignments_v2": []
    }
  ],
  "modules_to_update": [],
  "modules_to_burn": []
}
FieldTypeRequiredDescription
aliasstringYesTeacher's access token alias
course_idstringYesCourse NFT policy ID (56 char hex)
modules_to_mintobject[]YesModules to create (empty = none)
modules_to_updateobject[]YesModules to update (empty = none)
modules_to_burnstring[]YesModule hashes to burn (empty = none)

Transaction Pattern

Mint and Create - Mints module tokens, creates module UTxOs. Governance is spent to verify authorization.

┌─────────────────────────────────────────────────────────────────┐
│                   MODULES MANAGE TRANSACTION                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  INPUTS                          OUTPUTS                        │
│  ──────                          ───────                        │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ Governance      │───────────▶│ Governance      │            │
│  │ (teacher list)  │  SPEND     │ (unchanged)     │            │
│  └─────────────────┘            └─────────────────┘            │
│                                                                 │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ Wallet          │───────────▶│ Module UTxO     │  NEW       │
│  │ (u-token + ADA) │            │ (~1.59 ADA +    │            │
│  └─────────────────┘            │  module token)  │            │
│                                  └─────────────────┘            │
│  MINTS                                                          │
│  ─────                           ┌─────────────────┐            │
│  module-policy:                  │ User Wallet     │            │
│  • +1 \{slt_hash\}              │ (u-token +      │            │
│                                  │  change)        │            │
│                                  └─────────────────┘            │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Inputs

InputTypeValidatorDescription
GovernanceScriptgovernance-validatorSpent to verify teacher authorization
Access TokenWallet-Teacher's u-token
Wallet UTxOsWallet-ADA for fees/deposits

Outputs

OutputValidatorValueDescription
Governancegovernance-validatorlovelace + tokenReturned unchanged
Module UTxOmodule-validator~1.59 ADA + module tokenNew module (per mint)
User Walletwalletu-token + changeAccess token returned

Minting Operations

PolicyToken NameQuantityDescription
module-policy{slt_hash}+1Module token (name = hash of SLT list)

Module Token Naming

The module token name is a 32-byte hash computed from the SLT strings:

Input:  ["I can mint an access token.", "I can complete an assignment."]
Output: 8dcbe1b925d87e6c547bbd8071c23a712db4c32751454b0948f8c846e9246b5c

The redeemer contains the full SLT text - the hash is computed on-chain.

Module Datum

Constructor 0:
├── course_id: "\{course_id\}"
├── allowed_course_state_ids: []
└── prereq_slt_hashes: []

Reference Inputs

UTxODescription
LocalStateTokenCourse's LocalStateToken (contains validator script_ref)

Key Notes

  • Governance is spent (not just referenced) to verify teacher authorization
  • No protocol fee for module management
  • Module deposits are recoverable when modules are burned
  • Teacher must be listed in the governance datum

See Also