← 返回 Skills 市场
zbruceli

dchat

作者 Zheng "Bruce" Li · GitHub ↗ · v0.4.0 · MIT-0
cross-platform ⚠ suspicious
272
总下载
0
收藏
0
当前安装
9
版本数
在 OpenClaw 中安装
/install dchat
功能描述
Decentralized P2P bot-to-bot messaging over NKN. Send and receive text, images, audio, and files without any centralized server. Private, encrypted, serverless.
使用说明 (SKILL.md)

dchat — Decentralized P2P Messaging Skill

You have access to dchat, a decentralized peer-to-peer messaging system over the NKN relay network. Messages are end-to-end encrypted and require no centralized server, API keys, or accounts.

Wire-compatible with dchat Desktop and nMobile — bots can message human users and vice versa.

Commands

Run these commands using your shell execution tool. The dchat wrapper is in the skill directory at {baseDir}.

Identity (no network needed)

{baseDir}/dchat init                              # Generate bot identity (first time, auto-run at install)
{baseDir}/dchat address                           # Print bot's NKN address

Contacts (no network needed)

{baseDir}/dchat contacts add \x3Caddress> \x3Calias>    # Add a contact with alias
{baseDir}/dchat contacts remove \x3Calias>           # Remove a contact
{baseDir}/dchat contacts list                     # List all contacts

Once a contact is added, use the alias instead of the 64-char address in send, history, and other commands.

Messaging (connects to NKN, ~5-8s per send)

{baseDir}/dchat send \x3Caddress> Hello world!       # Send text message
{baseDir}/dchat send-image \x3Caddress> ./photo.jpg  # Send image (encrypted, via IPFS)
{baseDir}/dchat send-audio \x3Caddress> ./voice.aac  # Send audio file
{baseDir}/dchat send-file \x3Caddress> ./report.pdf  # Send any file (encrypted, via IPFS)

Output on success: Connecting... then Sent: \x3Cmessage-id>. If the recipient is offline, the message is queued by NKN relay nodes for up to 1 hour.

Receiving

{baseDir}/dchat listen                            # Listen for messages (daemon, Ctrl+C to stop)

Output format:

[HH:MM:SS] \x3Csender-prefix>...: \x3Ctext>
[HH:MM:SS] \x3Csender-prefix>...: [image] /path/to/downloaded.jpg
[HH:MM:SS] \x3Csender-prefix>...: [audio] /path/to/downloaded.aac
[HH:MM:SS] \x3Csender-prefix>...: [file: report.pdf] /path/to/downloaded.pdf

History (no network needed)

{baseDir}/dchat history \x3Caddress>                 # Show last 50 messages with peer
{baseDir}/dchat history \x3Caddress> 100             # Show last 100 messages

Interactive REPL

{baseDir}/dchat interactive                       # Full interactive mode with /send /file etc.

Options

{baseDir}/dchat --seed \x3C64-char-hex> address      # Use specific seed
{baseDir}/dchat --data-dir /custom/path init      # Custom data directory

When to Use

Use this skill when the user or another agent wants to:

  • Send or receive messages to/from another bot or NKN user
  • Transfer files, images, or audio to a peer
  • Set up a listening bot that reacts to incoming messages
  • Check message history with a peer
  • Get the bot's NKN address to share with others

Key Concepts

  • NKN Address: 64-char hex public key. Each bot gets a unique address derived from its seed. Can be derived offline.
  • Seed: 64-char hex Ed25519 private key. Auto-generated at install, saved encrypted to ~/.dchat-clawhub/identity.enc.
  • Media: Encrypted with AES-128-GCM, uploaded to IPFS, key sent over NKN. Recipients auto-download and decrypt.
  • History: All messages stored in SQLite at ~/.dchat-clawhub/messages.db.
  • Receipts: Delivery and read receipts are automatic.

Security

  • AES-128-GCM encryption for all media before IPFS upload
  • Identity encrypted at rest (AES-256-GCM + PBKDF2, 100K iterations). Encryption key (.passkey) stored in separate OS config directory (/.config/dchat-clawhub/) from the ciphertext (/.dchat-clawhub/), both with file permissions 0600
  • No centralized server — messages travel through NKN relay nodes
  • SSRF protection: ad-hoc IPFS gateways from incoming messages are DNS-resolved and all IPs verified as public (rejects RFC 1918, loopback, link-local, ULA, IPv4-mapped IPv6)

Network & Storage

  • Connects to NKN seed RPC servers (seed.nkn.org) for P2P relay
  • Uploads/downloads encrypted media via public IPFS gateways (ipfs.io, dweb.link)
  • Stores messages in local SQLite database (~/.dchat-clawhub/messages.db)
  • Caches downloaded media in ~/.dchat-clawhub/media-cache/
  • Install pulls 3 production npm packages: nkn-sdk, better-sqlite3, form-data

Limitations

  • Each send takes ~5-8 seconds (NKN connect + 3s stabilization + relay dispatch)
  • Offline messages held by NKN relay nodes for up to 1 hour
  • Max file size: 100 MB
  • Requires internet access to reach NKN seed nodes
安全使用建议
What to consider before installing: - Packaging/installation concerns: install.sh expects a built JS at dist/cli.js and SKILL.md references a wrapper named 'dchat' at {baseDir}, but the package shows TypeScript sources and a bin named 'dchat-bot' instead. This likely means the packaged skill is missing prebuilt artifacts or the manifest is inconsistent. Install may fail or behave differently than documented — ask the publisher for a verified build or for corrected installer/wrapper files. - Network & storage: the skill will contact NKN seed RPC servers and public IPFS gateways (ipfs.io, dweb.link) and will upload/download encrypted media. It stores an encrypted private seed and a separate passkey under your home directory (~/.dchat-clawhub/ and ~/.config/dchat-clawhub/). If you accept this skill, expect these files and outgoing network traffic. - Dependencies: install runs npm install (--omit=dev) and will fetch native modules (better-sqlite3) from npm; that can compile native code. Only use on systems where you trust packages from the npm registry or sandbox the install. - Safety checks: inspect or request the built dist/cli.js that will actually run during install, confirm there are no telemetry or unexpected remote endpoints in the built artifacts, and verify the wrapper name used by the agent (dchat vs dchat-bot). If you are unsure, run the skill in an isolated environment (VM/container) first. - Autonomous invocation: the skill is model-invocable by default (normal for skills). It is not force-included (always:false). If you are concerned about an agent initiating networked messaging, restrict model-invocation or require explicit user invocation. If you want, I can list exact files/lines that reference the build/wrapper mismatch and the identity/storage paths to help you ask the author for clarification or verify a prebuilt release.
功能分析
Type: OpenClaw Skill Name: dchat Version: 0.4.0 The dchat skill provides decentralized P2P messaging over the NKN network with a strong focus on security and privacy. It implements AES-128-GCM for end-to-end encryption of media files transferred via IPFS and protects the bot's identity at rest using AES-256-GCM with PBKDF2 (100k iterations), storing the passkey and ciphertext in separate directories with restrictive (0600) permissions. Notably, it includes DNS-based SSRF protection in `src/ipfs.ts` to validate that ad-hoc IPFS gateways are public before connection. The code is well-structured, includes comprehensive tests, and shows no signs of malicious intent or unauthorized data exfiltration.
能力评估
Purpose & Capability
Overall the code (NKN client, IPFS media handling, local SQLite storage, encrypted identity) is consistent with the stated decentralized P2P messaging purpose. Dependencies (nkn-sdk, better-sqlite3, form-data) are appropriate. Minor mismatch: SKILL.md/README refer to a 'dchat' wrapper and slash command '/dchat', package.json defines a bin named 'dchat-bot' and install.sh invokes node dist/cli.js; this inconsistency suggests packaging or naming errors but not malicious intent.
Instruction Scope
Runtime instructions limit actions to identity init, sending/listening, and local storage. The CLI and SKILL.md reference creating an encrypted identity (~/.dchat-clawhub/identity.enc) and storing a passkey at ~/.config/dchat-clawhub/.passkey (0600), reading/migrating legacy seed files if present, storing messages in SQLite, and uploading encrypted media to public IPFS gateways. Those file reads/writes are within scope for a messaging client. The instructions do reference executing the wrapper at {baseDir}/dchat, but no such wrapper is present in the manifest — an inconsistency between instructions and shipped files.
Install Mechanism
There is no formal install spec in registry metadata, but an install.sh is provided which runs `npm install --omit=dev` then expects `dist/cli.js` to exist and runs `node dist/cli.js init`. The repository file manifest contains TypeScript source (src/) but does not list dist/; unless a prebuilt dist/ is actually shipped, install.sh will fail. The SKILL.md instructs using a wrapper at {baseDir}/dchat, yet no such wrapper file is shown; package.json's bin is 'dchat-bot'. These packaging / build mismatches could break installation or cause unexpected behavior during install. The npm install step will download native modules (better-sqlite3) and other npm packages from the public registry — expected but worth noting.
Credentials
The skill requests no environment variables or external credentials. It stores local secrets (generated seed and passkey) in user home and config directories; this is proportional for a messaging client. Network access is required to contact NKN seed RPC servers and public IPFS gateways (documented). No unrelated credentials or config paths are requested.
Persistence & Privilege
The skill persists an encrypted identity and message DB under the user's home (~/.dchat-clawhub and ~/.config/dchat-clawhub/.passkey) and runs as a CLI/daemon when invoked. It does not request 'always: true' and does not appear to modify other skills or global agent config. Persisting local encrypted keys and DB is expected, but you should be aware it will create files in your home directory.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dchat
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dchat 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.4.0
Add contact aliases (dchat contacts add/remove/list), use aliases in send/history/listen. Clean up debug logs, update docs.
v0.3.4
Fix send to external peers: add 3s stabilization delay after NKN connect to let all sub-clients establish relay routes before sending. Root cause of 'Message timeout' when recipient was actually online.
v0.3.3
Diagnostics: send now prints From/To/DataDir to help debug routing. Distinguish 'failed to send' (message NOT queued) from 'timeout' (message queued, recipient offline).
v0.3.2
Fix CLI send: await NKN relay dispatch before exit. Messages now confirmed queued by relay nodes. Offline peers get message when they come online. Clean exit with no teardown noise.
v0.3.1
Fix crash when sending to offline peers: catch floating promise rejection from NKN SDK fire-and-forget send. Increased dispatch wait to 3s.
v0.3.0
Fix /dchat invocation error: remove command-dispatch:tool (bash tool not available in OpenClaw), use {baseDir} for skill path resolution
v0.2.1
Reduce install surface: ship pre-built dist/, install only 3 production deps. Separate passkey from ciphertext: .passkey stored in ~/.config/dchat-clawhub/ (not alongside identity.enc). Added full network/storage transparency in SKILL.md.
v0.2.0
Address security scan: replace hardcoded IPFS IP with public gateways (ipfs.io, dweb.link), fix installer to show errors and include build deps, use random passphrase instead of deterministic, remove local dev path
v0.1.0
Initial release: decentralized P2P bot-to-bot messaging over NKN with encrypted media transfer
元数据
Slug dchat
版本 0.4.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 9
常见问题

dchat 是什么?

Decentralized P2P bot-to-bot messaging over NKN. Send and receive text, images, audio, and files without any centralized server. Private, encrypted, serverless. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 272 次。

如何安装 dchat?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install dchat」即可一键安装,无需额外配置。

dchat 是免费的吗?

是的,dchat 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

dchat 支持哪些平台?

dchat 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 dchat?

由 Zheng "Bruce" Li(@zbruceli)开发并维护,当前版本 v0.4.0。

💬 留言讨论