Skip to content

Make cc-eventlog / verification core usable as a downstream dependency #1515

Open

Description

@kingsleydon

Context: private-ai-gateway verifies dstack TDX evidence in a Rust gateway, a Rust desktop CLI and a browser TS client, and wants to use upstream code instead of its own RTMR3 event-log verification (Dstack-TEE/private-ai-gateway#531).

Blockers at verifier-v0.6.3:

  1. cc-eventlog depends on serde_jcs 0.2, which unconditionally enables serde_json/float_roundtrip. Cargo feature unification turns it on for the whole downstream build and changes float parsing app-wide. The V2 canonical JSON only has the fixed keys {name, payload, type} with string/hex/u32 values, so it doesn't need serde_jcs, or serde_jcs could sit behind an optional feature.
  2. cc-eventlog / dstack-types / dstack-attest aren't on crates.io, so downstream must use git deps.
  3. dstack-attest can't build for wasm32 or be used verification-only: it pulls in rustix and the guest-side tdx/tpm/nsm/sev-snp attest crates unconditionally, and fetches collateral itself. cc-eventlog alone already builds for wasm32-unknown-unknown.
  4. @phala/dstack-sdk replayRtmrs replays the advertised digests without recomputing them from event payloads, so it can't be used to verify an untrusted event log.

Ask:

  • (a) drop or gate serde_jcs in cc-eventlog;
  • (b) publish cc-eventlog and dstack-types;
  • (c) a verification-only, wasm-buildable dstack-attest that accepts caller-supplied collateral, ideally with an npm/wasm build;
  • (d) document or fix (4).

Happy to send a PR for (a).

Activity

  1. kvinwang commented on Nov 18, 2026

    @kvinwang
    Collaborator

    Thanks for the detailed report. We confirmed all four points. Two extra findings:

    • dstack-types (a dependency of cc-eventlog) also pulls in serde_jcs unconditionally, so float_roundtrip would still leak if only cc-eventlog were changed. gpu_policy_hash canonicalizes arbitrary JSON, so it does need correctly rounded float parsing; it will move behind a feature instead of being dropped.
    • replayRtmrs has been removed from the JS SDK on next (0.6.0). Only docs/verification.md is stale. In 0.5.x it must not be used to verify an untrusted event log.

    Our plan: only verification-side crates will be published, all with a dstack- prefix. Attestation generation code stays guest-only and unpublished.

    Phase 1: what this issue needs

    1. Remove the serde_jcs / float_roundtrip leak: hand-written V2 canonical JSON in cc-eventlog (byte-for-byte tested against serde_jcs) and serde_jcs gated behind a feature in dstack-types. Acceptance: cargo tree -p cc-eventlog -e features shows no float_roundtrip. Your PR for (a) is welcome; please cover dstack-types as well.
    2. Move guest-side code (read_event_log etc.) out of cc-eventlog.
    3. Rename cc-eventlog to dstack-cc-eventlog (the lib name stays cc_eventlog), prepare dstack-types and size-parser for publishing, and add cargo publish --dry-run to CI.
    4. Fix the stale replayRtmrs docs.

    After phase 1, a TDX verifier can use dcap-qvl (wasm-capable, takes caller-supplied collateral) plus dstack-cc-eventlog without depending on dstack-attest.

    Phase 2: verification-only dstack-attest (tracked separately)

    1. Move nsm_attest::AttestationDocument into nsm-qvl.
    2. Make sev-snp-qvl accept caller-supplied collateral, with fetching as an optional feature.
    3. Split dstack-attest into dstack-attest-verify (published) and a guest-side dstack-attest, then publish the verification crates.

    An npm/wasm package is out of scope for now.

    There's no committed timeline yet. Phase 1 will be prioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions