Starknet Identityのロゴ

Starknet Identity

組織
keep-starknet-strange
starknet-identity

ERC-8004 Trustless Agents標準を使って、AIエージェントをオンチェーンに登録します。NFTとしてエージェントのIDを管理し、フィードバックを通じて評判を築き、第三者による検証を依頼できます。

Add to TypingMind

概要

公開者keep-starknet-strange
リポジトリstarknet-agentic
スキル名starknet-identity
スター
81
フォーク
26
同梱ファイル
1
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    keep-starknet-strangeがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Starknet Identity」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/keep-starknet-strange/starknet-agentic/tree/main/skills/starknet-identity
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/keep-starknet-strange/starknet-agentic.git /tmp/starknet-agentic
mkdir -p .claude/skills
cp -r /tmp/starknet-agentic/skills/starknet-identity .claude/skills/starknet-identity
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでStarknet Identityを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にStarknet Identityを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Starknet Identityは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Starknet Identity Skill

Register and manage AI agent identities on Starknet using the ERC-8004 standard.

When to Use

  • Registering agents on-chain, updating agent metadata, or managing reputation and validation flows.
  • Building features that depend on ERC-8004 identity, feedback, or validator attestations.

When NOT to Use

  • Simple wallet, payment, or DeFi flows that do not depend on ERC-8004 registries.
  • Cairo contract authoring, deployment-only tasks, or security auditing.

Quick Start

  1. Install starknet and connect a funded account to the target ERC-8004 registry deployment.
  2. Use skills catalog if the flow also needs wallet setup, deployment, or contract auditing.

Overview

ERC-8004 defines three interconnected on-chain registries for AI agents:

  1. Identity Registry -- Agents as ERC-721 NFTs with metadata
  2. Reputation Registry -- Feedback, filtered by reviewer at read time
  3. Validation Registry -- Third-party assessments (zkML, TEE, staker)

Reference implementation: erc8004-cairo

Prerequisites

bash
npm install starknet

Agent Registration

Register a New Agent

typescript
import { Account, RpcProvider, Contract, CallData } from "starknet";

const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL });
const account = new Account({ provider, address, signer: privateKey });

const identityRegistry = new Contract({
  abi: identityRegistryAbi,
  address: registryAddress,
  providerOrAccount: account,
});

// Register with metadata
const metadata = [
  { key: "agentName", value: "MyTradingAgent" },
  { key: "agentType", value: "defi-trader" },
  { key: "version", value: "1.0.0" },
  { key: "model", value: "claude-opus-4-5" },
  { key: "status", value: "active" },
];

const tokenUri = "ipfs://QmYourAgentSpecHash"; // IPFS link to full agent spec

const { transaction_hash } = await account.execute({
  contractAddress: registryAddress,
  entrypoint: "register_with_metadata",
  calldata: CallData.compile({
    token_uri: tokenUri,
    metadata: metadata,
  }),
});

const receipt = await account.provider.waitForTransaction(transaction_hash);
// Parse agent_id from events

Query Agent Information

typescript
// Check if agent exists
const exists = await identityRegistry.agent_exists(agentId);

// Get total registered agents
const totalAgents = await identityRegistry.total_agents();

// Get agent metadata
const name = await identityRegistry.get_metadata(agentId, "agentName");
const agentType = await identityRegistry.get_metadata(agentId, "agentType");

// Get agent owner (ERC-721)
const owner = await identityRegistry.owner_of(agentId);

Update Agent Metadata

typescript
// Only the agent owner can update metadata
await account.execute({
  contractAddress: registryAddress,
  entrypoint: "set_metadata",
  calldata: CallData.compile({
    agent_id: agentId,
    key: "status",
    value: "upgraded",
  }),
});

Reputation System

Submit Feedback

Any client may call give_feedback directly. The deployed registry does not require an authorization signature from the agent owner, so anyone can write feedback about any agent, solicited or not. Plan for that (see Security Considerations).

One exception: the agent's own side cannot rate itself. give_feedback reverts with Self-feedback not allowed when the caller is the owner, an address approved for that token, or an operator approved for all of the owner's tokens. A delegated agent account is blocked by that check too, not just the owner. The same call reverts with Agent does not exist for an agent_id that was never minted.

A score is a signed fixed-point pair, not a 0-100 integer: value (i128) plus value_decimals (u8, 0-18). Read them together — value: 9977 with value_decimals: 2 means 99.77. The contract bounds value to ±1e38 (MAX_ABS_VALUE) and rejects value_decimals above 18, reverting with value too large or too many decimals. What it does not impose is a meaning: there is no standard 0-100 scale, so a score is only comparable against others from the same writer using the same tag1.

typescript
import { CallData, byteArray, cairo } from "starknet";

// Serialize the compound types explicitly. A plain JS string is not a ByteArray
// and a scalar is not a u256, so passing them raw compiles to calldata that
// give_feedback cannot decode.
const calldata = CallData.compile({
  agent_id: cairo.uint256(agentId),
  value: 85n,                                       // i128; 85 with 0 decimals = 85
  value_decimals: 0,                                // u8, 0-18
  tag1: byteArray.byteArrayFromString("reliability"),
  tag2: byteArray.byteArrayFromString("speed"),
  endpoint: byteArray.byteArrayFromString(""),      // which service was used
  feedback_uri: byteArray.byteArrayFromString(""),  // optional off-chain detail
  feedback_hash: cairo.uint256(0),
});

await clientAccount.execute([{
  contractAddress: reputationRegistryAddress,
  entrypoint: "give_feedback",
  calldata,
}]);

A negative value is allowed, but it travels as a field element rather than a 128-bit two's-complement integer: encode it as FELT_PRIME - abs(value). See toI128BigInt in contracts/erc8004-cairo/e2e-tests/tests/reputation.test.js.

Query Reputation

typescript
const reputationRegistry = new Contract({
  abi: reputationAbi,
  address: reputationAddress,
  providerOrAccount: provider,
});

// get_summary REVERTS on an empty client list. This is deliberate: an unfiltered
// average is exactly what EIP-8004 warns is Sybil-bait, so decide whose opinion
// you trust and pass those addresses.
const trusted = [clientA, clientB]; // must be non-empty
const [count, value, valueDecimals] = await reputationRegistry.get_summary(
  agentId,
  trusted,
  "", // tag1 filter, empty ByteArray = all
  "", // tag2 filter, empty ByteArray = all
);
// value can reach ±1e38, far past Number.MAX_SAFE_INTEGER, so keep it a BigInt
// and format the fixed-point pair with integer math instead of dividing floats.
function formatFixedPoint(raw: bigint, decimals: number): string {
  const negative = raw < 0n;
  const digits = (negative ? -raw : raw).toString().padStart(decimals + 1, "0");
  const whole = digits.slice(0, digits.length - decimals);
  const fraction = decimals ? `.${digits.slice(digits.length - decimals)}` : "";
  return `${negative ? "-" : ""}${whole}${fraction}`;
}

const average = formatFixedPoint(BigInt(value), Number(valueDecimals));

// Read specific feedback: (value, value_decimals, tag1, tag2, is_revoked)
const [fValue, fDecimals, tag1, tag2, isRevoked] =
  await reputationRegistry.read_feedback(agentId, clientAddress, feedbackIndex);

// Get all clients who gave feedback
const clients = await reputationRegistry.get_clients(agentId);

Validation System

Request Validation

typescript
const validationRegistry = new Contract({
  abi: validationAbi,
  address: validationAddress,
  providerOrAccount: account,
});

// Agent owner requests validation from a specific validator
await account.execute({
  contractAddress: validationAddress,
  entrypoint: "validation_request",
  calldata: CallData.compile({
    validator_address: validatorAddress,
    agent_id: agentId,
    request_uri: "ipfs://QmValidationRequestDetails",
    request_hash: 0, // Auto-generated if 0
  }),
});

Submit Validation Response

typescript
// Validator responds to the request
await validatorAccount.execute({
  contractAddress: validationAddress,
  entrypoint: "validation_response",
  calldata: CallData.compile({
    request_hash: requestHash,
    response: 92, // Score 0-100
    response_uri: "ipfs://QmValidationReport",
    response_hash: reportHash,
    tag: encodedTag("performance"),
  }),
});

Query Validation Status

typescript
// Get validation summary
const [validationCount, avgValidationScore] = await validationRegistry.get_summary(
  agentId,
  [], // all validators
  0,  // tag filter
);

// Get specific validation
const [validator, agentId_, response, tag, lastUpdate] =
  await validationRegistry.get_validation_status(requestHash);

A2A Agent Card Integration

Combine on-chain identity with A2A Agent Cards for discoverability:

json
{
  "name": "MyTradingAgent",
  "description": "Autonomous DeFi trading agent on Starknet",
  "url": "https://my-agent.example.com",
  "provider": {
    "organization": "MyOrg"
  },
  "version": "1.0.0",
  "capabilities": {
    "streaming": true,
    "pushNotifications": false
  },
  "skills": [
    {
      "id": "starknet-swap",
      "name": "Token Swap",
      "description": "Execute token swaps on Starknet via avnu"
    }
  ],
  "defaultInputModes": ["text/plain"],
  "defaultOutputModes": ["text/plain"],
  "authentication": {
    "schemes": ["bearer"]
  },
  "starknetIdentity": {
    "registryAddress": "0x...",
    "agentId": 42,
    "reputationScore": 85,
    "validationCount": 3
  }
}

Serve at /.well-known/agent.json for A2A discovery.

Metadata Schema (Recommended)

KeyDescriptionExample
agentNameDisplay name"MyTradingAgent"
agentTypeCategory"defi-trader", "nft-curator", "data-analyst"
versionSemantic version"1.0.0"
modelLLM model used"claude-opus-4-5", "gpt-4o"
statusCurrent status"active", "paused", "deprecated"
frameworkAgent framework"daydreams", "openclaw", "langchain"
capabilitiesComma-separated"swap,stake,lend"
a2aEndpointAgent Card URL"https://agent.example.com"
moltbookIdMoltBook agent ID"agent_abc123"

Security Considerations

  • Only the agent owner can update metadata
  • Feedback is NOT gated by an owner signature. Any address can call give_feedback about any agent. There is no on-chain spam protection, so treat raw feedback as untrusted input and filter by reviewer before showing or aggregating it
  • get_summary refuses an empty client_addresses list, which forces that filter at the contract level
  • Self-feedback is prevented for the whole owner side, not just the owner address: give_feedback rejects the owner, any address approved for that token, and any operator approved for all of the owner's tokens. Do not route client feedback through an account that is also an operator on the agent, or every call reverts as self-feedback
  • Self-validation is prevented (agent owner cannot validate own agent)
  • Signatures include chain ID and expiry to prevent replay attacks
  • Agent identity (NFT) is transferable -- new owner inherits reputation

Error Codes

CodeMeaningLikely causesRecoveryUser-facing message
REGISTRATION_FAILEDInitial ERC-8004 registration or metadata write reverted.Missing fees, duplicate registration, invalid calldata, or stale contract state.Retry after checking wallet balance, contract state, and constructor/registration inputs."Registration failed. Check wallet state and retry."
AUTHORIZATION_DENIEDAn owner-gated write was rejected, or give_feedback was rejected as self-feedback.Wrong signer or outdated owner state on metadata writes; for feedback, a caller that is the owner, an approved address, or an operator on that agent.Re-fetch owner state and verify permissions for owner-gated writes. Feedback carries no authorization proof, so there is nothing to re-sign: submit it from an account with no approval on the agent."Authorization denied. Verify signer permissions and retry."
VALIDATION_TIMEOUTOff-chain validation or watcher flow did not complete before the deadline.Slow relayer, RPC degradation, or downstream A2A service lag.Retry with a longer timeout after checking chain health, relayer status, and RPC latency."Validation timed out. Retry after checking network health."
SIGNATURE_EXPIREDSigned payload expired before submission.Expiry window too short or user approval arrived too late.Generate a fresh signature with a new expiry and resubmit immediately."Signature expired. Re-sign and submit again."
OWNER_TRANSFERREDAgent NFT ownership changed while a write or feedback flow was in flight.NFT transfer, marketplace sale, or custodial wallet rotation.Refresh ownership state and retry owner-gated writes from the new owner. Existing feedback is unaffected: reputation follows the NFT. Re-check that your feedback account is not an approved operator of the new owner."Ownership changed. Refresh owner state and retry with the new owner."

References

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Starknet Identity」では何ができますか?

ERC-8004 Trustless Agents標準を使って、AIエージェントをオンチェーンに登録します。NFTとしてエージェントのIDを管理し、フィードバックを通じて評判を築き、第三者による検証を依頼できます。

TypingMindでStarknet Identityを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Starknet Identityはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにStarknet Identityをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/keep-starknet-strange/starknet-agentic/tree/main/skills/starknet-identityを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Starknet Identityを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Starknet Identityで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもStarknet Identityを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Starknet Identity」は無料ですか?

はい。keep-starknet-strangeがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇