trifle-auth
Authenticate with the Trifle API using Sign-In with Ethereum (SIWE). Manages wallet-based authentication, JWT token storage, and session management for the Trifle ecosystem.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- trifle-auth
- version
- 1.0.0
- metadata
- { "clawdhub": { "emoji": "🔐", "requires": { "npm": [ "viem", "siwe" ], "bins": [ "node" ] }, "platforms": [ "api" ] } }
- description
- Authenticate with the Trifle API using Sign-In with Ethereum (SIWE). Manages wallet-based authentication, JWT token storage, and session management for the Trifle ecosystem.
03 SKILL.md 正文
Trifle Auth Skill
Authenticate with the Trifle API (bot.trifle.life) using SIWE (Sign-In with Ethereum) for wallet-based authentication. Stores JWT tokens for use by other skills (snake-game, etc.).
Setup
1. Install dependencies
cd ~/.openclaw/workspace/skills/trifle-auth
npm install
2. Generate a wallet
node trifle-auth.mjs generate
This generates a new Ethereum address and automatically saves the private key to 1Password (vault: Gigi, item: "EVM Wallet - Trifle Agent"). The key is never printed to stdout. If 1Password is unavailable, it falls back to a restricted file (~/.trifle-wallet.key, mode 600).
3. Set environment (or use 1Password)
The skill reads the private key from:
TRIFLE_PRIVATE_KEYenvironment variable (first priority)- 1Password:
op://Gigi/EVM Wallet - Gigi/private_key<!-- nocheck -->
4. Login
node trifle-auth.mjs login
This authenticates via SIWE and stores the JWT token in ~/.local/state/trifle-auth/auth-state.json.
Commands
# Authenticate and store JWT token
node trifle-auth.mjs login
# Check auth status and user info
node trifle-auth.mjs status
# Get JWT token path (written to a secure temp file, not stdout)
TOKEN=$(cat $(node trifle-auth.mjs token))
node trifle-auth.mjs token
# Generate a new wallet keypair
node trifle-auth.mjs generate
# Check ball balance
node trifle-auth.mjs balance
Authentication Flow
- Gets nonce from
/auth/wallet/nonce - Creates SIWE message with domain
trifle.life - Signs message with private key (no gas cost)
- Verifies signature at
/auth/wallet/verify - Receives JWT token (valid 30 days)
- Stores token in state file
State File
Location: ~/.local/state/trifle-auth/auth-state.json (XDG-compliant, override with TRIFLE_AUTH_STATE env var)
{
"token": "jwt-token-here",
"address": "0x...",
"userId": 123,
"username": "gigi",
"totalBalls": 50,
"lastLogin": "2026-02-05T15:00:00Z"
}
CORS Notes
API requests include Origin: https://trifle.life header to satisfy CORS requirements. The backend validates the origin against its allowed list.
Ball Economy
- Earning balls: GM game (1/day), auth bonuses (10 per platform), reactions, etc.
- Spending balls: Snake game votes (min 1 per vote)
- Auth bonuses: Each platform auth earns 10 balls (wallet, discord, telegram, etc.)
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.