alderconfidential DA on Solana
Reference

alder_da Program

Complete Solana Anchor reference for alder_da v0.3.0: program ID, PDA seeds, 4 account structs, 15 instructions, 12 CPI events, and 33 error codes.

alder_da is the Solana Anchor program that anchors encrypted blob commitments, escrows and splits SOL availability fees, holds DA node SOL bonds, enforces Merkle-verified missing-cell challenges, and supports rent reclamation on closed records.

PropertyValue
Program IDEEQEMRSzNVrmMakBr1HJofNhEqYXSE3c7gJK3aoGeke1
Sourcebackend/program/programs/alder_da/src/lib.rs
Compiled SBF binarybackend/artifacts/alder_da.so (429,720 bytes, SBPF v0)
IDLbackend/src/idl/alder_da.json and backend/src/idl/alder_da.ts
Event emission#[event_cpi] / emit_cpi! via ["__event_authority"] PDA
Max cell size (MAX_CELL_BYTES)512 bytes (payload_size_bytes <= k^2 * 512)

PDA Seeds and Account Sizes

Every account size below includes the 8-byte Anchor discriminator (8 + INIT_SPACE). Rent-exempt balances are queried dynamically from the Rent sysvar (getMinimumBalanceForRentExemption).

AccountSeedsSize (bytes)
ProtocolConfig["protocol_config"]141
DaNode["da_node", operator.key()]126
BlobRecord["blob", publisher.key(), blob_id_hash]223
Challenge["challenge", blob.key(), node.key(), &[row, col]]132
Event Authority["__event_authority"]CPI signer PDA

Account Structs

ProtocolConfig (141 bytes)

FieldTypeDescription
authorityPubkeyProtocol admin and attestation authority (rotatable via update_protocol)
fee_recipientPubkeyReceives protocol SOL fee share, forfeited node fees, and 50% of slashed bonds (ALDR launch wallet)
protocol_fee_bpsu16Protocol share of availability fees in basis points (<= 5000)
min_node_bondu64Minimum SOL bond (lamports) required for an Active DA node
min_fee_per_byteu64Minimum on-chain availability fee rate per payload byte (lamports)
challenge_window_slotsu64Slots given to a challenged node to call respond_challenge (>= 10)
attestation_timeout_slotsu64Slots after anchor_slot before cancel_blob is allowed (>= 10)
slash_bpsu16Bond slash rate per missed challenge (1..5000 bps)
active_blob_countu64Active attested blob count (incremented on attest, decremented on expire_blob)
total_attested_bytesu64Cumulative attested ciphertext bytes
total_protocol_feesu64Cumulative SOL lamports routed to fee_recipient
total_node_feesu64Cumulative SOL lamports vested for DA nodes
bumpu8PDA bump seed

DaNode (126 bytes)

FieldTypeDescription
operatorPubkeyNode operator wallet
bonded_lamportsu64Active SOL security bond held in the PDA
endpoint_hash[u8; 32]SHA-256 hash of the operator's HTTPS endpoint URL
active_shard_countu32Active shard depth count (incremented on attest, decremented on expire_blob)
successful_attestationsu64Number of blobs attested by this node
slashed_countu32Number of times this node has been slashed
earned_fee_balanceu64Claimable SOL fees released after expire_blob
open_challenge_countu32Concurrent open challenges against this node (blocks withdraw_bond while > 0)
unbond_unlock_slotu64Earliest Solana slot at which withdraw_bond is permitted (extended to each attested blob's expiry_slot)
statusNodeStatusActive, Slashed, or Unbonding
registered_slotu64Solana slot at registration
bumpu8PDA bump seed

BlobRecord (223 bytes)

Light clients read commitment_root directly from Solana RPC at byte offset 72..104 (8 discriminator + 32 publisher + 32 blob_id_hash).

FieldTypeDescription
publisherPubkeyPublisher wallet
blob_id_hash[u8; 32]SHA-256 hash of the UTF-8 blobId string
commitment_root[u8; 32]32-byte TCDA matrix Merkle commitment root (bytes 72..104)
payload_size_bytesu32Ciphertext byte length (> 0 and <= k^2 * 512)
ku8Data matrix width (2..16)
nu8Coded matrix width (2 * k, 4..32)
retention_depthu8TCDA retention depth (1..4)
policy_id_hash[u8; 32]SHA-256 hash of the disclosure policyId
escrowed_feeu64Full SOL fee while Pending; vested node fee while Available; 0 once Expired or Cancelled
protocol_fee_bpsu16Snapshotted ProtocolConfig.protocol_fee_bps at anchor time
anchor_slotu64Slot when anchor_blob executed
attestation_deadline_slotu64Snapshotted anchor_slot + config.attestation_timeout_slots
attestation_slotu64Slot when attest_availability executed (0 while Pending)
expiry_slotu64anchor_slot + expiry_slots
attesting_nodePubkeyDaNode PDA that co-signed attestation (verified by open_challenge and expire_blob)
open_challenge_countu16Open challenges on this blob (blocks close_blob while > 0)
failed_challengesu16Slashed challenges on this blob (forfeits vested node fee on expire_blob if > 0)
statusBlobStatusPending, Available, Expired, or Cancelled
bumpu8PDA bump seed

Challenge (132 bytes)

FieldTypeDescription
challengerPubkeyVerifier wallet that opened the challenge
blobPubkeyBlobRecord PDA
nodePubkeyChallenged DaNode PDA
rowu8Missing cell row (< blob.n)
colu8Missing cell column (< blob.n)
opened_slotu64Slot when open_challenge executed
deadline_slotu64opened_slot + config.challenge_window_slots
slash_amountu64(node.bonded_lamports * config.slash_bps) / 10_000
statusChallengeStatusOpen, Resolved, or Slashed
bumpu8PDA bump seed

Instructions (All 15)

All instructions except close_blob and close_challenge carry two trailing accounts for Anchor #[event_cpi]: event_authority (["__event_authority"], readonly) and program (alder_da, readonly).

InstructionArgumentsSigner(s)Accounts (before event CPI)State Change
init_protocolfee_recipient: Pubkey, protocol_fee_bps: u16, min_node_bond: u64, min_fee_per_byte: u64, challenge_window_slots: u64, attestation_timeout_slots: u64, slash_bps: u16authority (INITIAL_DEPLOYER)authority (mut), config (init), system_programInitializes ProtocolConfig PDA (front-run guarded)
update_protocolnew_authority: Pubkey, fee_recipient: Pubkey, protocol_fee_bps: u16, min_node_bond: u64, min_fee_per_byte: u64, challenge_window_slots: u64, attestation_timeout_slots: u64, slash_bps: u16authorityauthority, config (mut)Rotates authority and updates protocol config for future blobs/challenges
register_nodeendpoint_hash: [u8; 32], bond_lamports: u64operatoroperator (mut), config, node (init), system_programTransfers bond_lamports to DaNode PDA, sets Active
top_up_bondamount_lamports: u64operatoroperator (mut), config, node (mut), system_programAdds bond; restores Active if >= min_node_bond
withdraw_bondamount_lamports: u64operatoroperator (mut), config, node (mut)Requires open_challenge_count == 0 and slot >= unbond_unlock_slot; debits PDA above rent + earned fees
anchor_blobblob_id_hash: [u8; 32], commitment_root: [u8; 32], payload_size_bytes: u32, k: u8, n: u8, retention_depth: u8, policy_id_hash: [u8; 32], expiry_slots: u64, fee_lamports: u64publisherpublisher (mut), config, blob (init), system_programEnforces payload_size_bytes <= k^2 * 512, fee_lamports >= min_fee, expiry_slots >= 10; snapshots protocol_fee_bps and attestation_deadline_slot
attest_availabilityattestation_root: [u8; 32]authority, operatorauthority, operator, config (mut), blob (mut), node (mut), fee_recipient (mut)Requires custodian operator co-signature; checks attestation_root == blob.commitment_root, slot < expiry_slot, and slot <= attestation_deadline_slot; routes protocol_fee to fee_recipient, vests node_fee in BlobRecord, sets attesting_node and unbond_unlock_slot
expire_blobnonepermissionlessconfig (mut), blob (mut), node (mut), fee_recipient (mut)Requires slot >= expiry_slot and blob.attesting_node == node.key(); releases vested node_fee to node.earned_fee_balance if blob.failed_challenges == 0, otherwise forfeits to fee_recipient; sets Expired and decrements active counts
close_blobnonepublisherpublisher (mut), blob (mut, close)Requires Expired or Cancelled, escrowed_fee == 0, and open_challenge_count == 0; returns rent to publisher
cancel_blobnonepublisherpublisher (mut), config, blob (mut)After attestation_deadline_slot, refunds escrowed_fee to publisher, sets Cancelled
open_challengerow: u8, col: u8challengerchallenger (mut), config, blob (mut), node (mut), challenge (init), system_programChecks Available, slot < expiry_slot, attesting_node == node.key(), challenger != node.operator, node Active or Slashed with bonded_lamports > 0; increments node.open_challenge_count and blob.open_challenge_count
respond_challengecell_data: Vec<u8>, merkle_proof: Vec<[u8; 32]>operatoroperator, node (mut), blob (mut), challenge (mut)Enforces 1..=512 byte cell_data and exact Merkle depth for blob.n * blob.n; verifies `SHA-256("alder:cell:v1:<row>:<col>:" \\cell_data) and Merkle inclusion against blob.commitment_root` on chain; resolves challenge and decrements both open challenge counts
slash_nodenonecallercaller, config, challenge (mut), blob (mut), node (mut), challenger (mut), fee_recipient (mut)After deadline_slot, slashes min(slash_amount, bonded_lamports) 50% to challenger and 50% to fee_recipient, increments blob.failed_challenges, decrements open challenge counts
close_challengenonechallengerchallenger (mut), challenge (mut, close)Closes Resolved or Slashed Challenge, returning rent to challenger
claim_node_feesnoneoperatoroperator (mut), node (mut)Transfers earned_fee_balance from DaNode PDA to operator

CPI Events

All 12 events are emitted via emit_cpi! so indexers decode them from inner instruction data (tag e445a52e51cb9a1d) without log truncation:

  • ProtocolInitialized: authority, fee_recipient, protocol_fee_bps, min_node_bond, min_fee_per_byte
  • ProtocolUpdated: authority, fee_recipient, protocol_fee_bps, min_node_bond, min_fee_per_byte, slash_bps
  • NodeRegistered: operator, node, bonded_lamports, endpoint_hash, slot
  • BondUpdated: operator, node, bonded_lamports
  • BlobAnchored: blob, publisher, blob_id_hash, commitment_root, payload_size_bytes, k, n, retention_depth, fee_lamports, anchor_slot, expiry_slot
  • BlobAttested: blob, node, attestation_root, attestation_slot, protocol_fee, node_fee
  • BlobExpired: blob, node, released_node_fee, slot
  • BlobCancelled: blob, publisher, refunded_lamports, slot
  • ChallengeOpened: challenge, blob, node, challenger, row, col, deadline_slot, slash_amount
  • ChallengeResolved: challenge, node, cell_hash, slot
  • NodeSlashed: challenge, node, challenger, bounty_lamports, protocol_lamports, slot
  • NodeFeesClaimed: operator, node, amount_lamports

Error Codes (AlderError)

CodeNameMessage
6000UnauthorizedDeployerOnly the authorized deployer may initialize the protocol
6001InvalidFeeBpsProtocol fee bps must be <= 5000
6002InvalidSlashBpsSlash bps must be between 1 and 5000
6003InvalidWindowSlot window is too small
6004BondTooLowNode bond is below the protocol minimum
6005ZeroAmountAmount must be greater than zero
6006InsufficientBondInsufficient bonded lamports
6007InvalidPayloadSizePayload size must be greater than zero
6008PayloadTooLargeForKPayload exceeds max size for chosen k (cell size must be <= 512 bytes)
6009FeeTooLowAvailability fee is below protocol minimum
6010InvalidCodingShapeInvalid 2D Reed-Solomon coding shape
6011InvalidRetentionDepthTCDA retention depth must be between 1 and 4
6012BlobNotPendingBlob is not in Pending state
6013BlobNotAvailableBlob is not in Available state
6014NodeNotActiveDA node is not Active or has zero remaining bond
6015AttestationWindowActiveAttestation timeout window has not elapsed
6016InvalidCellCoordinateCell coordinate out of bounds
6017ChallengeNotOpenChallenge is not Open
6018ChallengeWindowElapsedChallenge deadline slot has already passed
6019ChallengeWindowActiveChallenge deadline slot has not elapsed yet
6020InvalidCellOpeningInvalid cell opening or Merkle inclusion proof
6021NothingToClaimNo earned fees available to claim
6022MathOverflowArithmetic overflow
6023OpenChallengesExistCannot proceed while open challenges exist
6024UnbondCooldownActiveUnbonding cooldown slot has not been reached
6025BlobExpiredBlob retention window has expired
6026BlobNotExpiredBlob has not reached its expiry slot yet
6027NodeNotCustodianDA node is not the attesting custodian for this blob
6028CommitmentMismatchAttestation root does not match blob commitment root
6029AttestationWindowElapsedAttestation timeout window has already elapsed
6030SelfChallengeNotAllowedNode operator cannot challenge their own node
6031BlobNotClosableBlob cannot be closed until Expired or Cancelled with zero escrow
6032ChallengeNotClosableChallenge cannot be closed until Resolved or Slashed

Next Steps