npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tdx-node-attestation

v0.0.2

Published

A simple example of using rust and napi-rs to generate Intel TDX Quote

Readme

Intel TDX Quote Generation SDK

Getting Started

Hardware Requirements

The following cloud service providers (CSP) have support for Intel TDX:

GCP

  • Instance Type: c3-standard-* family
  • Operating System: containerOS, RHEL0, SLES-15-sp5, Ubuntu 22.04
  • Supported Zones: asia-southeast-1-{a,b,c}, europe-west4-{a,b}, us-central1-{a,b,c}
  • For more information on supported operating systems, please check out the following article on GCP: supported configurations
  • Currently, TDX enabled VMs can only be created via gcloud or Rest API, please check out this article on how to do so: create an instance

Azure

  • Instance Type: DCesv5-series, DCedsv5-series, ECesv5-series, ECedsv5-series
  • Operating System: Ubuntu 24.04 Server (Confidential VM)- x64 Gen 2 image, Ubuntu 22.04 Server (Confidential VM) - x64 Gen 2 image.
  • Supported Region: West Europe, Central US, East US 2, North Europe

Others

  • If you wish to use a CSP that is not listed above or run your own host, please ensure that the CSP or host is running the following specs:
    • Linux Kernel >= 6.7
    • Virtual Machine (VM) runs under KVM hypervisor
    • VM has access to /sys/kernel/config/tsm/report and able to create a temporary directory with sudo (eg. sudo mkdir /sys/kernel/config/tsm/report/testing123).

If you receive the error mkdir: cannot create directory ‘testing123’: No such device or address, it means that ConfigFS is not supported on your VM.

Download Dependencies

sudo apt install build-essential pkg-config libtss2-dev

Getting Started with Rust

First, install Rust, and select the default toolchain as nightly.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

To get a quick introduction on how to generate and verify an attestation report, we have an example at examples/attestation.rs. To run the example:

cargo build --example attestation
sudo ./target/debug/examples/attestation

The example should successfully generate and verify an attestation report on any TDX enabled virtual machine and display the result on stdout.

Rust API Usage

Initialize Tdx object

In order to run the next few steps, first initialize a Tdx object:

use tdx::Tdx;

...


let tdx = Tdx::new();

Generate Attestation

To generate an attestation with default options, you can do so like this:

let report = tdx.get_attestation_report()?;

If you wish to customise options for the attestation report, you can do something like this:

use tdx::device::DeviceOptions;

...

tdx.get_attestation_report_with_options(
    DeviceOptions {
        report_data: Some([0; 64]),
    }
)?;

For details on the struct options, please check out the comments in the struct.

Verify Attestation

Verify Attestation on-chain

In Automata DCAP Attestation, We provide two ways to verify the Intel TDX quote on-chain:

function verifyAndAttestOnChain(bytes calldata rawQuote)

It accepts the raw quote hex string to perform the on-chain verification, all collaterals will be fetched from the Automata on-chain PCCS.

function verifyAndAttestWithZKProof(bytes calldata output, ZkCoProcessorType zkCoprocessor, bytes calldata proofBytes)

The first parameter represents the output of the zkVM, the second one is the zkVM type, and the third one is its corresponding proof. It supports two kinds of ZK technologies to perform the on-chain verification:

  • Risc0

    • output: the journal of the Risc0 zkVM output
    • zkCoprocessor: 1
    • proofBytes: the seal of the Risc0 zkVM output
  • SP1

    • output: the execution result of the SP1 Prover output
    • zkCoprocessor: 2
    • proofBytes: the proof of the SP1 Prover output

Verify Attestation off-chain

Please follow Intel official DCAP repo SGXDataCenterAttestationPrimitives to perform the off-chain verification.