Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

nostrnostr 搜索

Agent Skill

nostr 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

475

周安装

20

GitHub Stars

30

下载量

166
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nostr(nostr 搜索)
来源仓库:https://github.com/purrgrammer/grimoire
仓库路径:skills/nostr
安装命令:
npx skills add https://github.com/purrgrammer/grimoire --skill nostr
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/purrgrammer/grimoire --skill nostr

简介

nostr 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于根据关键词、任务场景或来源线索进行信息检索和筛选的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前建议确认权限范围和维护状态,注意可能触发联网或文件读写操作。
  • nostr 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Nostr Protocol Expert

Purpose

This skill provides expert-level assistance with the Nostr protocol, a simple, open protocol for global, decentralized, and censorship-resistant social networks. The protocol is built on relays and cryptographic keys, enabling direct peer-to-peer communication without central servers.

When to Use

Activate this skill when:

  • Implementing Nostr clients or relays
  • Working with Nostr events and messages
  • Handling cryptographic signatures and keys (schnorr signatures on secp256k1)
  • Implementing any Nostr Implementation Possibility (NIP)
  • Building social networking features on Nostr
  • Querying or filtering Nostr events
  • Discussing Nostr protocol architecture
  • Implementing WebSocket communication with relays

Core Concepts

The Protocol Foundation

Nostr operates on two main components:

  1. Clients - Applications users run to read/write data
  2. Relays - Servers that store and forward messages

Key principles:

  • Everyone runs a client
  • Anyone can run a relay
  • Users identified by public keys
  • Messages signed with private keys
  • No central authority or trusted servers

Events Structure

All data in Nostr is represented as events. An event is a JSON object with this structure:

{
  "id": "<32-bytes lowercase hex-encoded sha256 of the serialized event data>",
  "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
  "created_at": "<unix timestamp in seconds>",
  "kind": "<integer identifying event type>",
  "tags": [
    ["<tag name>", "<tag value>", "<optional third param>", "..."]
  ],
  "content": "<arbitrary string>",
  "sig": "<64-bytes lowercase hex of the schnorr signature of the sha256 hash of the serialized event data>"
}

Event Kinds

Standard event kinds (from various NIPs):

  • 0 - Metadata (user profile)
  • 1 - Text note (short post)
  • 2 - Recommend relay
  • 3 - Contacts (following list)
  • 4 - Encrypted direct messages
  • 5 - Event deletion
  • 6 - Repost
  • 7 - Reaction (like, emoji reaction)
  • 40 - Channel creation
  • 41 - Channel metadata
  • 42 - Channel message
  • 43 - Channel hide message
  • 44 - Channel mute user
  • 1000-9999 - Regular events
  • 10000-19999 - Replaceable events
  • 20000-29999 - Ephemeral events
  • 30000-39999 - Parameterized replaceable events

Tags

Common tag types:

  • ["e", "<event-id>", "<relay-url>", "<marker>"] - Reference to an event
  • ["p", "<pubkey>", "<relay-url>"] - Reference to a user
  • ["a", "<kind>:<pubkey>:<d-tag>", "<relay-url>"] - Reference to a replaceable event
  • ["d", "<identifier>"] - Identifier for parameterized replaceable events
  • ["r", "<url>"] - Reference/link to a web resource
  • ["t", "<hashtag>"] - Hashtag
  • ["g", "<geohash>"] - Geolocation
  • ["nonce", "<number>", "<difficulty>"] - Proof of work
  • ["subject", "<subject>"] - Subject/title
  • ["client", "<client-name>"] - Client application used

Key NIPs Reference

For detailed specifications, refer to references/nips-overview.md.

Core Protocol NIPs

NIP-01: Basic Protocol Flow

The foundation of Nostr. Defines:

  • Event structure and validation
  • Event ID calculation (SHA256 of serialized event)
  • Signature verification (schnorr signatures)
  • Client-relay communication via WebSocket
  • Message types: EVENT, REQ, CLOSE, EOSE, OK, NOTICE

NIP-02: Contact List and Petnames

Event kind 3 for following lists:

  • Each p tag represents a followed user
  • Optional relay URL and petname in tag
  • Replaceable event (latest overwrites)

NIP-04: Encrypted Direct Messages

Event kind 4 for private messages:

  • Content encrypted with shared secret (ECDH)
  • p tag for recipient pubkey
  • Deprecated in favor of NIP-44

NIP-05: Mapping Nostr Keys to DNS

Internet identifier format: name@domain.com

  • .well-known/nostr.json endpoint
  • Maps names to pubkeys
  • Optional relay list

NIP-09: Event Deletion

Event kind 5 to request deletion:

  • Contains e tags for events to delete
  • Relays should delete referenced events
  • Only works for own events

NIP-10: Text Note References (Threads)

Conventions for e and p tags in replies:

  • Root event reference
  • Reply event reference
  • Mentions
  • Marker types: "root", "reply", "mention"

NIP-11: Relay Information Document

HTTP endpoint for relay metadata:

  • GET request to relay URL
  • Returns JSON with relay information
  • Supported NIPs, software, limitations

Social Features NIPs

NIP-25: Reactions

Event kind 7 for reactions:

  • Content usually "+" (like) or emoji
  • e tag for reacted event
  • p tag for event author

NIP-42: Authentication

Client authentication to relays:

  • AUTH message from relay
  • Client responds with event kind 22242
  • Proves key ownership

NIP-50: Search

Query filter extension for full-text search:

  • search field in REQ filters
  • Implementation-defined behavior

Advanced NIPs

NIP-19: bech32-encoded Entities

Human-readable identifiers:

  • npub: public key
  • nsec: private key (sensitive!)
  • note: note/event ID
  • nprofile: profile with relay hints
  • nevent: event with relay hints
  • naddr: replaceable event coordinate

NIP-44: Encrypted Payloads

Improved encryption for direct messages:

  • Versioned encryption scheme
  • Better security than NIP-04
  • ChaCha20-Poly1305 AEAD

NIP-65: Relay List Metadata

Event kind 10002 for relay lists:

  • Read/write relay preferences
  • Optimizes relay discovery
  • Replaceable event

Client-Relay Communication

WebSocket Messages

From Client to Relay

EVENT - Publish an event:

["EVENT", <event JSON>]

REQ - Request events (subscription):

["REQ", <subscription_id>, <filters JSON>, <filters JSON>, ...]

CLOSE - Stop a subscription:

["CLOSE", <subscription_id>]

AUTH - Respond to auth challenge:

["AUTH", <signed event kind 22242>]

From Relay to Client

EVENT - Send event to client:

["EVENT", <subscription_id>, <event JSON>]

OK - Acceptance/rejection notice:

["OK", <event_id>, <true|false>, <message>]

EOSE - End of stored events:

["EOSE", <subscription_id>]

CLOSED - Subscription closed:

["CLOSED", <subscription_id>, <message>]

NOTICE - Human-readable message:

["NOTICE", <message>]

AUTH - Authentication challenge:

["AUTH", <challenge>]

Filter Objects

Filters select events in REQ messages:

{
  "ids": ["<event-id>", ...],
  "authors": ["<pubkey>", ...],
  "kinds": [<kind number>, ...],
  "#e": ["<event-id>", ...],
  "#p": ["<pubkey>", ...],
  "#a": ["<coordinate>", ...],
  "#t": ["<hashtag>", ...],
  "since": <unix timestamp>,
  "until": <unix timestamp>,
  "limit": <max number of events>
}

Filtering rules:

  • Arrays are ORed together
  • Different fields are ANDed
  • Tag filters: #<single-letter> matches tag values
  • Prefix matching allowed for ids and authors

Cryptographic Operations

Key Management

  • Private Key: 32-byte random value, keep secure
  • Public Key: Derived via secp256k1
  • Encoding: Hex (lowercase) or bech32

Event Signing (schnorr)

Steps to create a signed event:

  1. Set all fields except id and sig
  2. Serialize event data to JSON (specific order)
  3. Calculate SHA256 hash → id
  4. Sign id with schnorr signature → sig

Serialization format for ID calculation:

[
  0,
  <pubkey>,
  <created_at>,
  <kind>,
  <tags>,
  <content>
]

Event Verification

Steps to verify an event:

  1. Verify ID matches SHA256 of serialized data
  2. Verify signature is valid schnorr signature
  3. Check created_at is reasonable (not far future)
  4. Validate event structure and required fields

Implementation Best Practices

For Clients

  1. Connect to Multiple Relays: Don't rely on single relay
  2. Cache Events: Reduce redundant relay queries
  3. Verify Signatures: Always verify event signatures
  4. Handle Replaceable Events: Keep only latest version
  5. Respect User Privacy: Careful with sensitive data
  6. Implement NIP-65: Use user's preferred relays
  7. Proper Error Handling: Handle relay disconnections
  8. Pagination: Use limit, since, until for queries

For Relays

  1. Validate Events: Check signatures, IDs, structure
  2. Rate Limiting: Prevent spam and abuse
  3. Storage Management: Ephemeral events, retention policies
  4. Implement NIP-11: Provide relay information
  5. WebSocket Optimization: Handle many connections
  6. Filter Optimization: Efficient event querying
  7. Consider NIP-42: Authentication for write access
  8. Performance: Index by pubkey, kind, tags, timestamp

Security Considerations

  1. Never Expose Private Keys: Handle nsec carefully
  2. Validate All Input: Prevent injection attacks
  3. Use NIP-44: For encrypted messages (not NIP-04)
  4. Check Event Timestamps: Reject far-future events
  5. Implement Proof of Work: NIP-13 for spam prevention
  6. Sanitize Content: XSS prevention in displayed content
  7. Relay Trust: Don't trust single relay for critical data

Common Patterns

Publishing a Note

const event = {
  pubkey: userPublicKey,
  created_at: Math.floor(Date.now() / 1000),
  kind: 1,
  tags: [],
  content: "Hello Nostr!",
}
// Calculate ID and sign
event.id = calculateId(event)
event.sig = signEvent(event, privateKey)
// Publish to relay
ws.send(JSON.stringify(["EVENT", event]))

Subscribing to Notes

const filter = {
  kinds: [1],
  authors: [followedPubkey1, followedPubkey2],
  limit: 50
}
ws.send(JSON.stringify(["REQ", "my-sub", filter]))

Replying to a Note

const reply = {
  kind: 1,
  tags: [
    ["e", originalEventId, relayUrl, "root"],
    ["p", originalAuthorPubkey]
  ],
  content: "Great post!",
  // ... other fields
}

Reacting to a Note

const reaction = {
  kind: 7,
  tags: [
    ["e", eventId],
    ["p", eventAuthorPubkey]
  ],
  content: "+", // or emoji
  // ... other fields
}

Development Resources

Essential NIPs for Beginners

Start with these NIPs in order:

  1. NIP-01 - Basic protocol (MUST read)
  2. NIP-19 - Bech32 identifiers
  3. NIP-02 - Following lists
  4. NIP-10 - Threaded conversations
  5. NIP-25 - Reactions
  6. NIP-65 - Relay lists

Testing and Development

  • Relay Implementations: nostream, strfry, relay.py
  • Test Relays: wss://relay.damus.io, wss://nos.lol
  • Libraries: nostr-tools (JS), rust-nostr (Rust), python-nostr (Python)
  • Development Tools: NostrDebug, Nostr Army Knife, nostril
  • Reference Clients: Damus (iOS), Amethyst (Android), Snort (Web)

Key Repositories

Reference Files

For comprehensive NIP details, see:

  • references/nips-overview.md - Detailed descriptions of all standard NIPs
  • references/event-kinds.md - Complete event kinds reference
  • references/common-mistakes.md - Pitfalls and how to avoid them

Quick Checklist

When implementing Nostr:

  • Events have all required fields (id, pubkey, created_at, kind, tags, content, sig)
  • Event IDs calculated correctly (SHA256 of serialization)
  • Signatures verified (schnorr on secp256k1)
  • WebSocket messages properly formatted
  • Filter queries optimized with appropriate limits
  • Handling replaceable events correctly
  • Connected to multiple relays for redundancy
  • Following relevant NIPs for features implemented
  • Private keys never exposed or transmitted
  • Event timestamps validated

Official Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.93%
按下载量换算65

Claude

29.76%
按下载量换算49

Cursor

17.37%
按下载量换算29

Gemini CLI

8.72%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills