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/claimCost Summary
| Cost Type | Amount | Notes |
|---|---|---|
| Transaction Fee | ~0.34 ADA | Network fee |
| Deposit Refund | ~-1.38 ADA | Burned course state releases deposit |
| Protocol Fee | 0 ADA | No service fee |
| Total Wallet Delta | -1.03 ADA | Student gains ADA |
The student gains ADA because the burned course state UTxO releases its locked deposit.
Request Body
{
"alias": "student_001",
"course_id": "e276a1f2729f06036299998f046765ffdde7ad8fd47f689690fbe2b1"
}| Field | Type | Required | Description |
|---|---|---|---|
alias | string | Yes | Student's access token alias |
course_id | string | Yes | Course 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
| Input | Type | Validator | Description |
|---|---|---|---|
| Course State | Script | course-state-validator | Student's course state (burned) |
| Global State | Script | global-state-v2 | Student's global state (spent to update) |
| Access Token | Wallet | - | Student's u-token |
| Wallet UTxOs | Wallet | - | ADA for fees |
Outputs (2)
| Output | Validator | Value | Description |
|---|---|---|---|
| Global State | global-state-v2 | ~1.84 ADA + g-token | Updated with credential hash |
| User Wallet | wallet | u-token + change + ~1.03 ADA | Refund from burned UTxO |
Minting Operations (Burn)
| Policy | Token Name | Quantity | Purpose |
|---|---|---|---|
| course-state-policy | {student_alias} | -1 | Course 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
| UTxO | Description |
|---|---|
| Script Ref | global-state-v2 script reference |
| LocalStateToken | Course'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
- Assignment Commit - Initial enrollment
- Assignment Update - Update submission
- Assignments Assess - Teacher assessment