Andamio Logo
Protocol/Protocol V2

Andamio Protocol

The four-layer on-chain model behind Andamio credentials — and the transaction lifecycle every Andamio app shares.

Andamio is a set of deployed Cardano smart contracts that issue and verify credentials. You don't have to build on the protocol directly — the API handles transaction building, signing flows, and state sync for you. This section explains what the protocol does underneath so you can reason about what your app is anchoring on-chain.

Three pages cover it:

  • This page — the four-layer model and the transaction lifecycle every Andamio transaction shares.
  • Validators — the 12 on-chain validators and the actions each authorizes, generated from the compiled contracts so it can't drift.
  • Transaction sequences — interactive walkthroughs of the workflows that issue a credential, from onboarding to claim.

The four-layer model

Andamio's on-chain state is organized into four nested layers. Each layer governs who can act on the layer below it.

LayerWhat it holdsWhat it governs
Global registryA person's on-chain identity (their Access Token) and the registry of local states attached to itWho exists in the protocol and what credentials/commitments they carry
InstancesOrganization-level governanceWho is allowed to create and administer courses and projects
CourseCourse modules, enrollments, assignment commitments, and assessmentsThe learn-and-earn loop that issues a course credential
ProjectProject tasks, treasury funds, and contributor commitmentsThe contribute-and-earn loop that issues a project credential

Course and Project are deliberately symmetric — both run a five-beat loop (create → populate → commit → assess → claim). The transaction sequences make that symmetry concrete.

Two design patterns worth knowing

Hash on-chain, data off-chain

Andamio stores hashes on the blockchain, not raw data:

On-chain:  assignment_info: "sha256:abc123def456..."
Off-chain: evidence: { url: "https://...", text: "My submission notes" }
AspectOn-chainOff-chain
StoredCommitment hash (32 bytes)Full evidence payload
CostMinimal (~0.02 ADA)Database storage
PrivacyPublic but opaqueAccess-controlled
VerifiabilityAnyone can verifyHash proves integrity

The chain holds a small, fixed-size commitment; the raw evidence (URLs, text, files) never touches it. Anyone can later prove that a piece of off-chain evidence matches its on-chain hash — that's what makes a credential verifiable without exposing private work.

Check–Effect–Interact (CEI)

Every Andamio transaction follows a layered CEI pattern across the client and the gateway:

PhaseClientGateway
CheckValidate paramsValidate eligibility, balances, permissions
EffectSign transaction in walletConfirm transaction on-chain
InteractSubmit to blockchainSync state to the database

The client never writes to the database directly — the gateway syncs state only after on-chain confirmation. The blockchain stays the source of truth.

The transaction lifecycle

Every Andamio transaction — minting an Access Token, committing to an assignment, claiming a credential — moves through the same six steps. The transaction sequences link here rather than repeating this, so learn it once:

StepWhoWhat happens
BuildAPI / gatewayBuilds an unsigned transaction (CBOR) from your request
SignUser's walletThe user approves and signs in their browser wallet (CIP-30)
SubmitUser's walletThe signed transaction is submitted to Cardano
RegisterYour appCalls the registration endpoint with the transaction hash and type
ConfirmGateway (automatic)Polls the chain until the transaction is on-chain
UpdateGateway (automatic)Syncs the confirmed on-chain state into the Andamio database

confirmed is not the finish line. The gateway reaches confirmed when the transaction is found on-chain, but the database hasn't synced yet. Wait for updated before you refetch data — only then is the off-chain state fresh.

You build the UX; Andamio handles the credential. For the request/response details and code, see the API docs.

Where to go next