Skip to main content

dDRM to Capsule Integration

PC2's existing Rust/WASM crates compile to wasm32-wasip1 -- the exact same target the Runtime uses via Wasmtime. Repackaging them as capsules is straightforward.

Existing Code to Capsule Mapping

Existing CodeRuntime CapsuleCapability
cenc-decrypt/ (AES-128-CTR)Media DRM Capsuledrm:decrypt-media
cenc-encrypt/Encryption Capsuledrm:encrypt
ddrm-renderer/dDRM Providerdrm:decrypt
ipfs-assemble/Content Assemblystorage:assemble
mp4-split/Media Processormedia:split
pc2-media-runtime/Data Capsule viewerViewer for .ddrm.json

Each existing crate becomes a separate capsule with its own CID, its own version, and an explicit capability scope. The broad implicit access these crates currently have is replaced by precise, auditable capability tokens.

How Data Capsules Enable dDRM

Data capsules are the runtime's native model for protected content. A .ddrm.json descriptor references encrypted content (by CID) and declares which viewer capsule can render it:

  1. The runtime loads the data capsule descriptor
  2. The runtime identifies the declared viewer capsule (by CID)
  3. The runtime loads the viewer capsule
  4. The runtime grants the viewer a scoped decrypt capability -- only for this specific content, only for the duration of playback
  5. The viewer decrypts and renders the content
  6. The capability expires when playback ends

This model enforces that:

  • The viewer can only decrypt the content it was granted access to
  • The decrypt capability is time-limited and use-limited
  • The entire interaction is logged in the audit trail
  • The content owner retains control through the capability system

Convergence Path

The dDRM integration follows the PC2 convergence timeline. Today, dDRM works in PC2 v1 with ambient authority. At v2.0, dDRM runs as a provider capsule with scoped capability tokens.

Blockchain Bridge (Planned)

When the blockchain integration is available, on-chain ACCESS_TOKEN ownership will bridge to runtime capability tokens:

  • Purchasing an ACCESS_TOKEN on-chain triggers a capsule access grant
  • The shell can verify: "You own the ACCESS_TOKEN. Granting 1-hour capability. Logged."
  • Payment-aware flows connect on-chain commerce to runtime-enforced access control
Planned Feature

The ACCESS_TOKEN to capability token bridge is listed as "What's Next" and is not yet available. The existing dDRM system in PC2 v1 continues to work independently.