Andamio LogoAndamio
Protocol/Protocol V2/Transactions/Course/Student/Assignment

Assignment Update

Update an existing assignment submission

Course Student Assignment Update

Update an existing assignment submission with new information while keeping the same SLT hash commitment.

API Endpoint

POST /v2/tx/course/student/assignment/update

Cost Summary

Cost TypeAmountNotes
Transaction Fee~0.27 ADANetwork fee
MinUTxO Delta~0.06 ADAIf datum grows
Protocol Fee0 ADANo service fee
Total Wallet Delta~0.33 ADAMay vary with datum size

The minUTxO increases when the datum grows (longer assignment_info string).

Request Body

{
  "alias": "student_001",
  "course_id": "e276a1f2729f06036299998f046765ffdde7ad8fd47f689690fbe2b1",
  "slt_hash": "10dde6f0936b3dba3339356838e59b1af0f511a777a8701c49d941351b3abcf0",
  "assignment_info": "updated assignment evidence hash"
}
FieldTypeRequiredDescription
aliasstringYesStudent's access token alias
course_idstringYesCourse NFT policy ID (56 char hex)
slt_hashstringYesModule token name (must match current commitment)
assignment_infostringYesUpdated evidence hash or description

Transaction Pattern

Spend and Recreate - No minting. Consumes and recreates course state UTxO with updated datum.

┌─────────────────────────────────────────────────────────────────┐
│                 ASSIGNMENT UPDATE TRANSACTION                   │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  INPUTS                          OUTPUTS                        │
│  ──────                          ───────                        │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ Course State    │───────────▶│ Course State    │            │
│  │ (current        │  SPEND     │ (UPDATED        │            │
│  │  submission)    │            │  submission)    │            │
│  └─────────────────┘            └─────────────────┘            │
│                                                                 │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ Wallet          │───────────▶│ User Wallet     │            │
│  │ (u-token + ADA) │            │ (u-token +      │            │
│  └─────────────────┘            │  change)        │            │
│                                  └─────────────────┘            │
│  NO MINTING                                                     │
│                                                                 │
│  REFERENCE INPUTS                                               │
│  ────────────────                                               │
│  • global-state-v2 script ref                                   │
│  • LocalStateToken (course validator)                           │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Inputs

InputTypeValidatorDescription
Course StateScriptcourse-state-validatorStudent's course state (spent)
Access TokenWallet-Student's u-token
Wallet UTxOsWallet-ADA for fees

Outputs

OutputValidatorValueDescription
Course Statecourse-state-validator~1.50 ADA + tokenUpdated assignment info
User Walletwalletu-token + changeAccess token returned

Datum Changes

Only the assignment_info field changes - the SLT hash and completed_modules remain the same:

Before:

Constructor 1:
├── slt_hash: "{module_token_name}"
├── assignment_info: "original info"
└── completed_modules: []

After:

Constructor 1:
├── slt_hash: "{module_token_name}"
├── assignment_info: "updated assignment info"
└── completed_modules: []

Redeemers

ScriptConstructorFieldsDescription
course-state-validator (spend)1slt_hash, assignment_infoUpdate action
{
  "constructor": 1,
  "fields": [
    { "bytes": "<slt_hash>" },
    { "bytes": "<new_assignment_info>" }
  ]
}

Note: The redeemer is a flat constructor 1 with two fields, NOT a nested structure.

Reference Inputs

UTxODescription
Script Refglobal-state-v2 script reference
LocalStateTokenCourse's LocalStateToken (validator script_ref)

Key Notes

  • SLT hash is unchanged between input and output
  • Datum stays as constructor 1 (active commitment state)
  • MinUTxO increases when assignment_info grows (student pays the difference)
  • No protocol fee for assignment updates
  • Student must own the course state token being updated

See Also