Crinkl — Earn Bitcoin from Billing Emails
CODEBLOCK0
Scan your human's email for billing emails, verify their cryptographic DKIM signatures, and earn ~150 sats per receipt over Lightning. Each verified receipt mints an identity-free spend token — no personal data is stored or retained.
Supports two email providers: Gmail (via gog skill) or AgentMail (dedicated inbox, no OAuth).
MCP Server
This skill requires the crinkl MCP server:
CODEBLOCK1
All Crinkl operations (pairing, vendor discovery, receipt submission, earnings) are available as declared MCP tools. See the full tool list.
What is Crinkl
Crinkl is a receipt verification protocol. It uses DKIM — the same cryptographic signatures email servers already attach to every outbound message — to verify that a billing email is authentic and unmodified. Each verified receipt mints an identity-free spend token and pays sats to the submitter's wallet over Lightning.
Spend tokens contain a store hash, date, total, and a hash-chained signature — but no identity. No email address, no name, no account ID. The token proves a purchase happened without revealing who made it.
Privacy & Data Handling
This skill passes individual billing emails to the submit-receipt tool for DKIM signature verification. This section explains exactly what is sent, why, and what happens to it.
Why the full email is required
DKIM signatures are computed over the email's headers and body by the sending mail server (e.g. Amazon SES, Google Workspace). The signature covers the original message content — not a summary, not extracted fields, but the actual RFC 2822 message. To verify the cryptographic signature, the server must receive the same bytes the mail server signed. There is no way to verify DKIM without the original message.
This is the same verification that Gmail, Outlook, and every email provider performs when checking if an email is forged. The difference is that Crinkl uses the verification result to prove a purchase happened.
What happens after verification
- 1. The server checks the DKIM signature against the vendor's public DNS key
- If valid, it extracts only: vendor name, invoice date, total amount, currency
- The original email is discarded — not stored, not logged, not retained
- A spend token is minted containing only the extracted invoice data (no email content, no personal data)
Scope
- - Gmail path: Searches for billing emails from approved vendor domains (call
get-vendors), filtered by billing keywords, from the last 14 days. - AgentMail path: Processes messages in the dedicated receipt inbox. The inbox only receives vendor billing emails that the user explicitly configured to send there.
Security Model
- - Human-authorized: Your human approves the pairing code in their app. Nothing runs without their explicit consent.
- Vendor-scoped (Gmail): Only billing emails from approved vendors are searched.
- Vendor-scoped (AgentMail): The dedicated inbox only receives vendor billing emails the user explicitly configured. No access to the user's primary email.
- Read-only Gmail: The
gmail.readonly scope means no email modification, deletion, or sending. - DKIM verification: The server validates the cryptographic signature — forged or modified emails are rejected.
- Identity-free output: Spend tokens strip all personal data. The signed payload contains store hash, date, total, and CBSA — no email, name, or account.
- API key scoped: The API key ties submissions to a wallet, not to a person. Your human controls the key and can revoke it anytime.
- Open source: The server-side verification logic is documented in the crinkl-protocol spec. The agent source is at crinkl-agent (MIT license).
Setup
1. Pair with your human's Crinkl wallet
On first run, pair with your human's wallet using the pair-agent tool:
- 1. Call
pair-agent with a random 64-character hex string as INLINECODE5 - Tell your human the 4-character code: "Open the Crinkl app and enter code: [code]"
- Poll
claim-api-key every 5 seconds with the same deviceToken and INLINECODE8 - Once the human approves, you get the API key. Store it securely — it's shown once.
The code expires in 10 minutes.
2. Email access (choose one)
Option A: Gmail (via gog)
Install the gog skill for Gmail access:
CODEBLOCK2
Your human authorizes read-only Gmail access through gog's OAuth setup.
Option B: AgentMail (no OAuth)
Install the agentmail skill:
CODEBLOCK3
Create a dedicated inbox via AgentMail. Include the agentmailInbox field when calling pair-agent so your human sees the inbox address during approval. Your human then updates their vendor billing emails to send to the AgentMail address. Receipts arrive directly with DKIM signatures intact — no forwarding.
Important: Email forwarding (e.g. Gmail → AgentMail) breaks the vendor's DKIM signature. Vendors must send directly to the AgentMail address.
How It Works
Each cycle (see HEARTBEAT.md):
- 1. Check API key — call
pair-agent + claim-api-key if needed (one-time) - Find billing emails:
-
Gmail: Fetch the vendor list (
get-vendors), search Gmail for receipts from those domains
-
AgentMail: List messages in the dedicated receipt inbox
- 3. Get raw email — Download each billing email as raw RFC 2822 (required for DKIM signature verification)
- Submit for verification — call
submit-receipt with the base64 email; email is discarded after extraction - Log results — Record what verified and what you earned
- Check your earnings — call
get-agent-me for your submission count and sats earned
MCP Tool Reference
All tools are available via the crinkl MCP server at https://mcp.crinkl.xyz/mcp.
Pairing (no auth)
- -
pair-agent — Start pairing. Pass deviceToken (64-char hex) and optionally agentmailInbox (e.g. crinkl-xyz@agentmail.to). Returns code and expiresAt. claim-api-key — Poll for API key. Pass deviceToken + code. Returns 202 (pending), 200 (approved with apiKey), or 410 (expired).
Vendor discovery (no auth)
- -
get-vendors — Returns list of approved vendor domains with display names.
Receipt submission (requires apiKey)
- -
submit-receipt — Submit base64-encoded raw email for DKIM verification + spend creation.
- Returns status 201 (verified, sats queued), 202 (vendor queued for review), 409 (duplicate), 422 (validation error), 429 (rate limited).
- -
verify-receipt — Preview DKIM verification without creating a spend.
Earnings (requires apiKey)
- -
get-agent-me — Your submission count, earned sats, wallet stats, current sats/receipt rate.
Two levels of data in get-agent-me:
Your numbers (attributed to your API key):
- -
mySubmissions — receipts you verified - INLINECODE35 — sats you earned
Wallet numbers (the entire wallet, all sources):
- -
walletTotalSpends — all receipts on the wallet - INLINECODE37 — unclaimed sats on the wallet
- INLINECODE38 — sats already paid out via Lightning
You and your human are separate entities on the same wallet.
Vendor Discovery
The vendor allowlist is not fixed. If you submit an email from a domain not yet on the list, it gets queued for review (202 response). If the domain has valid DKIM, the vendor gets approved and your spend is created retroactively.
Logging
Write each verification to your memory:
CODEBLOCK4
Signals Worth Noting
- - 202 response — you found a vendor the network didn't have yet
- DKIM failure on a known vendor — their email format may have changed
- All 409s — all billing emails already verified, nothing new
- Sats/receipt rate change — the reward rate adjusts with BTC price and reserve policy
技能名称: crinkl-claws
Crinkl — 从账单邮件中赚取比特币
clawhub install crinkl-claws
扫描用户的账单邮件,验证其加密DKIM签名,每张收据通过闪电网络赚取约150聪。每张验证通过的收据会生成一个无身份标识的消费代币——不存储或保留任何个人数据。
支持两个邮件提供商:Gmail(通过gog技能)或 AgentMail(专用收件箱,无需OAuth)。
MCP服务器
此技能需要 crinkl MCP服务器:
json
{
mcpServers: {
crinkl: {
url: https://mcp.crinkl.xyz/mcp
}
}
}
所有Crinkl操作(配对、商家发现、收据提交、收益)均可作为声明的MCP工具使用。查看完整工具列表。
什么是Crinkl
Crinkl是一个收据验证协议。它使用DKIM——邮件服务器已附加到每封外发邮件的相同加密签名——来验证账单邮件是否真实且未被修改。每张验证通过的收据会生成一个无身份标识的消费代币,并通过闪电网络向提交者的钱包支付聪。
消费代币包含商店哈希值、日期、总额和哈希链签名——但不包含身份信息。没有电子邮件地址、姓名或账户ID。该代币证明发生了购买行为,但不透露购买者身份。
隐私与数据处理
此技能将单个账单邮件传递给submit-receipt工具进行DKIM签名验证。本节将准确说明发送了什么、为什么发送以及如何处理这些数据。
为什么需要完整邮件
DKIM签名由发送邮件服务器(例如Amazon SES、Google Workspace)根据邮件的头部和正文计算得出。签名覆盖原始消息内容——不是摘要,不是提取的字段,而是实际的RFC 2822消息。要验证加密签名,服务器必须接收与邮件服务器签名时相同的字节。没有原始消息就无法验证DKIM。
这与Gmail、Outlook以及每个邮件提供商在检查邮件是否伪造时执行的验证相同。区别在于Crinkl使用验证结果来证明发生了购买行为。
验证后的处理
- 1. 服务器根据商家的公共DNS密钥检查DKIM签名
- 如果有效,仅提取:商家名称、发票日期、总金额、货币
- 原始邮件被丢弃——不存储、不记录、不保留
- 生成一个消费代币,仅包含提取的发票数据(无邮件内容、无个人数据)
范围
- - Gmail路径:从批准的商家域名(调用get-vendors)搜索账单邮件,按账单关键词过滤,时间范围为最近14天。
- AgentMail路径:处理专用收件箱中的消息。该收件箱仅接收用户明确配置发送到那里的商家账单邮件。
安全模型
- - 用户授权:用户在应用中批准配对码。未经明确同意,不会运行任何操作。
- 商家范围限定(Gmail):仅搜索来自批准商家的账单邮件。
- 商家范围限定(AgentMail):专用收件箱仅接收用户明确配置的商家账单邮件。无法访问用户的主邮箱。
- Gmail只读:gmail.readonly范围意味着无法修改、删除或发送邮件。
- DKIM验证:服务器验证加密签名——伪造或修改的邮件将被拒绝。
- 无身份标识输出:消费代币剥离所有个人数据。签名后的有效载荷包含商店哈希值、日期、总额和CBSA——无邮件、姓名或账户信息。
- API密钥范围限定:API密钥将提交与钱包关联,而非个人。用户控制密钥并可随时撤销。
- 开源:服务器端验证逻辑记录在crinkl-protocol规范中。代理源代码位于crinkl-agent(MIT许可证)。
设置
1. 与用户的Crinkl钱包配对
首次运行时,使用pair-agent工具与用户的钱包配对:
- 1. 使用随机的64字符十六进制字符串作为deviceToken调用pair-agent
- 告诉用户4字符代码:打开Crinkl应用并输入代码:[code]
- 每5秒使用相同的deviceToken和code轮询claim-api-key
- 用户批准后,您将获得API密钥。安全存储——仅显示一次。
代码有效期为10分钟。
2. 邮件访问(二选一)
选项A:Gmail(通过gog)
安装 gog 技能以访问Gmail:
clawhub install gog
用户通过gog的OAuth设置授权只读Gmail访问权限。
选项B:AgentMail(无需OAuth)
安装 agentmail 技能:
clawhub install agentmail
通过AgentMail创建一个专用收件箱。在调用pair-agent时包含agentmailInbox字段,以便用户在批准期间看到收件箱地址。然后用户更新其商家账单邮件,将其发送到AgentMail地址。收据直接到达,DKIM签名完整——无需转发。
重要提示:邮件转发(例如Gmail → AgentMail)会破坏商家的DKIM签名。商家必须直接发送到AgentMail地址。
工作原理
每个周期(参见HEARTBEAT.md):
- 1. 检查API密钥——如有需要,调用pair-agent + claim-api-key(一次性)
- 查找账单邮件:
-
Gmail:获取商家列表(get-vendors),在Gmail中搜索来自这些域名的收据
-
AgentMail:列出专用收件箱中的消息
- 3. 获取原始邮件——将每封账单邮件下载为原始RFC 2822格式(DKIM签名验证所需)
- 提交验证——使用base64编码的邮件调用submit-receipt;提取后邮件被丢弃
- 记录结果——记录验证了什么以及赚取了多少
- 检查收益——调用get-agent-me查看提交次数和赚取的聪
MCP工具参考
所有工具均可通过位于https://mcp.crinkl.xyz/mcp的crinkl MCP服务器使用。
配对(无需认证)
- - pair-agent——开始配对。传递deviceToken(64字符十六进制)和可选的agentmailInbox(例如crinkl-xyz@agentmail.to)。返回code和expiresAt。
- claim-api-key——轮询API密钥。传递deviceToken + code。返回202(待处理)、200(已批准,附带apiKey)或410(已过期)。
商家发现(无需认证)
- - get-vendors——返回已批准商家域名列表及显示名称。
收据提交(需要apiKey)
- - submit-receipt——提交base64编码的原始邮件进行DKIM验证并创建消费。
- 返回状态201(已验证,聪已排队)、202(商家排队待审)、409(重复)、422(验证错误)、429(频率限制)。
- - verify-receipt——预览DKIM验证,不创建消费。
收益(需要apiKey)
- - get-agent-me——您的提交次数、赚取的聪、钱包统计、当前聪/收据费率。
get-agent-me中的两个数据层级:
您的数据(归因于您的API密钥):
- - mySubmissions——您验证的收据数
- myEarnedSats——您赚取的聪数
钱包数据(整个钱包,所有来源):
- - walletTotalSpends——钱包上的所有收据数
- walletEarnedSats——钱包上未领取的聪数
- walletClaimedSats——已通过闪电网络支付的聪数
您和用户是同一钱包上的独立实体。
商家发现
商家白名单并非固定不变。如果您提交的邮件来自尚未列入名单的域名,该邮件将被排队审核(202响应)。如果该域名具有有效的DKIM,商家将被批准,您的消费将追溯创建。
日志记录
将每次验证写入您的记忆:
markdown
Crinkl:已验证Amazon收据 — $20.00 — DKIM有效 — 约148聪
值得注意的信号
- - 202响应——您发现了一个网络中尚未收录的商家
- 已知商家的DKIM失败——其邮件格式可能已更改
- 全部409——所有账单邮件均已验证,无新内容
- 聪/收据费率变化——奖励率随BTC价格和储备政策调整