跳到正文
cccskills
免费在 GitHub 公开

self-xyz

Integrate Self (self.xyz) — a privacy-first identity protocol using zero-knowledge proofs to verify passports and ID cards. Use when the user mentions Self protocol, Self identity, self.xyz, passport verification, zero-knowledge identity verification, SelfAppBuilder, SelfBackendVerifier, SelfVerificationRoot, or wants to add privacy-preserving KYC, age verification, nationality checks, OFAC screening, or Sybil resistance using real-world identity documents. Covers frontend QR code integration, backend proof verification, and on-chain smart contract verification on Celo.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(5)

  • SKILL.md5.5 KB
  • _meta.json288 B
  • references/backend.md3.7 KB
  • references/contracts.md4.4 KB
  • references/frontend.md4.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Self Protocol Integration

Self lets users prove identity attributes (age, nationality, humanity) from passports/ID cards using zero-knowledge proofs — no personal data exposed. Users scan their document's NFC chip in the Self mobile app and share a zk proof with your app.

Quick Start (Next.js Off-Chain)

1. Install

npm install @selfxyz/qrcode @selfxyz/core

2. Frontend — QR Code Component

"use client";
import { SelfQRcodeWrapper, SelfAppBuilder } from "@selfxyz/qrcode";

export default function VerifyIdentity({ userId }: { userId: string }) {
  const selfApp = new SelfAppBuilder({
    appName: "My App",
    scope: "my-app-scope",
    endpoint: "https://yourapp.com/api/verify",
    endpointType: "https",
    userId,
    userIdType: "hex",
    disclosures: {
      minimumAge: 18,
    },
  }).build();

  return (
    <SelfQRcodeWrapper
      selfApp={selfApp}
      onSuccess={() => console.log("Verified")}
      type="websocket"
      darkMode={false}
    />
  );
}

3. Backend — Verification Endpoint

// app/api/verify/route.ts
import { SelfBackendVerifier, DefaultConfigStore } from "@selfxyz/core";

export async function POST(req: Request) {
  const { proof, publicSignals } = await req.json();

  const verifier = new SelfBackendVerifier(
    "my-app-scope",                    // must match frontend scope
    "https://yourapp.com/api/verify",  // must match frontend endpoint
    true,                              // true = accept mock passports (dev only)
    null,                              // allowedIds (null = all)
    new DefaultConfigStore({           // must match frontend disclosures
      minimumAge: 18,
    })
  );

  const result = await verifier.verify(proof, publicSignals);

  return Response.json({
    verified: result.isValid,
    nationality: result.credentialSubject?.nationality,
  });
}

Integration Patterns

PatternWhen to UseendpointendpointType
Off-chain (backend)Web apps, APIs, most casesYour API URL"https" or "https-staging"
On-chain (contract)DeFi, token gating, airdropsContract address (lowercase)"celo" or "celo-staging"
Deep linkingMobile-first flowsYour API URL"https"
  • Off-chain: Fastest to implement. Proof sent to your backend, verified server-side.
  • On-chain: Proof verified by Celo smart contract. Inherit SelfVerificationRoot. Use for trustless/permissionless scenarios.
  • Deep linking: For mobile users — opens Self app directly instead of QR scan. See references/frontend.md.

Critical Gotchas

  1. Config matching is mandatory — Frontend disclosures must EXACTLY match backend/contract verification config. Mismatched age thresholds, country lists, or OFAC settings cause silent failures.

  2. Contract addresses must be lowercase — Non-checksum format in frontend endpoint. Use .toLowerCase().

  3. Country codes are ISO 3-letter — e.g., "USA", "IRN", "PRK". Max 40 countries in exclusion lists.

  4. Mock passports = testnet only — Set mockPassport: true in backend / use "celo-staging" endpoint type. Real passports require mainnet. To create a mock passport: open Self app, tap the Passport button 5 times. Mock testing requires OFAC disabled.

  5. Version requirement — @selfxyz/core >= 1.1.0-beta.1.

  6. Attestation IDs — 1 = Passport, 2 = Biometric ID Card. Must explicitly allow via allowedIds map.

  7. Scope uniqueness — On-chain, scope is Poseidon-hashed with contract address, preventing cross-contract proof replay.

  8. Endpoint must be publicly accessible — Self app sends proof directly to your endpoint. Use ngrok for local development.

  9. Common errors: ScopeMismatch = scope/address mismatch or non-lowercase address. Invalid 'to' Address = wrong endpointType (celo vs https). InvalidIdentityCommitmentRoot = real passport on testnet (use mainnet). Invalid Config ID = mock passport on mainnet (use testnet).

Deployed Contracts (Celo)

NetworkAddress
Mainnet Hub V20xe57F4773bd9c9d8b6Cd70431117d353298B9f5BF
Sepolia Hub V20x16ECBA51e18a4a7e61fdC417f0d47AFEeDfbed74
Sepolia Staging Hub V20x68c931C9a534D37aa78094877F46fE46a49F1A51

References

Load these for deeper integration details:

  • references/frontend.md — SelfAppBuilder full config, SelfQRcodeWrapper props, deep linking with getUniversalLink, disclosure options
  • references/backend.md — SelfBackendVerifier constructor details, DefaultConfigStore vs InMemoryConfigStore, verification result schema, dynamic configs
  • references/contracts.md — SelfVerificationRoot inheritance pattern, Hub V2 interaction, setVerificationConfigV2, customVerificationHook, getConfigId, userDefinedData patterns

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

0protocol

免费

Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.

中文简介正在准备中。当前显示原文说明。

johnalbertini14-glitch/openclaw-skills22026年2月26日 更新

0xarchive

免费

Query historical crypto market data from 0xArchive across Hyperliquid, Lighter.xyz, and HIP-3. Covers orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality. Use when the user asks about crypto market data, orderbooks, trades, funding rates, or historical prices on Hyperliquid, Lighter.xyz, or HIP-3.

中文简介正在准备中。当前显示原文说明。

johnalbertini14-glitch/openclaw-skills22026年2月26日 更新

Calculate ROI for AI-as-a-Service (managed AI agents). Estimates cost savings, efficiency gains, and payback period for deploying AI agents across business operations. Use when evaluating whether managed AI agents make financial sense for a company.

中文简介正在准备中。当前显示原文说明。

johnalbertini14-glitch/openclaw-skills22026年2月26日 更新

Design, build, deploy, and operate production AI agent systems — single agents, multi-agent teams, and autonomous swarms. Complete methodology from agent architecture through orchestration, memory systems, safety guardrails, and operational excellence.

中文简介正在准备中。当前显示原文说明。

johnalbertini14-glitch/openclaw-skills22026年2月26日 更新

Design, build, test, document, and secure production-grade APIs. Covers the full lifecycle from schema design through deployment, monitoring, and versioning. Use when designing new APIs, reviewing existing ones, generating OpenAPI specs, building test suites, or debugging production issues.

中文简介正在准备中。当前显示原文说明。

johnalbertini14-glitch/openclaw-skills22026年2月26日 更新

Turn your AI agent into a business automation architect. Design, document, implement, and monitor automated workflows across sales, ops, finance, HR, and support — no n8n or Zapier required.

中文简介正在准备中。当前显示原文说明。

johnalbertini14-glitch/openclaw-skills22026年2月26日 更新

查看 johnalbertini14-glitch 的全部技能

报告此技能的问题