Cashu Emoji:隐藏代币编解码 - Openclaw Skills

作者:互联网

2026-03-30

AI教程

什么是 Cashu Emoji?

Cashu Emoji 技能使 AI 代理和开发人员能够将敏感数据(主要是 Cashu 持票人代币)隐藏在看似普通的表情符号中。通过利用 Unicode 变体选择器(VS1..VS256),此实用程序提供了一种离散的方式,通过可能会标记或截断长字符串的消息平台传输代币。作为 Openclaw Skills 生态系统的关键部分,它确保您的代理可以安全且谨慎地处理金融资产。

该工具对于原始代币字符串繁琐或受限的环境特别有用。它允许在视觉表情符号表示与 Cashu 协议中使用的底层加密代币之间进行无缝转换,使其成为构建金融自动化工作流的开发人员的重要资产。

下载入口:https://github.com/openclaw/skills/tree/main/skills/robwoodgate/cashu-emoji

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install cashu-emoji

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 cashu-emoji。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Cashu Emoji 应用场景

  • 解码 AI 代理收到的聊天消息中隐藏的 Cashu 代币。
  • 将金融代币编码到表情符号中,以便进行离散的点对点转账。
  • 在标准 Unicode 字符中发送隐藏的纯文本消息以维护隐私。
  • 审计 Cashu 代币元数据(如 mint URL 和金额),而不触发花费操作。
Cashu Emoji 工作原理
  1. 用户或代理提供包含表情符号的消息字符串,或提供载体表情符号以及要隐藏的字符串。
  2. 对于解码,该技能扫描输入以查找特定的 Unicode 变体选择器,并将隐藏的字节数组重新组装为 UTF-8 文本。
  3. 对于编码,该技能将目标字符串转换为变体选择器字符,并将它们附加到载体表情符号(如花生或硬币)上。
  4. 如果解码后的内容被识别为 Cashu 代币,该技能可以选择性地解析元数据以显示 mint URL、单位和金额。
  5. 结果数据作为纯文本或结构化 JSON 对象返回,供其他 Openclaw Skills 使用。

Cashu Emoji 配置指南

要开始使用此技能,请克隆存储库并使用以下命令安装依赖项:

git clone https://github.com/robwoodgate/cashu-emoji.git
cd cashu-emoji
npm ci

然后您可以运行 CLI 来解码消息:

node ./bin/cashu-emoji.js decode "<粘贴消息>" --metadata --json

Cashu Emoji 数据架构与分类体系

当使用 --json 标志时,该技能会生成结构化的 JSON,允许 Openclaw Skills 框架内的代理以编程方式处理金融数据。

字段 类型 描述
text string 解码后的隐藏消息或 Cashu 代币字符串。
isCashu boolean 指示有效负载是否遵循 Cashu 代币格式。
metadata object 包含 mint、单位和金额(如果不是代币则为 null)。
metadataError string 无法解析元数据的详细原因(如果适用)。
name: cashu-emoji
description: Encode and decode Cashu tokens that are hidden inside emojis using Unicode variation selectors.
metadata:
  openclaw:
    emoji: "??"
    examples:
      - "Decode an emoji token from a full ch@t message"
      - "Encode a Cashu token into an emoji for sending"

Cashu Emoji Tokens (Variation Selector encoding)

This skill helps agents decode Cashu tokens received as emoji (and encode tokens for sending), and it also supports general hidden messages inside emojis.

If the decoded text starts with cashu, it’s likely a Cashu token. Otherwise treat it as a plain hidden message.

Why this exists

Some services embed a cashu... token into an emoji using Unicode variation selectors (VS1..VS256). Chat apps often display only the emoji, but preserve the hidden selector characters.

Important: many messengers can truncate or normalize Unicode. If the variation selectors are lost, the embedded token cannot be recovered.

Quickstart (copy/paste)

git clone https://github.com/robwoodgate/cashu-emoji.git
cd cashu-emoji
npm ci

# decode a whole message (recommended)
node ./bin/cashu-emoji.js decode ""

# decode and print mint/unit/amount if it’s a cashu token
node ./bin/cashu-emoji.js decode "" --metadata

# decode as structured JSON (agent-friendly)
node ./bin/cashu-emoji.js decode "" --metadata --json

# encode a hidden message
node ./bin/cashu-emoji.js encode "??" "hello from inside an emoji"

# encode a cashu token
node ./bin/cashu-emoji.js encode "??" "cashuB..."

What you can do

1) Decode

  • Input: entire message text (may include other text/emojis)
  • Output: the embedded UTF?8 text, usually a cashuA.../cashuB... token
node ./bin/cashu-emoji.js decode ""

Decode semantics (important): the decoder ignores normal characters until it finds the first variation-selector byte, then collects bytes until the first normal character after that payload begins.

2) Encode

  • Input: a carrier emoji (recommend ??) and a token string
  • Output: an emoji string that visually looks like the emoji but contains the hidden token
node ./bin/cashu-emoji.js encode "??" "cashuB..."

Tip: some messengers are less likely to deliver a truncated/corrupted emoji-token if any normal text follows it (even a single character). It’s not required, just a delivery reliability trick.

Tip (T@elegrimm): sending the emoji-token inside a code block / “monospace” formatting can help preserve the hidden characters and makes it easier to tap-to-copy.

Optional metadata

To sanity-check the decoded token without redeeming it, you can request metadata.

For programmatic/agent use, prefer JSON output:

node ./bin/cashu-emoji.js decode "" --metadata --json

Example JSON response (Cashu token):

{
  "text": "cashuB...",
  "isCashu": true,
  "metadata": {
    "mint": "https://mint.example",
    "unit": "sat",
    "amount": 21
  },
  "metadataError": null
}

Example JSON response (plain hidden message):

{
  "text": "hello from inside an emoji",
  "isCashu": false
}
node ./bin/cashu-emoji.js decode "" --metadata

This prints mint/unit/amount using @cashu/cashu-ts getTokenMetadata() (no mint calls).

Cashu gotchas for new agents

  • A decoded cashu... token is a bearer asset. Treat it like cash.
  • --metadata is a local parse. It can’t prove the token is unspent/valid.
  • If decode returns a partial token or nonsense, the messenger likely munged the variation selectors; ask for the token to be re-sent (often with some trailing normal text after the emoji token).

Files

  • src/emoji-encoder.ts: core encode/decode
  • bin/cashu-emoji.js: CLI wrapper
  • examples/: test vectors

Safety

This tool only encodes/decodes text. It does not spend funds.