Andamio LogoAndamio
Protocol/Protocol V2/Transactions/Course/Owner/Teachers

Teachers Manage

Add or remove teachers from a course

Course Owner Teachers Manage

Add or remove teachers from a course by updating the governance datum.

API Endpoint

POST /v2/tx/course/owner/teachers/manage

Cost Summary

Cost TypeAmountNotes
Transaction Fee~0.30 ADANetwork fee
Protocol Fee10 ADAFee to instance treasury
MinUTxO DeltavariableIncreases if adding teachers
Total Wallet Delta~10.3 ADAAdding 1 teacher

Request Body

{
  "alias": "james",
  "course_id": "68396f1567f5b8d813517b82e1b07e62b4d61392621d916fa5dac3e7",
  "teachers_to_add": ["newteacher"],
  "teachers_to_remove": []
}
FieldTypeRequiredDescription
aliasstringYesOwner's access token alias
course_idstringYesCourse NFT policy ID (56 char hex)
teachers_to_addstring[]YesAliases to add (empty = none)
teachers_to_removestring[]YesAliases to remove (empty = none)

Transaction Pattern

Spend and Recreate - No minting. Consumes and recreates UTxOs with updated datum.

┌─────────────────────────────────────────────────────────────────┐
│                  TEACHERS MANAGE TRANSACTION                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  INPUTS                          OUTPUTS                        │
│  ──────                          ───────                        │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ LocalStateNFT   │───────────▶│ LocalStateNFT   │            │
│  │ (course NFT)    │  SPEND     │ (unchanged)     │            │
│  └─────────────────┘            └─────────────────┘            │
│                                                                 │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ Governance      │───────────▶│ Governance      │            │
│  │ (teacher list)  │  SPEND     │ (UPDATED list)  │            │
│  └─────────────────┘            └─────────────────┘            │
│                                                                 │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ Wallet          │───────────▶│ Instance        │  10 ADA    │
│  │ (u-token + ADA) │            │ Treasury        │            │
│  └─────────────────┘            └─────────────────┘            │
│                                                                 │
│  NO MINTING                      ┌─────────────────┐            │
│  NO OBSERVERS                    │ User Wallet     │            │
│                                  │ (u-token +      │            │
│                                  │  change)        │            │
│                                  └─────────────────┘            │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Inputs

InputTypeValidatorDescription
LocalStateNFTScriptlocal-state-nft-validatorCourse NFT (spent with courseId redeemer)
GovernanceScriptgovernance-validatorGovernance UTxO (spent to update)
Access TokenWallet-Owner's u-token for authorization
Wallet UTxOsWallet-ADA for fees

Outputs (4)

OutputValidatorValueDescription
LocalStateNFTlocal-state-nft-validator~1.24 ADA + NFTRecreated unchanged
Governancegovernance-validator~1.36 ADA + tokenUpdated teacher list
Instance Feeinstance-treasury10 ADAProtocol fee
User Walletwalletu-token + changeAccess token returned

Datum Changes

The governance datum is updated:

Before:

Constructor 0:
└── teachers: ["james"]

After:

Constructor 0:
└── teachers: ["james", "newteacher"]

Redeemers

Both script inputs use the courseId as the redeemer data:

ScriptRedeemer
local-state-nft-validator{ bytes: "<courseId>" }
governance-validator{ bytes: "<courseId>" }

Key Notes

  • No observer needed (direct spend validation)
  • MinUTxO may increase if adding many teachers (larger datum)
  • 10 ADA fee per management operation
  • Owner is identified by their access token

See Also