Starknet Mini Pay 标志

Starknet Mini Pay

组织
keep-starknet-strange
starknet-mini-pay

在 Starknet 上进行简单的点对点(P2P)支付。生成二维码、支付链接和发票,并转账 ETH/STRK/USDC。类似 Lightning,但原生运行于 Starknet。

Add to TypingMind

概览

发布者keep-starknet-strange
代码仓库starknet-agentic
技能名称starknet-mini-pay
星标数
81
复刻数
26
附带文件
9
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 9 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 keep-starknet-strange 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Starknet Mini Pay AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/keep-starknet-strange/starknet-agentic/tree/main/skills/starknet-mini-pay
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/keep-starknet-strange/starknet-agentic.git /tmp/starknet-agentic
mkdir -p .claude/skills
cp -r /tmp/starknet-agentic/skills/starknet-mini-pay .claude/skills/starknet-mini-pay
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Starknet Mini Pay,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Starknet Mini Pay。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Starknet Mini Pay 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Starknet Mini-Pay Skill

Simple P2P payments on Starknet. Like Lightning, but native.

Related modules: skills catalog.

When to Use

  • Generating payment links, QR codes, invoices, or Telegram payment flows on Starknet.
  • Sending simple user-to-user ETH, STRK, or USDC transfers with payment UX around them.

When NOT to Use

  • DeFi-specific swaps, staking, or lending flows.
  • Cairo contract authoring, deployment-only tasks, or security auditing.

Overview

┌─────────────────────────────────────────────────────────┐
│                    STARKNET MINI-PAY                    │
├─────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────┐ │
│  │  QR Codes   │  │  Payment    │  │   Telegram Bot  │ │
│  │  Generator  │  │   Links     │  │   Interface     │ │
│  └─────────────┘  └─────────────┘  └─────────────────┘ │
│           │                │                   │          │
│           └────────────────┴───────────────────┘          │
│                         │                                │
│              ┌─────────▼─────────┐                       │
│              │   starknet-py    │                       │
│              │   SDK + RPC      │                       │
│              └──────────────────┘                       │
│                         │                                │
│         ┌───────────────┼───────────────┐               │
│         ▼               ▼               ▼               │
│    ┌─────────┐    ┌──────────┐    ┌──────────┐         │
│    │ ArgentX │    │  Braavos │    │  Generic  │         │
│    │ Account │    │ Account  │    │  Account  │         │
│    └─────────┘    └──────────┘    └──────────┘         │
└─────────────────────────────────────────────────────────┘

Features

FeatureDescription
P2P TransfersSend ETH/STRK/USDC to any Starknet address
QR CodesGenerate QR codes for addresses (scan to pay)
Payment Linksstarknet:<addr>?amount=1&memo=coffee
Invoice SystemGenerate payment requests with expiry
Telegram BotPayment links, QR codes and invoices via Telegram (non-custodial)
Transaction HistoryTrack all transfers with status

Quick Start

CLI Usage

bash
# Send payment
python3.12 scripts/cli.py send 0x123... 0.5 --memo "coffee"

# Generate QR code for your address
python3.12 scripts/cli.py qr 0x123... --output qr.png

# Create payment link
python3.12 scripts/cli.py link 0x123... --amount 0.1 --memo "lunch"

# Create invoice
python3.12 scripts/cli.py invoice 0x123... 25.00 --expires 3600

# Check transaction status
python3.12 scripts/cli.py status 0xabcdef...

# Balance check
python3.12 scripts/cli.py balance 0x123...

Payment Link Format

starknet:<address>?amount=<value>&memo=<text>&token=<ETH|STRK|USDC>

Example:

starknet:0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef?amount=0.01&memo=coffee&token=ETH

Telegram Bot Commands

The bot is non-custodial: it never holds keys or sends transactions. It builds links, QR codes and invoices that the payer opens and signs in their own wallet. Use the CLI send and balance commands to transfer or check balances.

/start                    - Welcome message and quick actions
/help                     - Show help
/myaddress <address>      - Set your receiving address (needed by /link, /qr, /invoice)
/link [amount] [memo]     - Payment link and QR with wallet buttons
/qr                       - QR code for your address
/invoice <amount> [memo]  - USDC invoice with expiry
/status <tx_hash>         - Check transaction status
/webhook <url>            - Set a notification webhook (not persisted yet)

Architecture

starknet-mini-pay/
├── SKILL.md
├── README.md
├── scripts/
│   ├── cli.py              # Main CLI interface
│   ├── mini_pay.py         # Core payment logic
│   ├── qr_generator.py     # QR code generation
│   ├── link_builder.py     # Payment link builder
│   ├── invoice.py          # Invoice system
│   ├── telegram_bot.py     # Telegram bot
│   └── starknet_client.py  # Starknet RPC client
└── requirements.txt

Dependencies

bash
pip install -r requirements.txt

requirements.txt pins starknet-py to the tested 0.30.x range. starknet-py 0.30 speaks Starknet JSON-RPC spec 0.10, so any custom RPC URL must serve a v0_10 endpoint.

Configuration

bash
# Environment variables
# Keyless public RPC (spec 0.10). Sepolia: https://api.cartridge.gg/x/starknet/sepolia/rpc/v0_10
export STARKNET_RPC="https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10"
export MINI_PAY_PRIVATE_KEY="0x..."
export MINI_PAY_ADDRESS="0x..."
export TELEGRAM_BOT_TOKEN="..."
export TELEGRAM_CHAT_ID="..."

Core Functions

Send Payment

python
from mini_pay import MiniPay, MAINNET_RPC_URL

pay = MiniPay(rpc_url=MAINNET_RPC_URL)

# Send ETH (V3 transaction: the fee is paid in STRK)
tx_hash = await pay.transfer(
    from_address="0x...",
    private_key="0x...",
    to_address="0x123...",
    amount_wei=5 * 10**17,  # 0.5 ETH
    token="ETH"
)

# Check status
status = await pay.get_transaction_status(tx_hash)
print(f"Status: {status}")  # PENDING, CONFIRMED, REJECTED, NOT_FOUND

Generate QR Code

python
from qr_generator import QRGenerator

qr = QRGenerator()
qr.generate(
    address="0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
    amount=None,  # Optional amount
    memo=None,     # Optional memo
    output_file="address_qr.png"
)

Payment Links

python
from link_builder import PaymentLinkBuilder

link = PaymentLinkBuilder()

# Create link
url = link.create(
    address="0x123...",
    amount=0.01,
    memo="coffee",
    token="ETH"
)

# Parse incoming link
data = link.parse("starknet:0x123...?amount=0.01&memo=coffee")

Invoice System

python
import asyncio
from invoice import InvoiceManager

async def main():
    # Opens (or creates) invoices.db in the working directory
    async with InvoiceManager() as invoices:
        # Create invoice
        invoice = await invoices.create(
            payer_address="0x...",  # also the recipient unless recipient_address is set
            amount=25.00,
            token="USDC",
            expiry_seconds=3600,  # 1 hour
            description="Payment for services"
        )
        print(invoices.create_payment_url(invoice))

        # Check invoice status
        fetched = await invoices.get(invoice.id)
        print(fetched.status, invoices.format_expiry(fetched))  # pending 1h left

asyncio.run(main())

Telegram Bot

Run Bot

bash
python3.12 scripts/telegram_bot.py

Bot Flow

User:  /myaddress 0x0123...cdef
Bot:   ✅ Address Set
User:  /link 0.05 coffee
Bot:   📱 Payment Link (QR code) with "Open in ArgentX" / "Open in Braavos" buttons
Payer: opens the link and signs the transfer in their own wallet

Optional: Invoice Contract

This skill does not ship a contract. A trustless invoice contract could follow this sketch:

cairo
#[starknet::contract]
mod PaymentRequest {
    #[storage]
    struct Storage {
        request_id: u256,
        requests: Map<u256, Request>,
        owner: ContractAddress,
    }

    #[derive(Drop, Serde)]
    struct Request {
        amount: u256,
        token: ContractAddress,
        recipient: ContractAddress,
        expiry: u64,
        fulfilled: bool,
        memo: felt252,
    }

    #[external(v0)]
    impl IPaymentRequestImpl of IPaymentRequest<ContractState> {
        fn create_request(
            ref self: ContractState,
            amount: u256,
            token: ContractAddress,
            expiry: u64,
            memo: felt252
        ) -> u256 {
            // Create payment request
        }

        fn fulfill_request(
            ref self: ContractState,
            request_id: u256
        ) {
            // Execute payment
        }
    }
}

Error Handling

ErrorCauseSolution
INSUFFICIENT_BALANCENot enough of the token, or not enough STRK for feesTop up the token and keep STRK for V3 fees
ACCOUNT_NOT_FOUNDInvalid sender addressCheck address format
INVALID_AMOUNTAmount <= 0Use positive amount
TX_FAILEDTransaction revertedCheck recipient address
INVOICE_EXPIREDInvoice past expiryCreate new invoice

Payment Flow

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Sender    │     │  Mini-Pay   │     │  Recipient  │
└──────┬──────┘     └──────┬──────┘     └──────┬──────┘
       │                   │                   │
       │  1. Initiate      │                   │
       │──────────────────▶│                   │
       │                   │                   │
       │                   │  2. Execute      │
       │                   │  ETH Transfer    │
       │                   │─────────────────▶
       │                   │                   │
       │                   │  3. Confirm      │
       │                   │◀──────────────────
       │  4. Success       │                   │
       │◀──────────────────│                   │
       │                   │                   │

Security Notes

  • Private keys: Never expose in logs or error messages
  • Amount validation: Prevent negative/zero amounts
  • Expiry checks: Invoices expire automatically
  • Address format: Validate Starknet addresses (0x... format)

Comparison with Lightning

FeatureLightningStarknet Mini-Pay
Setup timeHours (channels)Instant
PrivacyOnion routingNative (per txn)
Speed~1 sec~2-3 min
FeesVariablePredictable
CustodyLightning nodeSelf-custody
NativeNo (needs BTC)Yes (Starknet native)

Roadmap

  • Multi-token support (STRK, USDC, DAI)
  • Batch payments
  • Payment requests via IPFS
  • Web interface
  • Mobile app (Flutter)
  • MPC wallet integration

Resources

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Starknet Mini Pay AI 技能有什么作用?

在 Starknet 上进行简单的点对点(P2P)支付。生成二维码、支付链接和发票,并转账 ETH/STRK/USDC。类似 Lightning,但原生运行于 Starknet。

为什么在 TypingMind 中使用 Starknet Mini Pay?

因为您只需安装一次,就能搭配任何模型使用。Starknet Mini Pay 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Starknet Mini Pay?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/keep-starknet-strange/starknet-agentic/tree/main/skills/starknet-mini-pay。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Starknet Mini Pay?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Starknet Mini Pay 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Starknet Mini Pay 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Starknet Mini Pay AI 技能免费吗?

是的。keep-starknet-strange 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇