Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.story.foundation/llms.txt

Use this file to discover all available pages before exploring further.

This page covers the release-specific and operational details that sit beyond basic setup. Start with Setup CDR Client first.

DKG State and the Story-API Endpoint

The SDK reads state from two backends:
BackendConfigured byWhat it reads
EVMpublicClientCDR contract state — vaults, fees, maxEncryptedDataSize, operational threshold
Story-API RESTapiUrlDKG state — active round, global public key, threshold, validators, attestations
The apiUrl is a required CDRClient parameter. It is the base URL of a Story-API REST endpoint, and the observer uses it for every DKG read.
const client = new CDRClient({
  network: "testnet",
  publicClient,
  walletClient,
  apiUrl: "http://172.192.41.96:1317",
});
For production deployments, point apiUrl at your own Story node’s REST gateway rather than the shared endpoint. See Story-API REST Endpoint for the per-network values.
The observer caches round-keyed DKG snapshots for rounds in the stable Active and Ended stages, with in-flight request deduplication. The active round itself is always re-fetched, since it can transition at any time.

Threshold Tuning

By default the SDK uses the network’s own DKG threshold when combining partial decryptions. You can raise the bar with the optional minThresholdRatio parameter, a value in [0, 1]:
const client = new CDRClient({
  network: "testnet",
  publicClient,
  walletClient,
  apiUrl: "http://172.192.41.96:1317",
  minThresholdRatio: 0.67,
});
The effective threshold becomes max(network.threshold, ceil(participants * minThresholdRatio)).
Values above 1 would require more partials than there are participants, causing collectPartials / accessCDR to time out forever. The SDK rejects them.

Contract Addresses

The current Aeneid release uses the following core system addresses:
ContractAddress
DKG0xCcCcCC0000000000000000000000000000000004
CDR0xCcCcCC0000000000000000000000000000000005
The SDK already knows these addresses. For Story license-gated condition contracts, see How the Story License Read Pattern Works.

Release Posture and Availability

  • Aeneid is the current public testnet release for the SDK.
  • Confidentiality depends on the DKG threshold and validator / enclave trust assumptions described in the CDR overview.
  • Availability depends on enough validators responding before timeout. If reads fail to reach threshold, retry or increase timeoutMs.
  • DKG reads depend on the apiUrl Story-API endpoint being correct and reachable. Point it at a node you trust for production use.

Current Release Notes

  • Story license-gated vaults still require manual condition encoding.
  • The CDR SDK does not auto-wrap IP to WIP or auto-approve WIP for license minting.
  • accessCDR() can auto-generate the ephemeral keypair and query threshold when those params are omitted.
  • createVault / readVault / createFileVault / readFileVault are available as high-level aliases.
  • getRegisteredValidators() only includes validators whose registration is fully ratified (status = Finalized).
  • timeoutMs: 120_000 is a good starting point for accessCDR() and downloadFile().