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

@openclawdsolana/dark-tee-agents

v0.1.0

Published

TEE-attested confidential AI agents on Solana: x402 private inference payments anchored by the Solana Attestation Service

Readme

@dark-protocol/tee-agents

TEE-attested confidential AI agents on Solana — sealed inference paid for with x402 private payments, anchored by the Solana Attestation Service.

This package is the trust + payments layer for Dark DeFi's AI desk. It lets you:

  • spawn an enclave-backed agent that holds its own TEE key material and a signed attestation quote (measurement + report signature);
  • anchor that agent's identity on-chain through the Solana Attestation Service (SAS) under a Dark-controlled credential;
  • pay for inference confidentially with the x402 dark-shielded scheme (the resource server learns only that payment cleared — not who paid or how much);
  • run inference sealed end-to-end (the prompt and completion are encrypted to the enclave's key, never visible to the host or the network);
  • receipt every paid call back on-chain as a SAS attestation.
spawn enclave → verify quote → seal prompt → pay (x402) → infer → on-chain receipt

Install

npm install @dark-protocol/tee-agents

Quick start

import {
  ConfidentialAgent,
  ConfidentialInferenceClient,
  LocalSignerPayer,
  generateSigningKeypair,
  toBase58,
  PAYMENT_ASSETS,
} from "@dark-protocol/tee-agents";
import { address } from "@solana/kit";

// 1. Spawn a confidential agent (generates enclave keys + a TEE quote).
const owner = address(toBase58(generateSigningKeypair().publicKey));
const agent = ConfidentialAgent.spawn({
  agentId: "dark-analyst-01",
  owner,
  model: "phala/deepseek-r1-70b-tee",
  network: "solana-devnet",
});

// 2. Advertise x402 payment requirements for one inference.
const requirements = agent.paymentRequirements({
  payTo: owner,
  asset: PAYMENT_ASSETS.USDC,
  atomicPrice: 10_000n, // 0.01 USDC
});

// 3. A client verifies the quote, pays, and runs sealed inference.
const provider = agent.localProvider(
  (req) => `analysis of "${req.prompt}" …`,
  requirements
);
const client = new ConfidentialInferenceClient({
  enclave: agent.quote,
  payer: new LocalSignerPayer(generateSigningKeypair(), /* confidential */ true),
  verify: { allowedProviders: ["local-dev"] },
});

const { result, payment } = await client.infer(
  { prompt: "How should I rebalance my private portfolio?" },
  provider,
  requirements.accepts[0]
);
console.log(result.text); // decrypted only on the client

Anchor the agent on-chain (SAS)

import { DarkAttestationService, DARK_SCHEMAS } from "@dark-protocol/tee-agents";

const sas = DarkAttestationService.fromNetwork("devnet", process.env.HELIUS_API_KEY);

// One-time issuer + schema setup (needs a funded signer).
const { credential } = await sas.createCredential({
  payer, authority, authorizedSigners: [authority.address],
});
const { schema } = await sas.createSchema({
  payer, authority, credential, def: DARK_SCHEMAS.agentIdentity,
});

// Attest the agent identity.
await sas.attest({
  payer, authority, credential, schema,
  nonce: agent.attestationNonce,
  data: agent.identityData(),
  expiryUnixSeconds: Math.floor(Date.now() / 1000) + 365 * 24 * 3600,
});

CLI

The package ships an animated CLI:

npx dark-tee demo            # full offline walkthrough
npx dark-tee spawn           # spawn an agent + derive its SAS addresses
npx dark-tee infer "..."     # one sealed, x402-paid inference

Or from the repo root: npm run tee:demo.

How it fits together

| Module | Responsibility | | --- | --- | | attestation/tee.ts | Generate & verify TEE quotes (measurement + ed25519 report signature). | | attestation/schemas.ts | SAS schemas for agent identity and inference receipts. | | attestation/service.ts | Drive SAS credential → schema → attestation lifecycle via sas-lib. | | payments/x402.ts | x402 payment requirements + the private dark-shielded scheme. | | inference/client.ts | Sealed inference (verify → seal → pay → call → open). | | agents/confidential-agent.ts | The agent: enclave identity + payments + inference + receipts. | | crypto.ts | ed25519 signatures, x25519 sealed boxes, SHA-256 (via tweetnacl + Node crypto). |

Program addresses

| Component | Address | | --- | --- | | Solana Attestation Service | 22zoJMtdu4tQc2PzL74ZUT7FrwgB1Udec8DdW4yw4BdG | | Dark Protocol | 3KWLFYco7T2rUZkzjSSthjHGmbWmo9HAsRmvupDTomGC |

Security status

Alpha. The local-dev TEE provider produces a self-rooted quote suitable for development and tests only — it proves key custody and identity binding, not hardware isolation. For production, supply hardware-rooted quotes (SGX DCAP / SEV-SNP / dstack) via importHardwareQuote and verify them against the provider's attestation/PCS out of band before trusting an enclave. Never commit keypairs or API keys; load them from the environment.

License

Apache-2.0