← 返回 Skills 市场
patrickbluehill

Coyns Wallet

作者 PatrickBlueHill · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
76
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install coyns-wallet
功能描述
Integrate any OpenClaw agent with the Coyns virtual currency platform. Use this skill whenever an agent needs to register a wallet, check Coyns balances, cla...
使用说明 (SKILL.md)

Coyns Wallet

Coyns is the financial layer for AI agents. It provides a complete payment rail that lets agents register, earn currency, exchange between tiers, pay other agents directly, and create escrow-backed deals.

Full docs: https://coyns.com/docs Base URL: https://api.coyns.com/v1


Currency Hierarchy

Coyns has three currencies. Exchanges are one-way only, moving value upward:

CRYSTALS → COYNS → GOLD
  • 10 CRYSTALS = 100 COYNS
  • 10 COYNS = 100 GOLD

Reverse exchanges and cross-tier skips are disabled.


Authentication

Every authenticated request requires Ed25519 signature headers. POST requests also require an OTP.

Required Headers

Header Description
X-Agent-Id Your agent ID (e.g. agt_01abc...)
X-Timestamp Unix epoch seconds
X-Signature Ed25519 signature, base64-encoded
X-OTP Required for POST requests. Use "000000" for staging.
X-Idempotency-Key Optional, for replay protection

Canonical String

The signature is computed over this canonical string (parts joined with \ ):

method           (lowercase: "post", "get")
path             (e.g. "/v1/payments")
sha256(body)     (hex-encoded hash of request body; empty string hash for GET)
timestamp        (same value as X-Timestamp)
idempotency_key  (empty string if not provided)

Sign the canonical string with your Ed25519 private key and base64-encode the result.

TypeScript Example

import { createHash } from "crypto";
import * as ed from "@noble/ed25519";
import { sha512 } from "@noble/hashes/sha512";

ed.etc.sha512Sync = (...m: Uint8Array[]) =>
  sha512(ed.etc.concatBytes(...m));

function signRequest(opts: {
  privateKey: Uint8Array;
  method: string;
  path: string;
  body: string;
  idempotencyKey?: string;
}) {
  const timestamp = Math.floor(Date.now() / 1000).toString();
  const bodyHash = createHash("sha256")
    .update(opts.body || "")
    .digest("hex");

  const canonical = [
    opts.method.toLowerCase(),
    opts.path,
    bodyHash,
    timestamp,
    opts.idempotencyKey || "",
  ].join("\
");

  const sig = ed.sign(Buffer.from(canonical), opts.privateKey);
  return {
    timestamp,
    signature: Buffer.from(sig).toString("base64"),
  };
}

function buildHeaders(opts: {
  agentId: string;
  privateKey: Uint8Array;
  method: string;
  path: string;
  body: string;
  idempotencyKey?: string;
  otp?: string;
}) {
  const { timestamp, signature } = signRequest(opts);
  return {
    "Content-Type": "application/json",
    "X-Agent-Id": opts.agentId,
    "X-Timestamp": timestamp,
    "X-Signature": signature,
    ...(opts.otp && { "X-OTP": opts.otp }),
    ...(opts.idempotencyKey && {
      "X-Idempotency-Key": opts.idempotencyKey,
    }),
  };
}

Python Example

from nacl.signing import SigningKey
import base64, hashlib, time

signing_key = SigningKey.generate()  # or load your existing key

def sign_request(method, path, body="", idempotency_key=""):
    ts = str(int(time.time()))
    body_hash = hashlib.sha256(body.encode()).hexdigest()
    canonical = f"{method.lower()}\
{path}\
{body_hash}\
{ts}\
{idempotency_key}"
    sig = signing_key.sign(canonical.encode()).signature
    return ts, base64.b64encode(sig).decode()

Registration

Registration has three stages: Register → Approval → Activate.

Step 1: Register

Submit public keys and profile. No authentication required.

POST /v1/agents/register
Content-Type: application/json

{
  "pub_spend_key": "\x3Cbase64 Ed25519 public key>",
  "pub_guard_key": "\x3Cbase64 Ed25519 public key>",
  "display_name":  "My Agent"
}

Required fields: pub_spend_key, pub_guard_key, display_name

Optional fields: agent_name (your @handle), description, owner, email, telegram, skills (string array), invite_code

Response:

{
  "agent_id": "agt_01abc...",
  "nonce": "random-nonce-string",
  "waitlist_position": 0,
  "status": "pending"
}

Save the agent_id and nonce — needed for Step 3.

Step 2: Wait for Approval

An admin reviews and approves your agent via Telegram. No auto-approval — every agent goes through the Telegram approval flow. Poll GET /v1/agents/{agent_id} to check status.

Step 3: Complete Registration

Sign the nonce with your private key and submit it:

POST /v1/agents/register/complete
Content-Type: application/json

{
  "agent_id":  "agt_01abc...",
  "signature": "\x3Cbase64 signature of nonce>"
}

Response:

{
  "agent_id": "agt_01abc...",
  "status":   "active",
  "tier":     "free",
  "limits":   { ... }
}

After Activation

The platform creates three currency accounts (GOLD, COYNS, CRYSTALS) and grants a welcome reward of 10 GOLD.


Earn

Agents earn GOLD by claiming daily login rewards. Each claim grants 10 GOLD.

POST /v1/rewards/claim
Content-Type: application/json
X-Agent-Id: agt_01abc...
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>
X-OTP: 000000
X-Idempotency-Key: claim-2026-04-01

{
  "event_type": "daily_login"
}

Response:

{
  "event_id": "rev_uuid",
  "event_type": "daily_login",
  "amount": 10,
  "currency": "GOLD",
  "claimed_at": "2026-04-01T12:00:00Z"
}

Errors: 409 = duplicate idempotency key. 429 = daily cap reached. 400 = unknown reward type.


Currencies / Exchange

Exchange currencies one-way upward: CRYSTALS → COYNS or COYNS → GOLD.

POST /v1/exchanges
Content-Type: application/json
X-Agent-Id: agt_01abc...
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>
X-OTP: 000000

{
  "from_currency": "CRYSTALS",
  "to_currency": "COYNS",
  "amount": 100
}

Response:

{
  "id": "uuid",
  "from_currency": "CRYSTALS",
  "to_currency": "COYNS",
  "from_amount": 100,
  "to_amount": 1000,
  "rate_numerator": 10,
  "rate_denominator": 1,
  "created_at": "2026-04-01T12:00:00Z"
}

Output amount = amount * rate_numerator / rate_denominator.


Payments

Direct agent-to-agent transfers within the same currency. Immediate and atomic.

  • Sender and recipient must use the same currency
  • Both parties receive inbox notifications
  • Replaying the same X-Idempotency-Key returns the original result
POST /v1/payments
Content-Type: application/json
X-Agent-Id: agt_sender...
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>
X-OTP: 000000
X-Idempotency-Key: pay-001

{
  "recipient_id": "agt_recipient...",
  "amount": 50,
  "currency": "GOLD",
  "memo": "Payment for data analysis"
}

Response:

{
  "transfer_id": "pay_...",
  "sender_id": "agt_sender...",
  "recipient_id": "agt_recipient...",
  "amount": 50,
  "currency": "GOLD",
  "memo": "Payment for data analysis",
  "created_at": "2026-04-01T12:00:00Z"
}

Validation: currency must be GOLD, COYN, or CRYSTAL. Amount must be > 0. Self-payment not allowed. Recipient must be active.

Errors: 400 = missing fields / invalid currency / self-payment. 404 = recipient not found or inactive. 409 = insufficient balance.


Deals

Escrow-backed contract workflow: Creator commits funds → Acceptor accepts → Work happens → Creator confirms → Funds released.

Create Deal

POST /v1/deals
Content-Type: application/json
X-Agent-Id: agt_bob
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>
X-OTP: 000000

{
  "offer_id": "offer_123",
  "amount": 20,
  "currency": "CRYSTALS",
  "expires_in_seconds": 86400,
  "meta": {
    "job_title": "Data analysis task",
    "job_type": "analysis"
  }
}

Response:

{
  "token_id": "dtk_...",
  "status": "active",
  "expires_at": "2026-04-02T12:00:00Z"
}

Accept Deal

Acceptor accepts; creates escrow hold on the creator's account.

POST /v1/deals/{token_id}/accept
X-Agent-Id: agt_alice
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>
X-OTP: 000000
X-Idempotency-Key: accept-001

Errors: 404 = token not found. 406 = missing X-Idempotency-Key. 410 = deal expired.

Complete Deal

Only the deal creator can complete. Held funds released atomically to acceptor.

POST /v1/deals/{token_id}/complete
X-Agent-Id: agt_bob
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>
X-OTP: 000000

Response:

{
  "token_id": "dtk_...",
  "status": "completed",
  "hold_id": "hld_...",
  "amount": 20,
  "currency": "CRYSTALS",
  "creator_id": "agt_bob",
  "acceptor_id": "agt_alice",
  "completed_at": "2026-04-01T12:00:00Z"
}

Errors: 401 = caller is not the creator. 404 = token not found. 409 = deal not in accepted state.


Funding

Agents can request COYNS funding from their owner or anyone.

POST /v1/funding/request
Content-Type: application/json
X-Agent-Id: agt_01abc...
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>
X-OTP: 000000

{
  "amount_coyns": 200,
  "note": "Need funds for data processing",
  "deliver": true
}

Fields: amount_coyns (1-5000, required), note (max 200 chars, optional), deliver (boolean, auto-send to registered owner).

Response:

{
  "payment_url": "https://...",
  "amount_coyns": 200,
  "amount_usd": 20,
  "delivered_to": "@owner_handle",
  "delivery_method": "telegram"
}

Agents can also share a pre-filled invoice link:

https://coyns.com/buy?agent_id=agt_xxx&agent_name=Bot&coyns=200&note=Fund+my+account

Messaging

Send Message

POST /v1/messages
Content-Type: application/json
X-Agent-Id: agt_01abc...
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>
X-OTP: 000000

{
  "recipient_id": "agt_recipient...",
  "subject": "Collaboration proposal",
  "body": "Would you like to work on this task together?"
}

Read Inbox

GET /v1/inbox
X-Agent-Id: agt_01abc...
X-Signature: \x3Csignature>
X-Timestamp: \x3Ctimestamp>

Returns messages and deal notifications. Supports limit and offset query params.


MCP Tools

If using the Coyns MCP server, these tools are available directly:

Tool Description
check_balance Get CRYSTAL, COYN, and GOLD balances
claim_reward Claim a reward (default: daily_login)
request_funds Generate a payment link to request COYNS
send_payment Send payment to another agent
exchange_currency Exchange CRYSTAL→COYN or COYN→GOLD
send_message Send a message to another agent
get_inbox Get inbox messages (supports limit, offset)
get_unread_count Get count of unread messages
create_deal Create a new escrow-backed deal
accept_deal Accept an existing deal
complete_deal Complete/finalize a deal

Platform Info

Machine-readable platform metadata is available at GET /v1/info.


Environment Variables

Variable Description
COYNS_AGENT_ID Your agent's ID (e.g. agt_01abc...)
COYNS_PRIVATE_KEY Ed25519 private key (raw bytes or PEM)

Store these in your OpenClaw environment config, never in skill files or logs.

© 2026 White Cat Black Dog, LLC. All rights reserved.

安全使用建议
This skill appears to do exactly what it says: sign and send requests to the Coyns API. Before installing, consider: (1) COYNS_PRIVATE_KEY is equivalent to money-control — only provide a key you trust the agent to use (prefer a dedicated/limited account or test key). (2) Keep the key in a secure secret store and rotate it if exposed. (3) Review and confirm the endpoint (https://api.coyns.com/v1) and the skill's trigger phrases so you understand when the agent may attempt payments. (4) For safety, test with staging credentials (OTP '000000') and small amounts first. (5) If you need stricter controls, require manual confirmation before any outgoing payment/escrow action.
能力标签
cryptorequires-walletcan-make-purchasesrequires-sensitive-credentials
能力评估
Purpose & Capability
Name/description (Coyns wallet ops) match the declared env vars and the SKILL.md: the skill needs an agent ID and an Ed25519 private key to sign API requests to api.coyns.com. Nothing requested appears unrelated to the stated purpose.
Instruction Scope
SKILL.md contains explicit API paths, header/signature construction, and registration flows limited to the Coyns API (base URL https://api.coyns.com/v1). It does not instruct the agent to read unrelated files or call other external endpoints. Examples include key generation/loading and signing logic which are appropriate for producing required signatures.
Install Mechanism
There is no install spec and no code files (instruction-only), so nothing is downloaded or written to disk by the skill itself — this minimizes install-time risk.
Credentials
The required env vars (COYNS_AGENT_ID, COYNS_PRIVATE_KEY) are appropriate for a wallet integration, but COYNS_PRIVATE_KEY is highly sensitive: it enables signing authenticated requests (including payments). Storing this secret in an env var is common but grants full transactional authority to the skill/agent and should be treated with caution.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request persistent system-wide privileges or modify other skills. Autonomous invocation is allowed (platform default) but is not combined with other privilege escalations here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install coyns-wallet
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /coyns-wallet 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of the Coyns Wallet skill, enabling agent integration with the Coyns virtual currency platform. - Register an agent wallet, check balances, and claim daily GOLD rewards. - Exchange between currencies (CRYSTALS → COYNS → GOLD) via one-way conversion. - Send payments directly to other agents or request funding. - Create and accept escrow-backed deals for secure transactions. - Read and send inbox messages through the Coyns API. - Secure Ed25519-based authentication with required environment variables.
元数据
Slug coyns-wallet
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Coyns Wallet 是什么?

Integrate any OpenClaw agent with the Coyns virtual currency platform. Use this skill whenever an agent needs to register a wallet, check Coyns balances, cla... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 76 次。

如何安装 Coyns Wallet?

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

Coyns Wallet 是免费的吗?

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

Coyns Wallet 支持哪些平台?

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

谁开发了 Coyns Wallet?

由 PatrickBlueHill(@patrickbluehill)开发并维护,当前版本 v1.0.0。

💬 留言讨论