Task Commit
Enroll in a project and commit to a task
Project Contributor Task Commit
Enroll in a project (if not already enrolled) and commit to a task. This transaction combines enrollment with task commitment, similar to how course enrollment now requires assignment commitment.
API Endpoint
POST /v2/tx/project/contributor/task/commitCost Summary
| Cost Type | Amount | Notes |
|---|---|---|
| Transaction Fee | ~0.51 ADA | Network fee |
| Protocol Fee | 0 ADA | No service fee |
| Contributor State Deposit | ~14.5 ADA | Holds enrollment data (from escrow) |
Request Body
{
"alias": "student_001",
"project_id": "3b20d771fff69738127691ec3aea3803cdae1b1292ed1e1ca62a5f30",
"contributor_state_id": "c69d2d5d5889edda8aa30550c340303ff7c9e74dd01c028528e24495",
"task_hash": "33668fb12ca84cb6676e84a29aaa1a7bee46f156c7c2a88f86ad400e829e34cb",
"task_info": "Some task completion info."
}| Field | Type | Required | Description |
|---|---|---|---|
alias | string | Yes | Contributor's access token alias |
project_id | string | Yes | Project NFT policy ID (56 char hex) |
contributor_state_id | string | Yes | Contributor state policy ID (from project prerequisites) |
task_hash | string | Yes | Hash of the task to commit to (64 char hex) |
task_info | string | Yes | Evidence/info for the task submission |
Transaction Pattern
Mint, Update Global State, and Commit with Observer - This is the project equivalent of course enrollment.
+---------------------------------------------------------------------+
| TASK COMMIT TRANSACTION |
+---------------------------------------------------------------------+
| |
| INPUTS OUTPUTS |
| ------ ------- |
| +------------------+ +------------------+ |
| | Global State V2 |------------>| Global State V2 | |
| | (g-token + datum | SPEND | (updated creds | |
| | with cred map) | | map with proj) | |
| +------------------+ +------------------+ |
| |
| +------------------+ +------------------+ |
| | Task Escrow |------------>| Task Escrow | |
| | (treasury-token | SPEND | (updated task | |
| | + task hashes) | | hash list) | |
| +------------------+ +------------------+ |
| |
| +------------------+ +------------------+ |
| | Task Deposit |------------>| Contributor | NEW OUTPUT |
| | (escrow deposit) | SPEND | State | |
| +------------------+ | (with task | |
| | commitment) | |
| +------------------+ +------------------+ |
| | Wallet | |
| | (u-token + ADA) | +------------------+ |
| +------------------+ | User Wallet | |
| | (u-token + | |
| MINTS: contributor-state-token | change) | |
| -------------------------------- +------------------+ |
| Token name = contributor alias |
| |
| OBSERVER VALIDATION |
| ------------------- |
| task-commit-observer validates commitment operation |
| |
+---------------------------------------------------------------------+Critical Design: On first enrollment, this transaction MINTS a contributor-state token. The mint redeemer includes prerequisite verification (proof that the contributor holds required course credentials).
Key Concepts
Prerequisites: contributor_state_id
The contributor_state_id defines the credential a contributor must hold. Rather than listing individual SLT hashes, this single policy ID encapsulates "has completed course X" - the on-chain logic verifies they hold the appropriate course-state credential.
Global State Update
The global-state-v2 UTxO is spent and recreated with the project credential added to the contributor's credentials map. The redeemer flag = -1 indicates an enrollment action.
Contributor State Datum
The contributor-state token is held in a validator with a datum describing the commitment:
- Constructor 0: No active commitment (just enrolled, completed_tasks list)
- Constructor 1: Has active commitment (task_definition + task_info + completed_tasks)
This is analogous to course-state datum structure.
Parameterized Validators
Both task-escrow-validator and contributor-state-validator addresses vary per project. The stake credential remains the same, but payment credentials differ based on project parameters.
Prerequisite Verification
The mint redeemer includes prerequisite proof:
- List of
{courseId, completed_slts, metadata}entries - Map of
courseId -> completed_slts
This proves the contributor has the required course credentials.
Inputs
| Input | Type | Validator | Description |
|---|---|---|---|
| Global State V2 | Script | global-state-v2 | Contributor's global state UTxO |
| Task Escrow | Script | task-escrow-validator | Task escrow with available tasks |
| Task Deposit | Script | task-escrow-validator | Deposit UTxO for contributor-state creation |
| Access Token | Wallet | - | Contributor's u-token |
| Wallet UTxOs | Wallet | - | ADA for fees |
Outputs
| Output | Validator | Value | Description |
|---|---|---|---|
| Global State V2 | global-state-v2 | g-token + ~2 ADA | Updated credentials map |
| Contributor State | contributor-state-validator | contributor-state-token + ~14.5 ADA | NEW - holds task commitment |
| Task Escrow | task-escrow-validator | treasury-token + ~5 ADA | Updated task list |
| User Wallet | wallet | u-token + change | Access token returned |
Mints
| Policy | Token | Quantity | Description |
|---|---|---|---|
| contributor-state-policy | {alias} | 1 | Contributor state token (first enrollment only) |
Observer Validation
The task-commit-observer validates the commitment operation:
Redeemer: {
constructor: 0,
fields: [
"student_001", // alias
{ // task_definition
project_content: "...",
expiration_time: 1234567890000,
lovelace_amount: 5000000,
native_assets: []
},
[], // empty list
"Some task completion info." // task_info
]
}Key Notes
- Mints on first enrollment - Contributor-state token minted only on first project enrollment
- No protocol fee - Only network transaction fee applies
- Combined enrollment + commit - Cannot enroll without committing to a task
- Parameterized validators - Addresses vary per project
See Also
- Tasks Manage - Create and manage project tasks
- Project Create - Create a new project
- Assignment Commit - Analogous course transaction