Andamio Logo
Protocol/Protocol V2/Transactions/Project/Contributor/Credential

Credential Claim

Claim project credential by burning contributor state token

Project Contributor Credential Claim

Claim a project credential by burning the contributor state token. This permanently records the credential hash in the contributor's global state and releases the enrollment deposit.

API Endpoint

POST /v2/tx/project/contributor/credential/claim

Cost Summary

Cost TypeAmountNotes
Transaction Fee~0.35 ADANetwork fee
Protocol Fee1 ADATo instance treasury
Net Result~13+ ADA GAINDeposit released minus fees

Request Body

{
  "alias": "student_001",
  "project_id": "3b20d771fff69738127691ec3aea3803cdae1b1292ed1e1ca62a5f30",
  "contributor_state_id": "c69d2d5d5889edda8aa30550c340303ff7c9e74dd01c028528e24495"
}
FieldTypeRequiredDescription
aliasstringYesContributor's access token alias
project_idstringYesProject NFT policy ID (56 char hex)
contributor_state_idstringYesContributor state policy ID

Transaction Pattern

Burn Token, Update Global State - Burns the contributor-state token and records credential permanently.

+---------------------------------------------------------------------+
|                   CREDENTIAL CLAIM TRANSACTION                       |
+---------------------------------------------------------------------+
|                                                                      |
|  INPUTS                           OUTPUTS                            |
|  ------                           -------                            |
|  +------------------+             +------------------+               |
|  | Global State V2  |------------>| Global State V2  |               |
|  | (g-token + creds |   SPEND     | (updated creds   |               |
|  |  map placeholder)|             |  map with hash)  |               |
|  +------------------+             +------------------+               |
|                                                                      |
|  +------------------+             +------------------+               |
|  | Contributor      |             | Instance         |               |
|  | State            |   BURNED    | Treasury         |               |
|  | (~14.5 ADA       |   ------>   | (1 ADA fee)      |               |
|  |  + state token)  |             +------------------+               |
|  +------------------+                                                |
|                                   +------------------+               |
|  +------------------+             | User Wallet      |               |
|  | Wallet           |------------>| (u-token +       |               |
|  | (u-token)        |             |  deposit refund) |               |
|  +------------------+             +------------------+               |
|                                                                      |
|  MINTS: contributor-state-token BURNED (quantity = -1)               |
|  -------------------------------------------------                   |
|  Token name = contributor alias                                      |
|  Releases enrollment deposit to contributor                          |
|                                                                      |
+---------------------------------------------------------------------+

Critical Design: The contributor-state token is BURNED (negative mint quantity), releasing the ~14.5 ADA enrollment deposit back to the contributor.

Key Concepts

Credential Hash

Upon claiming, a credential hash is computed from the completed tasks and permanently stored in the global state credentials map:

Before: { projectId -> (placeholder) }
After:  { projectId -> "e2792989258790b5898422733742a7a94dfa942e41e718e5d41e5deb50eb2bc8" }

This hash serves as permanent, on-chain proof of project completion.

Token Burning

The contributor-state token is burned with a redeemer that includes:

  • Contributor alias
  • List of completed tasks (proof of work)
Mint Redeemer: {
  constructor: 3,
  fields: [
    "student_001",           // alias
    [                        // completed_tasks
      { content: "", meta: "", lovelace: 12500000 }
    ]
  ]
}

Net Wallet Gain

Despite the fees, the contributor gets a net gain:

  • Contributor state deposit released: ~14.5 ADA
  • Minus transaction fee: ~0.35 ADA
  • Minus protocol fee: 1 ADA
  • Net gain: ~13+ ADA

Protocol Fee

Unlike task-commit and tasks-assess which have no protocol fee, credential claim charges 1 ADA to the instance treasury. This is the same treasury that receives course and project creation fees.

Inputs

InputTypeValidatorDescription
Access TokenWallet-Contributor's u-token
Global State V2Scriptglobal-state-v2Contributor's global state UTxO
Contributor StateScriptcontributor-state-validatorState UTxO to be burned

Outputs

OutputValidatorValueDescription
User Walletwalletu-token + ~1 ADAAccess token returned
Global State V2global-state-v2g-token + ~2 ADAUpdated with credential hash
Instance Treasurywallet1 ADAProtocol fee
User Walletwallet~13+ ADAReleased deposit (change)

Mints (Burns)

PolicyTokenQuantityDescription
contributor-state-policy{alias}-1Token BURNED

Redeemer Details

Global State Spend Redeemer

{
  constructor: 1,
  fields: [
    projectId,           // project policy ID
    0,                   // flag = 0 (credential claim)
    "",                  // empty
    contributor_state_id,// state policy ID
    credential_hash      // computed hash
  ]
}

Contributor State Spend Redeemer

{
  constructor: 1,    // claim action
  fields: []
}

Note: The contributor-state-validator uses constructor 1 for claim, while the mint policy uses constructor 3 for burn.

Reference Inputs

UTxODescription
957a855b...#1Script reference for contributor-state-policy
aae8f2e8...#2Script reference for global-state-v2

Key Notes

  • Burns token - Contributor-state token destroyed
  • 1 ADA protocol fee - Paid to instance treasury
  • Net gain - Contributor gets ~13+ ADA back
  • Permanent credential - Hash stored in global state forever
  • No observer - Direct validator logic (no withdrawal)

Complete Project Lifecycle Cost

TransactionRoleCostNotes
Task CommitContributor~0.51 ADA + ~14.5 ADA depositFirst enrollment
Tasks AssessManager~0.35 ADAPer assessment
Credential ClaimContributor~0.35 ADA + 1 ADA fee - 14.5 ADA depositNet gain ~13+ ADA
Total-~2.2 ADAManager + contributor combined

See Also