alderconfidential DA on Solana
Reference

REST and SSE API

Complete HTTP and Server-Sent Events API reference from @alder/contract v0.3.0, including endpoints, auto-attestation, SSE envelope, and error codes.

The Alder backend exposes a Hono HTTP and SSE API defined by @alder/contract (0.3.0) and documented in backend/contract/openapi.json. All u64 integer values (lamports, byte totals) are serialized as base-10 strings (U64) to preserve 64-bit precision in JSON.

Base URL and Typed Client

ts
import { createClient } from '@alder/contract'

const api = createClient('http://127.0.0.1:42102')
const telemetry = await api.telemetry()

In localnet development, fixture preview routes are mounted under /fixture/v1/* and accept an optional X-Fixture header (empty, waiting, dropped_cell, or any error code). Outside localnet, /fixture/* is disabled.

Health and Network Telemetry

MethodPathClient MethodResponse Schema
GET/healthapi.health()HealthResponse (status, mode, cluster, programId, slot?, attestedBlobs?, activeNodes?)
GET/v1/network/telemetryapi.telemetry()NetworkTelemetry (nullable latestSlot, medianFinalityMs, medianMultiproofVerifyMs when unmeasured; blob counts, bonded lamports, challenge counts, protocol config, fee totals, aldrLaunchWallet, aldrMint, aldrTotalBurned, asOf)

Blobs, Sampling, Reconstruction, and Viewing Keys

MethodPathClient MethodRequest / QueryResponse Schema
GET/v1/blobsapi.listBlobs(query)limit, cursor, status (`Pending \Available \Expired \Cancelled), policyId, publisher`BlobsPage (items: BlobSummary[], nextCursor)
GET/v1/blobs/:idapi.getBlob(id)Path idBlobDetail (summary + rowCommitments, colCommitments, encryptionAlg, nonceBase64, custody, recentSamples, challenges)
POST/v1/blobs/anchor/buildapi.buildAnchorBlob(body)AnchorBlobBuildRequest (verifies cell hashes, <= 512B, Merkle root, and 2D RS codeword; stages unsigned cells in expiring StagedBlob)TxBuildResponse (unsigned v0 anchor_blob tx + feeLamports, blobId, blobPda)
POST/v1/blobs/:id/attestapi.attestBlob(id, body){ anchorSignature? } (internal operator route; normal publishes auto-attest inside /v1/transactions/submit)AttestBlobResponse (blob, attestationSlot, attestationLatencyMs, quorumNodes, signature)
POST/v1/blobs/:id/cancel/buildapi.buildCancelBlob(id, body){ publisher }TxBuildResponse (unsigned v0 cancel_blob tx)
POST/v1/blobs/:id/sampleapi.sampleBlob(id, body){ sampleCount?: 1..64, coordinates?, blindedSalt? }SampleBlobResponse (receipt, commitmentRoot, k, n, retentionDepth, sampledCells, missingCells, multiproof, plaintextExposed: false)
GET/v1/blobs/:id/cellsapi.getBlobCells(id)Path idReconstructCellsResponse (blobId, commitmentRoot, k, n, payloadSizeBytes, encryptionAlg, nonceBase64, rowCommitments, colCommitments, cells)
GET/v1/blobs/:id/viewing-keysapi.listViewingKeys(id)Path idViewingKeysListResponse (blobId, items: ViewingKeyEnvelope[])
POST/v1/blobs/:id/viewing-keysapi.createViewingKey(id, body){ issuer, auditorPubkey, scope?, wrappedKeyBase64, expiresAt? } (requires SIWS Authorization: Bearer <token> matching blob.publisher outside localnet)ViewingKeyEnvelope

DA Nodes

MethodPathClient MethodRequest / QueryResponse Schema
GET/v1/nodesapi.listNodes(query)limit, cursorNodesPage (items: DaNodeSummary[], nextCursor)
POST/v1/nodes/register/buildapi.buildRegisterNode(body){ operator, endpoint, bondLamports, region? }TxBuildResponse (unsigned v0 register_node tx + nodePda)
POST/v1/nodes/:operator/top-up/buildapi.buildTopUpBond(operator, body){ operator, amountLamports }TxBuildResponse (unsigned v0 top_up_bond tx)
POST/v1/nodes/:operator/withdraw/buildapi.buildWithdrawBond(operator, body){ operator, amountLamports }TxBuildResponse (unsigned v0 withdraw_bond tx)
POST/v1/nodes/:operator/claim/buildapi.buildClaimNodeFees(operator, body){ operator }TxBuildResponse (unsigned v0 claim_node_fees tx)
POST/v1/nodes/:operator/simulate-dropapi.setNodeSimulateDrop(operator, body){ enabled: boolean } (localnet only)SimulateDropResponse (operator, simulatedDropEnabled)

Challenges

MethodPathClient MethodRequest / QueryResponse Schema
GET/v1/challengesapi.listChallenges(query)limit, cursorChallengesPage (items: ChallengeSummary[], nextCursor)
POST/v1/challenges/open/buildapi.buildOpenChallenge(body){ challenger, blobId, nodeOperator, row, col }TxBuildResponse (unsigned v0 open_challenge tx + challengePda, challengeId)
POST/v1/challenges/:id/respond/buildapi.buildRespondChallenge(id, body){ nodeOperator, cellDataBase64, merkleProof? }TxBuildResponse (unsigned v0 respond_challenge tx)
POST/v1/challenges/:id/slash/buildapi.buildSlashNode(id, body){ caller }TxBuildResponse (unsigned v0 slash_node tx)

Transactions and Real-Time SSE Stream

MethodPathClient MethodDescription
POST/v1/transactions/submitapi.submitTransaction(body)Submits { id, signedTransactionBase64?, signature? }, verifies confirmed on-chain program ID, accounts, instruction bytes, and signature uniqueness (TxRecord.signature @unique), and for anchor_blob automatically executes on-chain attest_availability, returning TxStatusResponse (status, signature, slot, confirmationMs, attestationSignature?, attestationSlot?, attestationLatencyMs?)
GET/v1/transactions/:idapi.getTransaction(id)Returns current TxStatusResponse
GET/v1/eventsapi.eventsUrl(blobId?)Server-Sent Events stream (?blobId=... optional filter)

SSE Envelope and Event Types

Every SSE data payload is wrapped in the standard envelope from backend/src/engines/server/sse.ts:

json
{
  "type": "blob.attested",
  "id": "evt_...",
  "timestamp": "2026-11-23T12:00:00.000Z",
  "data": {
    "blobId": "blob_...",
    "attestationSlot": 384912700,
    "attestationLatencyMs": 148,
    "signature": "..."
  }
}
Event typedata FieldsEmitted When
blob.anchored{ blobId, anchorSignature, anchorSlot }POST /v1/transactions/submit confirms an anchor_blob transaction on chain
blob.attested{ blobId, attestationSlot, attestationLatencyMs, signature }On-chain attest_availability confirms (auto-attested on submit or via /attest)
sample.verified{ blobId, confidencePct, verified }POST /v1/blobs/:id/sample completes
node.registered{ operator, nodePda, bondedLamports, signature }POST /v1/transactions/submit confirms a register_node transaction on chain
challenge.opened{ challengeId, blobId, nodeOperator, row, col, signature }POST /v1/transactions/submit confirms an open_challenge transaction on chain
challenge.slashed{ challengeId, nodeOperator, signature }POST /v1/transactions/submit confirms a slash_node transaction on chain

Error Envelope and Error Codes

Every failed HTTP response returns one strict JSON envelope:

json
{
  "error": {
    "code": "BLOB_NOT_AVAILABLE",
    "message": "Blob must be in Available status before sampling.",
    "retryable": false,
    "stage": "validation",
    "requestId": "req_..."
  }
}

stage is one of validation, auth, read, upload, build, wallet, co_sign, simulation, send, or confirmation. When a Solana transaction fails, programError carries { programId, name, number? }.

Domain Error Codes (@alder/contract)

CodeHTTP StatusMeaning
BLOB_NOT_AVAILABLE409Action requires Available blob status
NODE_BOND_INSUFFICIENT400Node bond below minNodeBondLamports
MULTIPROOF_INVALID422Merkle DAS verification failed
BLOB_EXPIRED409Blob passed expirySlot (contract / fixture scenario code)
CELL_MISSING404Requested coded cell unavailable (contract / fixture scenario code)
CHALLENGE_ALREADY_OPEN409Challenge PDA already open (contract / fixture scenario code)
CHALLENGE_WINDOW_ACTIVE409Challenge deadline slot active (contract / fixture scenario code)
INSUFFICIENT_CELLS422Insufficient cells to decode (contract / fixture scenario code)

Base API Error Codes

CodeHTTP StatusCodeHTTP Status
VALIDATION_ERROR400UNSUPPORTED_MEDIA_TYPE415
UNAUTHORIZED401SIMULATION_FAILED422
ORIGIN_NOT_ALLOWED403CHAIN_REFUSED422
NOT_FOUND404RATE_LIMITED429
PROGRAM_UNAVAILABLE409INTERNAL_ERROR500
CONFIGURATION_REQUIRED409UPSTREAM_UNAVAILABLE502
IDEMPOTENCY_CONFLICT409TRANSACTION_EXPIRED409
PAYLOAD_TOO_LARGE413

Next Steps