# Agent Passport

Adopt this skill: https://proskills.md/skills/other/parad0x-labs-openclaw-skills-plugins-agent-passport

Page: https://proskills.md/skills/other/parad0x-labs-openclaw-skills-plugins-agent-passport
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: plugins/agent-passport/SKILL.md
size: 3215
sha: cd2c3ca68cf236e0e96becbf9d757d2231a5512c
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/SKILL.md

````text
---
name: Agent Passport
description: On-chain identity for OpenClaw agents — .null name, ETH↔Solana binding, verifiable agent identity without touching private keys
tags: identity, solana, web0, null, reputation, passport
requires_openclaw: ">=2026.6.1"
license: MIT
metadata:
  author: Parad0x-Labs
---

# Agent Passport

Gives an OpenClaw agent a verifiable on-chain identity backed by the web0 stack
on Solana. The agent can prove who it is (or confirm who another agent is) without
ever holding or requesting private keys.

## What it does

- Reads `solanaWallet`, `ethAddress`, and `nullName` from plugin config
- Derives PDAs on the legacy mainnet identity program (`dark_secp256k1_auth`) and
  checks whether the binding accounts exist (read-only)
- Returns the agent's full identity record so it can be injected into conversation
  context, payment routing, or audit trails
- Can also verify a DIFFERENT agent's identity by their wallet or ETH address

## Tools exposed

### `get_agent_passport`

Returns this agent's on-chain identity record:

```json
{
  "null_name": "myagent.null",
  "solana_wallet": "...",
  "eth_address": "0x...",
  "eth_binding_pda": "...",
  "eth_binding_registered": true,
  "network": "solana-mainnet",
  "programs": {
    "dark_secp256k1_auth": "AqwBbV13AoczhoELwP8oxT3nDqB6MsLWXauNzHkssZ9B"
  },
  "program_status": {
    "dark_secp256k1_auth": "retired (mainnet) — existing ETH↔Solana bindings readable; ..."
  }
}
```

No parameters required — reads from plugin config.

### `verify_agent_identity`

Verifies a DIFFERENT agent's on-chain identity. Supply at least one of:
- `target_solana_wallet` — base58 Solana public key
- `target_eth_address` — hex ETH address
- `target_null_name` — .null name (passed through; this tool checks identity PDAs, not name resolution)

Returns whether the ETH binding and/or Solana wallet PDAs are registered on-chain.

## Trust model

- **Read-only.** Both tools only query on-chain account existence — no transactions,
  no signing, no private key access of any kind.
- **Public RPC only.** Uses `https://solana-rpc.publicnode.com` by default
  (never `api.mainnet-beta.solana.com`). Override with `rpcUrl` in config.
- **No secrets in config.** `solanaWallet` and `ethAddress` are public keys/addresses.
  Private keys belong in the host signer, not here.
- **PDA derivation is deterministic.** Seeds are the same ones the on-chain programs
  use — no external oracle needed.

## Current status

The ETH↔Solana binding program (`dark_secp256k1_auth`) is a retired mainnet program: its
accounts stay readable, so both tools verify **existing** bindings, but nothing can be
invoked and no new bindings can be created. This plugin has no write path. Every result
carries `program_status`. The WebAuthn vault lookup was removed in 0.2.0 because that
program is attacker-controlled, and 0.2.0 no longer lists the closed mainnet
`receipt_anchor` program (the `RECEIPT_ANCHOR` export is removed).

`nullName` is surfaced from config as-is. To resolve a legacy `.null` name (read-only —
the mainnet registrar was retired 2026-08-29, records stay readable), use the
mcp-server `resolve_null` tool or x402-pay pay-by-name.
````

## File: plugins/agent-passport/README.md
size: 2457
sha: b2bf9890698cf392f27f3f97ce379eee553f259d
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/README.md

````text
# @parad0x_labs/openclaw-agent-passport

On-chain identity for OpenClaw agents — a `.null` name, ETH↔Solana binding, and
verifiable agent identity, **without ever touching a private key**.

Give your agent a passport it can present (and check on others) so payments,
reputation, and audit trails all bind to one verifiable on-chain identity.

```bash
npm i @parad0x_labs/openclaw-agent-passport
```

> Requires OpenClaw **≥ 2026.6.1**. Read-only. Public RPC only.

## Two tools

| Tool | Does |
|---|---|
| `get_agent_passport` | Returns **this** agent's identity record: `.null` name, Solana wallet, ETH address, the derived identity PDAs, and whether each binding account exists on-chain. |
| `verify_agent_identity` | Verifies a **different** agent's identity by `target_solana_wallet`, `target_eth_address`, or `target_null_name`. Returns which bindings are registered on-chain. |

## Config

```jsonc
{
  "solanaWallet": "<base58 public key>",   // this agent's wallet
  "ethAddress": "0x…",                      // optional ETH binding
  "nullName": "myagent.null",               // optional display/routing name
  "rpcUrl": "https://…"                     // optional; defaults to publicnode
}
```

All config values are **public** keys/addresses. Private keys belong in the host
signer, never here.

## Trust model

- **Read-only** — both tools only query on-chain account existence. No
  transactions, no signing, no private-key access.
- **Public RPC only** — `https://solana-rpc.publicnode.com` by default (never
  `api.mainnet-beta.solana.com`, which 403s with an Origin header).
- **No seized program IDs** — reads only the legacy `dark_secp256k1_auth`
  program; PDA derivation is deterministic from the on-chain seeds.

## Status

The ETH↔Solana binding program (`dark_secp256k1_auth`) is a retired mainnet program:
existing bindings stay readable and both tools verify them, but no new bindings can be
created. Every result carries `program_status`. Version 0.2.0 removes the WebAuthn
vault lookup (`webauthn_vault_registered`, `webauthn_vault_pda`) because that program
is attacker-controlled, and drops the closed mainnet `receipt_anchor` program from
`programs` (the `RECEIPT_ANCHOR` export is removed).
`nullName` is surfaced from config as-is; legacy `.null` names resolve read-only via
the mcp-server `resolve_null` tool or x402-pay pay-by-name.

See [SKILL.md](./SKILL.md) for the full tool reference. MIT licensed.
````

## File: plugins/agent-passport/openclaw.plugin.json
size: 1192
sha: 4182d2079d5df365fb2f3fa281569c21d1ae84ca
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/openclaw.plugin.json

```text
{
  "id": "agent-passport",
  "minOpenClawVersion": "2026.6.1",
  "activation": {
    "onStartup": true
  },
  "enabledByDefault": false,
  "configSchema": {
    "type": "object",
    "properties": {
      "solanaWallet": {
        "type": "string",
        "description": "Agent's Solana wallet address (base58 public key). Used to look up on-chain identity records."
      },
      "ethAddress": {
        "type": "string",
        "description": "Agent's ETH address (hex, optional). Used to look up secp256k1 identity binding."
      },
      "nullName": {
        "type": "string",
        "description": "Agent's .null name (e.g. myagent.null). Used for identity display and routing."
      },
      "rpcUrl": {
        "type": "string",
        "description": "Solana RPC URL override. Defaults to solana-rpc.publicnode.com."
      }
    },
    "additionalProperties": false
  },
  "name": "Agent Passport",
  "description": "On-chain identity for OpenClaw agents — .null name, ETH↔Solana binding, verifiable agent identity without touching private keys.",
  "version": "0.2.1",
  "contracts": {
    "tools": [
      "get_agent_passport",
      "verify_agent_identity"
    ]
  }
}
```

## File: plugins/agent-passport/package-lock.json
size: 195871
sha: 2349fb13229e5e714ae75433456048c6f312af8d
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/package-lock.json

Content is not inlined in the catalog. Read the upstream file: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/package-lock.json

## File: plugins/agent-passport/package.json
size: 1347
sha: db30890ad8cf7aaf8491ef123630c2e18066f872
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/package.json

```text
{
  "name": "@parad0x_labs/openclaw-agent-passport",
  "version": "0.2.1",
  "description": "OpenClaw plugin — read-only agent identity lookups for the web0 stack (legacy ETH↔Solana bindings)",
  "type": "module",
  "main": "./src/index.ts",
  "openclaw": {
    "extensions": ["./src/index.ts"]
  },
  "files": [
    "src/",
    "openclaw.plugin.json",
    "SKILL.md",
    "README.md"
  ],
  "scripts": {
    "build": "tsc -p tsconfig.json",
    "typecheck": "tsc --noEmit -p tsconfig.json",
    "test": "npm run build && node --test",
    "prepublishOnly": "npm run build"
  },
  "dependencies": {
    "@solana/web3.js": "^1.98.0",
    "typebox": "1.1.39"
  },
  "overrides": {
    "@modelcontextprotocol/sdk": "^1.31.0",
    "jayson": "^5.0.0"
  },
  "peerDependencies": {
    "openclaw": ">=2026.6.1"
  },
  "devDependencies": {
    "@types/node": "^22.0.0",
    "typescript": "^5.6.0"
  },
  "engines": {
    "node": ">=22"
  },
  "license": "MIT",
  "publishConfig": {
    "access": "public"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/Parad0x-Labs/openclaw-skills.git",
    "directory": "plugins/agent-passport"
  },
  "homepage": "https://github.com/Parad0x-Labs/openclaw-skills/tree/main/plugins/agent-passport#readme",
  "bugs": {
    "url": "https://github.com/Parad0x-Labs/openclaw-skills/issues"
  }
}
```

## File: plugins/agent-passport/src/index.ts
size: 3159
sha: f0d13771c04fdf1d03523eecb7212dc607ce9a1a
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/src/index.ts

```text
/**
 * openclaw-agent-passport — on-chain identity for OpenClaw agents.
 *
 * Thin host wrapper on the real OpenClaw SDK (`defineToolPlugin` + TypeBox
 * `parameters` + `execute`). All logic lives in ./passport.ts (host-free,
 * unit-tested). Read-only: both tools query on-chain state; no signing, no keys.
 */

import { Type } from "typebox";
import type { TSchema } from "typebox";
import { defineToolPlugin } from "openclaw/plugin-sdk/tool-plugin";

import { buildPassportTools, readConfig } from "./passport.js";

// Tool name/description are config-independent — build a template once for metadata.
const TEMPLATE = buildPassportTools(readConfig(undefined));
// The config-bound tools are memoized on first call (plugin config is static).
let memo: ReturnType<typeof buildPassportTools> | null = null;
const runtimeTools = (config: unknown) =>
  (memo ??= buildPassportTools(readConfig(config as Record<string, unknown> | undefined)));

/** Plugin config schema. `openclaw plugins build` generates the manifest
 *  configSchema (openclaw.plugin.json) from this object, and the host validates
 *  `plugins.entries.agent-passport.config` against that manifest before the plugin loads. */
const ConfigSchema = Type.Object(
  {
    solanaWallet: Type.Optional(
      Type.String({
        description:
          "Agent's Solana wallet address (base58 public key). Used to look up on-chain identity records.",
      }),
    ),
    ethAddress: Type.Optional(
      Type.String({
        description: "Agent's ETH address (hex, optional). Used to look up secp256k1 identity binding.",
      }),
    ),
    nullName: Type.Optional(
      Type.String({ description: "Agent's .null name (e.g. myagent.null). Used for identity display and routing." }),
    ),
    rpcUrl: Type.Optional(
      Type.String({ description: "Solana RPC URL override. Defaults to solana-rpc.publicnode.com." }),
    ),
  },
  { additionalProperties: false },
);

const PARAMS: Record<string, TSchema> = {
  get_agent_passport: Type.Object({}),
  verify_agent_identity: Type.Object({
    target_solana_wallet: Type.Optional(Type.String({ description: "Target agent's Solana wallet (base58)." })),
    target_eth_address: Type.Optional(Type.String({ description: "Target agent's ETH address (hex)." })),
    target_null_name: Type.Optional(Type.String({ description: "Target agent's .null name (informational)." })),
  }),
};

export default defineToolPlugin({
  id: "agent-passport",
  name: "Agent Passport",
  description:
    "On-chain identity for OpenClaw agents — .null name, ETH↔Solana binding, " +
    "verifiable agent identity without touching private keys.",
  configSchema: ConfigSchema,
  tools: (tool) =>
    TEMPLATE.map((t) =>
      tool({
        name: t.name,
        label: t.name,
        description: t.description,
        parameters: PARAMS[t.name] ?? Type.Object({}),
        execute: (params, config) => {
          const rt = runtimeTools(config).find((x) => x.name === t.name);
          if (!rt) return { ok: false, error: `tool ${t.name} unavailable` };
          return rt.handler(params as Record<string, unknown>);
        },
      }),
    ),
});
```

## File: plugins/agent-passport/src/passport.ts
size: 9339
sha: afcfe697b4769f5a8b0ec70078e5587f6d83a4d2
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/src/passport.ts

```text
/**
 * agent-passport — host-free core.
 *
 * All identity logic (program IDs, PDA derivation, config parsing, the two tool
 * definitions) lives here with NO `openclaw/*` host import, so this module loads
 * and unit-tests standalone. `index.ts` is a thin wrapper that hands these tools
 * to the OpenClaw plugin loader. Mirrors the openclaw-skills convention where
 * testable logic sits in a host-free sibling module.
 *
 * Trust model:
 *   - READ-ONLY. No transactions, no signing, no private-key access. The
 *     identity programs it reads are retired mainnet programs: their accounts
 *     (existing bindings) stay readable, but nothing can be invoked, so no new
 *     bindings can be created. This plugin has no write path.
 *   - PUBLIC RPC ONLY. solana-rpc.publicnode.com by default — never
 *     api.mainnet-beta.solana.com (returns 403 with an Origin header).
 *   - No hardcoded seized or pre-incident program IDs.
 */

import { Connection, PublicKey } from "@solana/web3.js";

// ── Program IDs — legacy mainnet deployments (retired; accounts readable) ─────
// Lookups here are read-only account-existence checks against existing bindings.
// Do NOT add dark_x402_access_gate, dark_nullifier_record or the secp256r1
// vault here — those programs are attacker-controlled. The WebAuthn vault
// lookup was removed in 0.2.0 for that reason.

// The retired mainnet receipt_anchor program is closed and no longer listed: this
// plugin never read it, and no receipt_anchor deployment is configured.
export const DARK_SECP256K1_AUTH = "AqwBbV13AoczhoELwP8oxT3nDqB6MsLWXauNzHkssZ9B";

export const PROGRAMS = {
  dark_secp256k1_auth: DARK_SECP256K1_AUTH,
} as const;

/** Current status of each program above — returned alongside every lookup. */
export const PROGRAM_STATUS = {
  dark_secp256k1_auth:
    "retired (mainnet) — existing ETH↔Solana bindings readable; no new bindings can be created",
} as const satisfies Record<keyof typeof PROGRAMS, string>;

// Public RPC — never api.mainnet-beta.solana.com (403s with Origin header)
export const DEFAULT_RPC = "https://solana-rpc.publicnode.com";

// ── Config ──────────────────────────────────────────────────────────────────

export interface AgentPassportConfig {
  solanaWallet?: string;
  ethAddress?: string;
  nullName?: string;
  rpcUrl?: string;
}

export function readConfig(raw: Record<string, unknown> | undefined): AgentPassportConfig {
  const cfg = raw ?? {};
  return {
    solanaWallet: typeof cfg.solanaWallet === "string" ? cfg.solanaWallet : undefined,
    ethAddress: typeof cfg.ethAddress === "string" ? cfg.ethAddress : undefined,
    nullName: typeof cfg.nullName === "string" ? cfg.nullName : undefined,
    rpcUrl: typeof cfg.rpcUrl === "string" ? cfg.rpcUrl : undefined,
  };
}

// ── PDA derivation (pure — no network) ───────────────────────────────────────

/**
 * Derive the ETH-binding PDA for a hex ETH address on dark_secp256k1_auth.
 * Seeds: ["eth_agent", <20-byte eth address>]. Accepts "0x"-prefixed or bare
 * hex; returns null if malformed.
 */
export function deriveEthBindingPda(ethAddress: string): string | null {
  try {
    const hex = ethAddress.startsWith("0x") ? ethAddress.slice(2) : ethAddress;
    if (hex.length !== 40) return null;
    const addrBytes = Buffer.from(hex, "hex");
    if (addrBytes.length !== 20) return null;

    const programId = new PublicKey(DARK_SECP256K1_AUTH);
    const [pda] = PublicKey.findProgramAddressSync(
      [Buffer.from("eth_agent"), addrBytes],
      programId,
    );
    return pda.toBase58();
  } catch {
    return null;
  }
}

/**
 * Derive the Solana-wallet PDA on dark_secp256k1_auth.
 * Seeds: ["sol_agent", <wallet pubkey bytes>]. Null if malformed.
 */
export function deriveSolAgentPda(solanaWallet: string): string | null {
  try {
    const walletKey = new PublicKey(solanaWallet);
    const programId = new PublicKey(DARK_SECP256K1_AUTH);
    const [pda] = PublicKey.findProgramAddressSync(
      [Buffer.from("sol_agent"), walletKey.toBytes()],
      programId,
    );
    return pda.toBase58();
  } catch {
    return null;
  }
}

/** True if a PDA account exists on-chain (any non-null account counts). */
export async function accountExists(connection: Connection, pda: string): Promise<boolean> {
  try {
    const info = await connection.getAccountInfo(new PublicKey(pda));
    return info !== null;
  } catch {
    return false;
  }
}

// ── Tool definitions ─────────────────────────────────────────────────────────

export interface ToolDef {
  name: string;
  description: string;
  parameters: Record<string, unknown>;
  handler: (params: Record<string, unknown>) => Promise<unknown>;
}

/**
 * Build the two read-only identity tools for a given config. Pure factory — no
 * host dependency — so the tool set is unit-testable. Handlers open a Connection
 * to the configured (public) RPC only when invoked.
 */
export function buildPassportTools(config: AgentPassportConfig): ToolDef[] {
  const rpcUrl = config.rpcUrl ?? DEFAULT_RPC;

  const getAgentPassport: ToolDef = {
    name: "get_agent_passport",
    description:
      "Return this agent's on-chain identity record: .null name, Solana wallet, " +
      "ETH address, derived PDAs, and whether the binding accounts exist on-chain. " +
      "Reads existing bindings on the legacy mainnet identity programs (retired; " +
      "accounts readable). Read-only — no signing or transactions.",
    parameters: {},
    async handler(_params: Record<string, unknown>) {
      const connection = new Connection(rpcUrl, "confirmed");

      const ethBindingPda = config.ethAddress
        ? deriveEthBindingPda(config.ethAddress)
        : null;

      const ethBindingRegistered = ethBindingPda
        ? await accountExists(connection, ethBindingPda)
        : false;

      return {
        null_name: config.nullName ?? null,
        solana_wallet: config.solanaWallet ?? null,
        eth_address: config.ethAddress ?? null,
        eth_binding_pda: ethBindingPda,
        eth_binding_registered: ethBindingRegistered,
        network: "solana-mainnet" as const,
        programs: PROGRAMS,
        program_status: PROGRAM_STATUS,
      };
    },
  };

  const verifyAgentIdentity: ToolDef = {
    name: "verify_agent_identity",
    description:
      "Verify a DIFFERENT agent's on-chain identity. Supply at least one of " +
      "`target_solana_wallet`, `target_eth_address`, or `target_null_name`. " +
      "Returns whether the corresponding PDAs are registered on-chain (existing " +
      "bindings on the retired legacy mainnet identity programs stay readable). " +
      "Read-only — no signing or transactions.",
    parameters: {
      target_solana_wallet: {
        type: "string",
        description: "Target agent's Solana wallet address (base58 public key).",
      },
      target_eth_address: {
        type: "string",
        description: "Target agent's ETH address (hex, with or without 0x prefix).",
      },
      target_null_name: {
        type: "string",
        description:
          "Target agent's .null name (e.g. otheragent.null). " +
          "Informational — passed through; this tool checks identity PDAs, not name resolution.",
      },
    },
    async handler(params: Record<string, unknown>) {
      const targetWallet =
        typeof params.target_solana_wallet === "string" ? params.target_solana_wallet : undefined;
      const targetEth =
        typeof params.target_eth_address === "string" ? params.target_eth_address : undefined;
      const targetNull =
        typeof params.target_null_name === "string" ? params.target_null_name : undefined;

      if (!targetWallet && !targetEth && !targetNull) {
        return {
          ok: false,
          error:
            "Provide at least one of: target_solana_wallet, target_eth_address, target_null_name.",
        };
      }

      const connection = new Connection(rpcUrl, "confirmed");

      const ethBindingPda = targetEth ? deriveEthBindingPda(targetEth) : null;
      const solAgentPda = targetWallet ? deriveSolAgentPda(targetWallet) : null;

      const [ethBindingRegistered, solAgentRegistered] = await Promise.all([
        ethBindingPda ? accountExists(connection, ethBindingPda) : Promise.resolve(false),
        solAgentPda ? accountExists(connection, solAgentPda) : Promise.resolve(false),
      ]);

      return {
        ok: true,
        target: {
          null_name: targetNull ?? null,
          solana_wallet: targetWallet ?? null,
          eth_address: targetEth ?? null,
        },
        pdas: {
          eth_binding_pda: ethBindingPda,
          sol_agent_pda: solAgentPda,
        },
        registered: {
          eth_binding: ethBindingRegistered,
          sol_agent: solAgentRegistered,
        },
        network: "solana-mainnet" as const,
        programs: PROGRAMS,
        program_status: PROGRAM_STATUS,
      };
    },
  };

  return [getAgentPassport, verifyAgentIdentity];
}
```

## File: plugins/agent-passport/src/types/openclaw-host.d.ts
size: 2375
sha: 57260ad2e8c7a29e6ce092e771df325708b97793
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/src/types/openclaw-host.d.ts

```text
/**
 * Typecheck-only ambient declarations for the OpenClaw host-runtime SDK.
 *
 * At runtime these specifiers are resolved by the OpenClaw plugin loader; the host
 * supplies the real implementations. These declarations are FAITHFUL to the real
 * SDK contract at `openclaw/plugin-sdk/tool-plugin` (verified by typechecking this
 * skill against the real `openclaw` + `typebox` types), and exist so the skill
 * keeps building standalone (the openclaw-skills modularity contract). Inside a real
 * OpenClaw workspace the host's actual types take precedence.
 *
 * NOTE: this is intentionally a precise, non-`any` contract — an earlier loose shim
 * let a hallucinated tool shape (`{ parameters: Record, handler }`) slip through.
 */
declare module "openclaw/plugin-sdk/tool-plugin" {
  import type { TSchema, Static } from "typebox";

  export const toolPluginMetadataSymbol: unique symbol;

  export type ToolPluginExecutionContext = {
    api: unknown;
    signal?: AbortSignal;
    toolCallId: string;
    onUpdate?: (update: unknown) => void;
  };

  type ToolPluginToolDefinition<TConfig, P extends TSchema> = {
    name: string;
    label?: string;
    description: string;
    parameters: P;
    optional?: boolean;
  } & (
    | {
        execute: (params: Static<P>, config: TConfig, context: ToolPluginExecutionContext) => unknown;
        factory?: never;
      }
    | {
        factory: (context: { api: unknown; config: TConfig; toolContext: unknown }) => unknown;
        execute?: never;
      }
  );

  type ToolPluginToolFactory<TConfig> = <P extends TSchema>(
    definition: ToolPluginToolDefinition<TConfig, P>,
  ) => unknown;

  export type DefinedToolPluginEntry = {
    register: (api: unknown) => void;
    readonly [toolPluginMetadataSymbol]: {
      id: string;
      name: string;
      description: string;
      tools: { name: string; label: string; description: string; parameters: unknown; optional?: boolean }[];
    };
  };

  export function defineToolPlugin<TConfigSchema extends TSchema | undefined = undefined>(definition: {
    id: string;
    name: string;
    description: string;
    activation?: unknown;
    configSchema?: TConfigSchema;
    tools: (
      tool: ToolPluginToolFactory<TConfigSchema extends TSchema ? Static<TConfigSchema> : Record<string, never>>,
    ) => readonly unknown[];
  }): DefinedToolPluginEntry;
}
```

## File: plugins/agent-passport/test/manifest.test.mjs
size: 1247
sha: 41d7e2bd04b1268e5eed844e24379e47a1fc8d8c
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/test/manifest.test.mjs

```text
/**
 * Host-contract guard: OpenClaw (>= 2026.6.x) registers a plugin's agent tools only
 * when openclaw.plugin.json declares them in contracts.tools, and discovers the
 * plugin only through package.json openclaw.extensions. Regenerate the manifest
 * with `openclaw plugins build --root . --entry src/index.ts` after changing tools
 * or config. No build needed: this reads the JSON files only.
 */
import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";

const root = join(dirname(fileURLToPath(import.meta.url)), "..");
const manifest = JSON.parse(readFileSync(join(root, "openclaw.plugin.json"), "utf8"));
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));

test("manifest declares every tool in contracts.tools", () => {
  assert.deepEqual(manifest.contracts?.tools, ["get_agent_passport", "verify_agent_identity"]);
});

test("package.json points OpenClaw at the entry and the manifest version matches", () => {
  assert.deepEqual(pkg.openclaw?.extensions, ["./src/index.ts"]);
  assert.equal(manifest.version, pkg.version);
  assert.equal(manifest.id, "agent-passport");
});
```

## File: plugins/agent-passport/test/passport.test.mjs
size: 8432
sha: 3fcca0dac36c9d948afee7e0407de736ba7dae09
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/test/passport.test.mjs

```text
/**
 * Unit tests for the host-free passport core (../dist/passport.js).
 *
 * Hermetic — no live RPC. Covers PDA derivation determinism + correctness,
 * the tool factory (names/params/no-arg guard), the legacy program IDs and their
 * retired status, and the public RPC default. Run after `npm run build` (the test script builds first).
 */
import test from "node:test";
import assert from "node:assert/strict";
import { PublicKey } from "@solana/web3.js";
import { createHash } from "node:crypto";

import {
  DARK_SECP256K1_AUTH,
  DEFAULT_RPC,
  PROGRAMS,
  PROGRAM_STATUS,
  readConfig,
  deriveEthBindingPda,
  deriveSolAgentPda,
  buildPassportTools,
} from "../dist/passport.js";

// SHA-256 of compromised program IDs this repo once referenced (held hashed, never named),
// including the gen-1 x402 access gate and the secp256r1 vault.
const COMPROMISED_SHA256 = new Set([
  "d8406486dd119717648b5b6e6f4b8b9a044536b3ab95c34da437add15c5cac36",
  "efa8237fa114259344b44de2f79c21583ec464ffe5186876c35595bbd11983a1",
  "a7656054f294394e546b39f90c03a0cb31446ac46c37285f5bfc900b3bcea827",
  "35a832bc1dff671d6a806d63ea404ed181ed9675c49d513889e4a3aabda68423",
  "7abaeaa69c452dd5349bbde0858b343984fdef2e1bf32359248915b777c535bc",
  "0a81ba274124ff3e0e1ccc8751aaf0502e64ae7cd7ca1c01b2ac2307e0fe7888",
  "b851c1d6562bf9e70e2033a2db83d21fc5b249eab440a751d5638b285a4596c0",
  "a47c1fce4236ba82d1b46be7c5f1a88e7cb8e884a505b4166f1787b25f0ff7d2",
]);
const sha256 = (s) => createHash("sha256").update(s).digest("hex");
const SAMPLE_ETH = "0x742d35cc6634c0532925a3b844bc454e4438f44e";
const SAMPLE_WALLET = "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"; // a valid base58 pubkey

// ── program IDs / RPC ─────────────────────────────────────────────────────────

test("no seized pre-incident program ID is referenced", () => {
  for (const id of [DARK_SECP256K1_AUTH, ...Object.values(PROGRAMS)]) {
    assert.ok(!COMPROMISED_SHA256.has(sha256(id)), `${id} is a compromised ID and must not be used`);
  }
  for (const v of Object.values(PROGRAM_STATUS)) {
    for (const word of v.match(/[1-9A-HJ-NP-Za-km-z]{32,44}/g) ?? []) {
      assert.ok(!COMPROMISED_SHA256.has(sha256(word)), "status text names a compromised ID");
    }
  }
});

test("default RPC is the approved public node (never api.mainnet-beta)", () => {
  assert.equal(DEFAULT_RPC, "https://solana-rpc.publicnode.com");
  assert.doesNotMatch(DEFAULT_RPC, /api\.mainnet-beta\.solana\.com/);
});

test("PROGRAMS maps only the legacy ETH-binding program (no WebAuthn vault, no closed receipt_anchor)", async () => {
  assert.deepEqual(Object.keys(PROGRAMS), ["dark_secp256k1_auth"]);
  assert.equal(PROGRAMS.dark_secp256k1_auth, DARK_SECP256K1_AUTH);
  const mod = await import("../dist/passport.js");
  assert.equal("RECEIPT_ANCHOR" in mod, false, "RECEIPT_ANCHOR export removed");
  // SHA-256 of the closed mainnet receipt_anchor id: no shipped source may name it.
  const closedAnchorSha = "8170f04125228f9437170d731d01978ae865721cda0f2c644fa677ec6c7062cc";
  for (const word of JSON.stringify({ PROGRAMS, PROGRAM_STATUS }).match(/[1-9A-HJ-NP-Za-km-z]{32,44}/g) ?? []) {
    assert.notEqual(sha256(word), closedAnchorSha);
  }
});

// ── PDA derivation ────────────────────────────────────────────────────────────

test("deriveEthBindingPda: deterministic + on dark_secp256k1_auth", () => {
  const a = deriveEthBindingPda(SAMPLE_ETH);
  const b = deriveEthBindingPda(SAMPLE_ETH);
  assert.equal(a, b, "same input must yield same PDA");
  assert.ok(a, "should derive a PDA");
  // 0x-prefixed and bare hex must agree
  assert.equal(deriveEthBindingPda(SAMPLE_ETH.slice(2)), a);
  // recompute the expected PDA independently
  const [expected] = PublicKey.findProgramAddressSync(
    [Buffer.from("eth_agent"), Buffer.from(SAMPLE_ETH.slice(2), "hex")],
    new PublicKey(DARK_SECP256K1_AUTH),
  );
  assert.equal(a, expected.toBase58());
});

test("deriveEthBindingPda: rejects malformed addresses", () => {
  assert.equal(deriveEthBindingPda("0x1234"), null);
  assert.equal(deriveEthBindingPda("not-hex-at-all"), null);
  assert.equal(deriveEthBindingPda(""), null);
});

test("deriveSolAgentPda: deterministic, correct seeds", () => {
  const sol = deriveSolAgentPda(SAMPLE_WALLET);
  assert.ok(sol);
  assert.equal(sol, deriveSolAgentPda(SAMPLE_WALLET));

  const wallet = new PublicKey(SAMPLE_WALLET);
  const [expSol] = PublicKey.findProgramAddressSync(
    [Buffer.from("sol_agent"), wallet.toBytes()],
    new PublicKey(DARK_SECP256K1_AUTH),
  );
  assert.equal(sol, expSol.toBase58());
});

test("PDA derivers return null on malformed wallet", () => {
  assert.equal(deriveSolAgentPda("not-a-pubkey"), null);
  assert.equal(deriveSolAgentPda("???"), null);
});

// ── config ────────────────────────────────────────────────────────────────────

test("readConfig keeps strings, drops non-strings", () => {
  const cfg = readConfig({ solanaWallet: SAMPLE_WALLET, ethAddress: 123, nullName: "a.null" });
  assert.equal(cfg.solanaWallet, SAMPLE_WALLET);
  assert.equal(cfg.ethAddress, undefined); // 123 is not a string
  assert.equal(cfg.nullName, "a.null");
  assert.deepEqual(readConfig(undefined), {
    solanaWallet: undefined,
    ethAddress: undefined,
    nullName: undefined,
    rpcUrl: undefined,
  });
});

// ── tool factory ──────────────────────────────────────────────────────────────

test("buildPassportTools registers exactly the two read-only identity tools", () => {
  const tools = buildPassportTools(readConfig({ nullName: "me.null" }));
  assert.equal(tools.length, 2);
  const names = tools.map((t) => t.name);
  assert.deepEqual(names.sort(), ["get_agent_passport", "verify_agent_identity"]);
  for (const t of tools) {
    assert.equal(typeof t.handler, "function");
    assert.equal(typeof t.description, "string");
    assert.equal(typeof t.parameters, "object");
  }
});

test("verify_agent_identity rejects an empty target without any network call", async () => {
  const [, verify] = buildPassportTools(readConfig({}));
  const res = await verify.handler({});
  assert.equal(res.ok, false);
  assert.match(res.error, /at least one of/i);
});

test("verify_agent_identity exposes the three target params", () => {
  const [, verify] = buildPassportTools(readConfig({}));
  assert.deepEqual(
    Object.keys(verify.parameters).sort(),
    ["target_eth_address", "target_null_name", "target_solana_wallet"],
  );
});

// ── retired-program status (read-only plugin) ────────────────────────────────

test("PROGRAM_STATUS marks every listed program retired, keyed like PROGRAMS", () => {
  assert.deepEqual(Object.keys(PROGRAM_STATUS).sort(), Object.keys(PROGRAMS).sort());
  for (const [k, v] of Object.entries(PROGRAM_STATUS)) {
    assert.match(v, /^retired/, `${k} must be reported retired`);
    assert.match(v, /readable/, `${k} must say its accounts stay readable`);
  }
});

test("tool descriptions state read-only access to retired programs (no live claims)", () => {
  for (const t of buildPassportTools(readConfig({}))) {
    assert.match(t.description, /Read-only/);
    assert.match(t.description, /retired/);
    assert.doesNotMatch(t.description, /\blive\b/i);
  }
});

test("verify_agent_identity result carries program_status (fake connection, no network)", async () => {
  // Point at a closed local port: accountExists() swallows the failure → false,
  // so the handler completes without any external network access.
  const [, verify] = buildPassportTools(readConfig({ rpcUrl: "http://127.0.0.1:9" }));
  const res = await verify.handler({ target_solana_wallet: SAMPLE_WALLET });
  assert.equal(res.ok, true);
  assert.deepEqual(res.program_status, PROGRAM_STATUS);
  assert.equal(res.registered.sol_agent, false);
  assert.equal("webauthn_vault" in res.registered, false);
  assert.equal("webauthn_vault_pda" in res.pdas, false);
});
```

## File: plugins/agent-passport/tsconfig.json
size: 431
sha: ec4f565b2c69ac6aa57853e5258abc2e42b0d0c7
upstream: https://github.com/parad0x-labs/openclaw-skills/blob/main/plugins/agent-passport/tsconfig.json

```text
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "lib": ["ES2022", "DOM"],
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "types": ["node"]
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}
```
