Andamio Logo
Developer Guides/Andamio CLI

Hash Verification

Compute and verify Blake2b-256 hashes for courses and tasks from the command line

Hash Verification

The CLI can compute and verify the content-addressing hashes that Andamio uses on-chain. These are Blake2b-256 hashes matching the Plutus validator implementation — useful for diagnostics, CI/CD pipelines, and verifying data integrity.

Course Credential Hashes

Compute Hash Locally

Compute a Blake2b-256 hash from SLT data without making any API calls:

# From individual SLT flags
andamio course credential compute-hash \
  --slt "I can explain contribution-centered learning" \
  --slt "I can install the Andamio CLI"

# From a file containing SLTs
andamio course credential compute-hash --file slts.json

This outputs the hash that the Plutus validator would compute for these SLTs. No authentication required — the computation is purely local.

Verify Against API

Compare locally computed hashes against API-stored values:

andamio course credential verify-hash <course-id>
andamio course credential verify-hash <course-id> --output json

This fetches all modules for the course, computes their hashes locally, and reports any mismatches. Useful for diagnosing issues where on-chain hashes don't match expectations.

Task Hashes

Compute Hash Locally

Compute a task hash from its content components:

# From flags
andamio project task compute-hash \
  --content "Implement user dashboard" \
  --lovelace 50000000 \
  --expiration 1720000000

# With native asset rewards
andamio project task compute-hash \
  --content "Implement user dashboard" \
  --lovelace 50000000 \
  --expiration 1720000000 \
  --token "policyid,ASSETNAME,1000"

# From a file
andamio project task compute-hash --file task.json

The hash is computed from the Plutus Data CBOR encoding of content, expiration, lovelace, and native assets — matching exactly what the on-chain validator computes.

Verify Against API

Compare locally computed hashes against all tasks in a project:

andamio project task verify-hash <project-id>
andamio project task verify-hash <project-id> --output json

Reports any hash mismatches between the API record and the locally computed value.

When to Use These Commands

ScenarioCommand
Verify module content hasn't been tampered withcourse credential verify-hash
Debug a credential claim that fails validationcourse credential compute-hash + compare
Verify task rewards match on-chain dataproject task verify-hash
Pre-compute hashes in CI before publishingcompute-hash (no auth needed)
Diagnose hash mismatches after task creationproject task verify-hash

Next Steps