技能 p2p-networking
📦

p2p-networking

v1.0.0 中风险 🌐 网络访问

为去中心化应用构建P2P网络

为去中心化平台实现点对点网络需要了解加密通信、谣言协议和分布式状态管理。本技能提供使用Commonware构建经过身份验证和加密的P2P连接的现成模式。

支持: Claude Codex Code(CC)
📊 76 合格
1

下载技能 ZIP

2

在 Claude 中上传

前往 Settings → Capabilities → Skills → Upload skill

3

开启并开始使用

Agent 可读资源

当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。

测试它

正在使用“p2p-networking”。 How do I implement P2P networking for a decentralized code collaboration platform?

预期结果:

  • P2P网络的关键组件:
  • 使用commonware-p2p进行加密通信的网络层
  • 带有连接状态跟踪的对等体管理
  • 包含握手、同步、谣言和保活消息的消息协议
  • 用于去中心化消息传播的谣言协议
  • 用于分布式对象存储的仓库同步
  • 安全措施包括Ed25519身份验证、Noise协议加密、速率限制和对等体评分

正在使用“p2p-networking”。 Show me how to configure network settings for a P2P node

预期结果:

  • NetworkConfig结构包括:
  • listen_addr: 用于传入连接的套接字地址(默认0.0.0.0:9000)
  • bootstrap_nodes: 用于网络发现的初始对等体地址
  • max_connections: 限制并发连接(默认50)
  • connection_timeout: 连接尝试失败前的持续时间
  • keepalive_interval: 检测对等体可用性的心跳频率
  • keypair: 用于节点身份验证的Ed25519密钥对

正在使用“p2p-networking”。 How does the gossip protocol work for message broadcasting?

预期结果:

  • GossipProtocol流程:
  • 使用HashSet跟踪seen_messages以防止重复
  • 选择随机对等体进行扇出传播
  • 新消息被处理并重新广播
  • 重复消息在首次接收后被忽略
  • 使用peer_manager.random_peers()进行对等体选择

安全审计

中风险
v6 • 6/28/2026

The static external command, obfuscation, weak crypto, sensitive file, and reconnaissance findings are false positives caused by markdown fences, diagrams, and domain terms. The skill is publishable, but it has medium inherent risk because it guides users to build inbound P2P networking, peer messaging, gossip, and repository synchronization with untrusted peers.

1
已扫描文件
264
分析行数
5
复核项
0
已忽略误报
能力复核项 (4)

这些是真实的本地能力,对此技能可能是预期行为,因此需要复核,但不会按已确认恶意行为计分。

Inbound P2P Networking Guidance
The skill provides Rust patterns for connecting to peers, broadcasting messages, gossiping data, synchronizing repository objects, and listening on 0.0.0.0:9000. This is legitimate for a P2P networking skill, but it increases exposure to untrusted network traffic if implemented without strict validation, rate limits, and authentication.
The networking behavior is explicit and central to the skill. The risk is contextual rather than malicious because the same file also recommends authentication, encryption, rate limiting, peer scoring, and message validation.
External Command Findings Are Markdown False Positives
The reported Ruby or shell backtick execution locations are markdown inline code spans or fenced Rust examples. No evidence found of executable shell commands, Ruby code, or command construction.
All cited locations are visible markdown formatting or static Rust snippets. There is no shell interpreter, process spawning API, or user-controlled command path.
Weak Cryptography Findings Are False Positives
The cited lines describe authenticated encrypted communication, Noise protocol, and Ed25519 keypairs. No evidence found of MD5, SHA1, DES, RC4, ECB mode, or other weak cryptographic algorithms.
The visible cryptographic terms are modern authentication and encryption choices. The static hits appear to come from broad substring matching, not actual weak algorithm usage.
Obfuscation And Reconnaissance Findings Are False Positives
The bracket-chain and reconnaissance findings are caused by an ASCII network diagram and peer discovery terminology. No evidence found of prompt injection, hidden instructions, encoded payloads, system probing, credential access, or data exfiltration.
The suspicious structures are documentation artifacts and normal peer-networking identifiers. The file contains no directives that attempt to override the evaluator or conceal behavior.

检测到的模式

All-Interfaces Listener Example
审计者: codex 查看审计历史 →

质量评分

55
架构
100
可维护性
87
内容
70
社区
76
安全
83
规范符合性

你能构建什么

构建去中心化网络

使用Commonware原语为新的去中心化应用程序实现P2P网络层

设计谣言协议

为跨节点分布式状态同步创建高效的消息传播系统

定义消息模式

设计用于节点发现、仓库同步和网络公告的通信协议

试试这些提示

基本对等连接
如何在P2P网络中使用Ed25519建立经过身份验证的对等连接?向我展示握手过程。
仓库同步
实现对等体之间的仓库同步。如何查找具有仓库的对等体并获取缺失的对象?
谣言协议
设计用于广播消息的谣言协议。如何防止消息重复并选择用于传播的对等体?
网络配置
配置带有引导节点、连接超时和保活间隔的P2P网络。应该应用哪些安全注意事项?

最佳实践

  • 在建立连接之前,始终使用加密密钥对对对等体进行身份验证
  • 实施消息验证和速率限制以防止拒绝服务攻击
  • 使用带有去重功能的谣言协议来有效传播更新,而不会淹没网络

避免

  • 存储对等体状态时没有连接健康检查或超时机制
  • 允许无限连接而没有最大连接限制
  • 处理消息时未验证其结构和来源

常见问题

哪些平台支持此技能?
兼容Claude、Codex和Claude Code。可与任何能够理解Rust模式的AI助手配合使用。
支持哪些传输协议?
使用QUIC和TCP传输,通过Noise XX协议进行加密握手和Ed25519身份验证。
节点发现如何工作?
使用DHT进行分布式节点发现,加上引导节点用于初始网络入口和对等体公告。
P2P网络下我的数据安全吗?
所有流量都使用Noise协议加密。对等体通过Ed25519签名进行身份验证。速率限制和对等体评分可防止滥用。
为什么消息没有到达所有对等体?
检查引导节点是否可访问,以及对等体评分是否正在断开节点。确保接收对等体上的消息验证通过。
这与libp2p有何不同?
Commonware提供针对性能优化的轻量级原语。默认使用QUIC,并与Simplex BFT共识集成。

开发者详情

文件结构

📄 SKILL.md