Tunable Coded Distributed Arrays
Systematic 2D Reed-Solomon encoding over GF(256), matrix geometry, and tunable retention depth d = 1..4.
Alder encodes every encrypted blob into a Tunable Coded Distributed Array (TCDA), adapted from Minh, Huu, and Tran (arXiv:2610.22508 and arXiv:2606.16200). Instead of replicating the full ciphertext on every DA node, ciphertext is split into a k x k matrix, extended to 2k x 2k via 2D Reed-Solomon coding over GF(256), and assigned to bonded nodes at a publisher-chosen retention depth d.
Finite Field and Systematic 2D Reed-Solomon
Both @alder/sdk (backend/packages/sdk/src/tcda.ts) and the backend encoder (backend/src/crypto/tcda.ts) operate over GF(256) with the standard irreducible polynomial x^8 + x^4 + x^3 + x^2 + 1 (0x11d).
- Data quadrant (`k x k`): The length-prefixed ciphertext is partitioned into
k * kequal-sized cells of32..512bytes each (MAX_CELL_BYTES = 512enforced on chain so any cell opening fits in a Solana transaction). Validkvalues are integers in2..16, withn = 2 * k(4..32). Both@alder/sdkandanchor_blobreject any shape outside2 <= k <= 16andn == 2 * k(AlderError::InvalidCodingShape, code6010). - Row extension (`k -> 2k`): Each of the
kdata rows is extended fromksymbols ton = 2ksymbols using systematic Lagrange interpolation at evaluation points1..k(data) andk+1..2k(parity). - Column extension (`k -> 2k`): Each of the
nresulting columns (containingksymbols) is extended ton = 2ksymbols using the same systematic Reed-Solomon vector encoder, producingn * ntotal coded cells (4 * k^2).
Codeword Verification and Erasure Tolerance
Before anchoring a blob, the API runs verifyTcdaCodeword(cells, k, n) to confirm every row and column parity symbol matches the systematic GF(256) Reed-Solomon encoding of the k x k data quadrant.
Because every row and every column is an (n, k) Reed-Solomon codeword with n = 2k:
- Any
kcells out of2kalong a row reconstruct the entire row, and anykcells out of2kalong a column reconstruct the entire column. decodeTcdadeduplicates coordinates and runs iterative row + column passes until allk x kdata cells are recovered, handling both row-sparse and column-sparse erasure patterns (including 100% parity-only recovery).reconstructBlobverifieshashCell(row, col, raw)on every fetched cell before passing valid cells intodecodeTcda, filtering out corrupted cells before decoding.
Tunable Retention Depth (d = 1..4)
Retention depth d controls how many bonded DA nodes hold copies of each coded cell shard. anchor_blob enforces 1 <= retention_depth <= 4 (AlderError::InvalidRetentionDepth, code 6008).
Retention Depth d | Shard Copies per Cell | Storage Overhead | Typical Workload |
|---|---|---|---|
d = 1 | 1x coded cell custody | Lowest fee and node storage | Long-term encrypted archival blobs |
d = 2 (default) | 2x coded cell custody | Balanced fee and redundancy | Standard Privacy Rings state diffs and rollup batches |
d = 3 | 3x coded cell custody | Higher redundancy, faster parallel sampling | Active confidential orderbooks and AI inference state |
d = 4 | 4x coded cell custody | Maximum redundancy and lowest retrieval tail latency | Hot institutional settlement state |
Availability Fee Formula
The backend computes the escrowed SOL availability fee in computeAvailabilityFeeLamports (backend/src/crypto/tcda.ts) as a deterministic function of ciphertext size, retention depth d, and expiry duration in slots:
const baseLamports = 1_000_000n // 0.001 SOL base
const kb = BigInt(Math.max(1, Math.ceil(payloadSizeBytes / 1024)))
const depthMultiplier = BigInt(Math.max(1, Math.min(4, retentionDepth)))
const epochFactor = BigInt(Math.max(1, Math.ceil(expirySlots / 216_000)))
const feeLamports = baseLamports + kb * 15_000n * depthMultiplier * epochFactor- Default
expirySlotsis216,000(1 epoch factor). Valid range inAnchorBlobBuildRequestis100..50,000,000slots; on chain,anchor_blobenforcesexpiry_slots >= 100. - Higher retention depth scales the per-KB storage term linearly (
1xto4x).
Matrix Commitments
Every cell at (row, col) is hashed with domain separation:
cellHash = SHA-256("alder:cell:v1:" || row || ":" || col || ":" || cellBytes)Binary Merkle trees using SHA-256("alder:node:" || left || ":" || right) are built over:
- Each row
0..n-1to producerowCommitments(nhashes) - Each column
0..n-1to producecolCommitments(nhashes) - All
n * ncell hashes in row-major order to produce the 32-bytecommitmentRootanchored on Solana inBlobRecord.commitment_root
Next Steps
- See how light clients verify random cells against
commitmentRootin Blinded DAS and Multiproofs. - Learn how missing cells trigger bond slashing in Challenges and Slashing.