Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DCAP quote support #112

Merged
merged 54 commits into from
Mar 19, 2025
Merged

Add DCAP quote support #112

merged 54 commits into from
Mar 19, 2025

Conversation

bluele
Copy link
Member

@bluele bluele commented Oct 19, 2024

Summary

This PR enables DCAP Remote Attestation support for the LCP (Light Client Proxy) middleware by integrating zkDCAP, which addresses the expensive gas cost associated with DCAP verification on Ethereum and other EVM chains.

Motivation

Direct verification of DCAP (Data Center Attestation Primitives) quotes on-chain is highly costly to Ethereum or EVM compatible chains, limiting scalability and practical usecase. zkDCAP, DCAP quote verifier running on RISC Zero zkVM, solves these challenges by moving expensive computations off-chain, thus maintaining LCP's core value proposition of low-cost attestation verification.

Changes

  • Implemented zkDCAP integration to facilitate efficient DCAP Remote Attestation.
  • Introduced minor CI enhancements:
  • Added installation script install_sgx_sdk.sh for streamlined setup of Intel SGX and DCAP dependencies.
  • Adjusted GitHub workflow (test.yml) to utilize the new SGX installation script.
  • Updated dependencies in Cargo.lock for enhanced compatibility and security.

References

Benefits

  • DCAP Remote Attestation compatibility added to LCP.
  • Significant reduction in gas cost for DCAP quote verification on Ethereum.
  • Preservation of minimal trust assumptions by leveraging TEE and zero-knowledge proofs.

@bluele bluele force-pushed the dcap branch 4 times, most recently from 0e8f1a4 to 623f605 Compare October 19, 2024 11:56
@bluele bluele force-pushed the dcap branch 3 times, most recently from d19adcd to 2ed12b7 Compare December 12, 2024 06:51
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
@bluele bluele force-pushed the dcap branch 2 times, most recently from 7e2eea0 to e8e9329 Compare December 18, 2024 08:35
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
bluele added 15 commits February 3, 2025 16:46
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Also, add `enclave_debug` field to `QueryAvailableEnclaveKeysRequest`

Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
…e and debug info of the enclave

Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
bluele added 11 commits March 3, 2025 23:15
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
…stead of `eary_update`

Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
…tation command

Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
bluele added 2 commits March 11, 2025 17:16
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
@bluele bluele requested a review from Copilot March 11, 2025 09:34
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@bluele bluele requested a review from Copilot March 11, 2025 09:36
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR adds support for DCAP Remote Attestation using zkDCAP for on-chain gas cost reduction, along with additional CI improvements and dependency updates. Key changes include:

  • Integration of zkDCAP within the enclave command flow and updates to attestation reporting.
  • Introduction of new commands and options for DCAP, ZKDCAP, and simulation modes in the attestation commands.
  • Updates to Cargo.toml files and CI workflows to support the new SGX installation script and dependencies.

Reviewed Changes

File Description
app/src/commands/enclave.rs Updated command options to include target QE type and adjusted key generation accordingly.
modules/attestation-report/src/dcap.rs Added new types and methods for handling DCAP and ZKDCAP quotes.
modules/attestation-report/Cargo.toml Updated dependencies with new flags and added conditional features for DCAP quote parsing.
app/Cargo.toml Added dependencies for attestation-report (with dcap-quote-parser) and zkdcap-risc0.
.github/workflows/test.yml Replaced legacy SGX SDK installation with a new install script.
app/src/commands/attestation.rs Introduced new subcommands for DCAP and ZKDCAP based attestation along with simulation modes.
modules/attestation-report/src/report.rs Redesigned report data types and added new enums for QEType and RAQuote with updated logic.
modules/attestation-report/src/errors.rs Adjusted error definitions relating to QE type and RA type.
modules/enclave-api/src/api/command.rs Updated generate_enclave_key API to include target QE type parameter.
Other files Minor changes across several modules to support the new remote attestation schemes.

Copilot reviewed 60 out of 60 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

modules/attestation-report/src/report.rs:232

  • The documented layout for ReportData sums to 63 bytes (1 + 20 + 20 + 22) while the underlying array is defined as 64 bytes. Please verify whether the layout documentation or the ReportData size should be adjusted.
/// | version: 1 byte | enclave key: 20 bytes | operator: 20 bytes | nonce: 22 bytes |

Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
@bluele bluele merged commit 152153c into main Mar 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant