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

Credential Claim

Claim credential by burning course state token

Course Student Credential Claim

Claim a credential by burning the course state token after completing assignments. The credential hash is stored permanently in the student's global state.

API Endpoint

POST /v2/tx/course/student/credential/claim

Cost Summary

Cost TypeAmountNotes
Transaction Fee~0.34 ADANetwork fee
Deposit Refund~-1.38 ADABurned course state releases deposit
Protocol Fee0 ADANo service fee
Total Wallet Delta-1.03 ADAStudent gains ADA

The student gains ADA because the burned course state UTxO releases its locked deposit.

Request Body

{
  "alias": "student_001",
  "course_id": "e276a1f2729f06036299998f046765ffdde7ad8fd47f689690fbe2b1"
}
FieldTypeRequiredDescription
aliasstringYesStudent's access token alias
course_idstringYesCourse NFT policy ID (56 char hex)

Transaction Pattern

Burn and Update - Burns course state token, updates global state with credential hash.

┌─────────────────────────────────────────────────────────────────┐
│                  CREDENTIAL CLAIM TRANSACTION                   │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  INPUTS                          OUTPUTS                        │
│  ──────                          ───────                        │
│  ┌─────────────────┐                                            │
│  │ Course State    │ ─── BURNED (no output)                     │
│  │ (completed)     │                                            │
│  └─────────────────┘                                            │
│                                                                 │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ Global State    │───────────▶│ Global State    │            │
│  │ (enrollment     │  SPEND     │ (CREDENTIAL     │            │
│  │  hash)          │            │  hash)          │            │
│  └─────────────────┘            └─────────────────┘            │
│                                                                 │
│  ┌─────────────────┐            ┌─────────────────┐            │
│  │ Wallet          │───────────▶│ User Wallet     │            │
│  │ (u-token + ADA) │            │ (u-token +      │            │
│  └─────────────────┘            │  change +       │            │
│                                  │  REFUND)        │            │
│  BURNS                           └─────────────────┘            │
│  ─────                                                          │
│  course-state-policy:                                           │
│  • -1 \{student_alias\}                                         │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Inputs

InputTypeValidatorDescription
Course StateScriptcourse-state-validatorStudent's course state (burned)
Global StateScriptglobal-state-v2Student's global state (spent to update)
Access TokenWallet-Student's u-token
Wallet UTxOsWallet-ADA for fees

Outputs (2)

OutputValidatorValueDescription
Global Stateglobal-state-v2~1.84 ADA + g-tokenUpdated with credential hash
User Walletwalletu-token + change + ~1.03 ADARefund from burned UTxO

Minting Operations (Burn)

PolicyToken NameQuantityPurpose
course-state-policy{student_alias}-1Course state token is burned

Global State Datum Update

The local_state_information map value changes from enrollment_hash to credential_hash:

Before:

Constructor 0:
├── alias: "student_001"
└── local_state_information: Map
    └── \{course_id\}: \{enrollment_hash\}

After:

Constructor 0:
├── alias: "student_001"
└── local_state_information: Map
    └── \{course_id\}: \{credential_hash\}

The credential hash proves course completion and is permanently stored on-chain.

Redeemers (3)

Three redeemers are used in this transaction:

Course State (Spend) - Constructor 3 = burn/claim:

{ "constructor": 3, "fields": [] }

Global State (Spend) - Constructor 1 with flag=0:

{
  "constructor": 1,
  "fields": [
    { "bytes": "<course_id>" },
    { "int": 0 },
    { "bytes": "" },
    { "bytes": "<course_state_policy>" },
    { "bytes": "<credential_hash>" }
  ]
}

Course State Policy (Mint/Burn) - Constructor 4:

{
  "constructor": 4,
  "fields": [
    { "bytes": "<student_alias>" },
    { "list": [{ "bytes": "<completed_slt_hash>" }] }
  ]
}

Reference Inputs

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

Key Notes

  • Course state token is burned (negative mint quantity)
  • Credential hash is stored permanently in global state
  • Completed SLTs list in mint redeemer allows on-chain verification
  • Student gets net ADA gain (~1.03 ADA) from released deposit
  • No protocol fee for credential claims
  • This completes the student's course journey

Student Journey Complete

┌──────────────────────────────────────────────────────────────────┐
│                     STUDENT COURSE JOURNEY                       │
├──────────────────────────────────────────────────────────────────┤
│                                                                  │
│  assignment/commit ──▶ assignment/update ──▶ (teacher assesses)  │
│        │                     │                      │            │
│        ▼                     ▼                      ▼            │
│  ┌───────────┐        ┌───────────┐         ┌───────────┐       │
│  │ Enroll +  │        │ Update    │         │ Accept/   │       │
│  │ Commit    │        │ Evidence  │         │ Refuse    │       │
│  └───────────┘        └───────────┘         └───────────┘       │
│                                                    │             │
│                              ┌─────────────────────┘             │
│                              ▼                                   │
│                       credential/claim                           │
│                              │                                   │
│                              ▼                                   │
│                       ┌───────────┐                              │
│                       │ Burn      │                              │
│                       │ Course    │                              │
│                       │ State     │                              │
│                       │ +1.03 ADA │                              │
│                       └───────────┘                              │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘

See Also