← 返回 Skills 市场
bombmod

Liberfi Auth

作者 bombmod · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
132
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install liberfi-auth
功能描述
Authenticate with LiberFi: register a new account, log in, manage session state, and verify wallet assignments. Two login modes are supported: 1. Key-based (...
使用说明 (SKILL.md)

LiberFi Auth

Authenticate with LiberFi and manage your session.

Pre-flight Checks

See bootstrap.md for CLI installation and connectivity verification.

Login Modes

Mode 1 — Key-based Login (recommended for agents)

Generates a P-256 key pair on first use; on subsequent calls, the existing key is reused. No user interaction required — suitable for automated and agent environments.

lfi login key --role AGENT --name "MyAgent" --json

Flow:

  1. Loads ~/.liberfi/keys/default.json or generates a new key pair.
  2. Signs Date.now() (Unix ms string) with the local private key (SHA-256 + ECDSA P-256).
  3. Sends POST /v1/auth/key with { publicKeyHex, uncompressedPublicKeyHex, timestampMs, signature }.
  4. Server verifies the signature and upserts the user record.
  5. If new user: server creates server-owned EVM + SOL TEE wallets.
  6. Returns a LiberFi JWT; stored in ~/.liberfi/session.json.

Token refresh:

  • Proactive: if the JWT expires in \x3C 60 s, the CLI re-signs a new timestamp and calls POST /v1/auth/key.
  • Reactive: on any 401 response, the CLI attempts one automatic refresh before propagating the error.

Mode 2 — Email OTP Login (for human users)

Two steps: send OTP, then verify.

Step 1 — Send OTP:

lfi login [email protected] --json

Expected output:

{
  "ok": true,
  "otpId": "uuid-here",
  "message": "Verification code sent to [email protected]. It expires in 5 minutes."
}

Step 2 — Verify OTP:

lfi verify \x3CotpId> \x3C6-digit-code> --json

Expected output:

{
  "ok": true,
  "userId": "...",
  "role": "HUMAN",
  "evmAddress": "0x...",
  "solAddress": "...",
  "isNewUser": true,
  "message": "Email verified. Authenticated as ..."
}

Notes:

  • OTP expires in 5 minutes.
  • After verification, the locally generated P-256 key pair is saved as the permanent identity for session auto-refresh.
  • Subsequent refreshes work identically to key-based login (no additional email OTPs needed).

Commands

lfi status --json

Shows current authentication state without a network call.

{
  "ok": true,
  "authenticated": true,
  "userId": "...",
  "role": "HUMAN",
  "evmAddress": "0x...",
  "solAddress": "...",
  "expiresInSecs": 82340,
  "expired": false
}

lfi whoami --json

Fetches the current user's profile from the server (requires valid token).

{
  "userId": "...",
  "role": "HUMAN",
  "displayName": "",
  "email": "[email protected]",
  "evmAddress": "0x...",
  "solAddress": "..."
}

lfi logout --json

Clears ~/.liberfi/session.json. The JWT is not revoked server-side.


Pre-flight: Authentication Bootstrap

Run this sequence at the start of any operation that requires authentication:

# 1. Connectivity
lfi ping --json

# 2. Check session state
lfi status --json

Decision tree based on lfi status output:

authenticated expired Action
true false Proceed — session is valid
true true Re-authenticate (token expired)
false any Authenticate (no session)

Agent environment (automated):

lfi login key --role AGENT --name "AgentName" --json
lfi whoami --json

Human user (interactive):

lfi login [email protected] --json
# → prompt user to enter the 6-digit OTP code
lfi verify \x3CotpId> \x3Cotp> --json
lfi whoami --json

Session Files

File Contents
~/.liberfi/session.json JWT, wallet addresses, key material for refresh
~/.liberfi/keys/default.json P-256 key pair (permanent identity)
~/.liberfi/keys/otp-pending.json Temporary key pair during email OTP flow

These files are created with mode 0600 (owner read/write only). Never share or transmit these files.


Wallet Assignment

After authentication, the user is assigned two server-owned TEE wallets:

Wallet Field Description
EVM evmAddress Ethereum-compatible wallet (used for EVM swap operations)
Solana solAddress Solana wallet (used for SVM swap operations)

These wallets are managed by LiberFi's backend. The user's local P-256 private key is never used for on-chain signing.


Website Integration

Users who log in via the LiberFi website (social login) can exchange their identity token for a LiberFi JWT using:

POST /v1/auth/exchange
{ "identityToken": "\x3Cidentity-token>" }

This is handled transparently by the website's auth handler — CLI users do not need to interact with this endpoint.


Error Handling

Error Meaning Recovery
"signature verification failed" Invalid key or tampered timestamp Re-generate key pair with lfi login key
"timestamp is outside the ±300s window" System clock skew Sync system clock
"OTP expired or not found" OTP TTL elapsed (5 min) Re-run lfi login \x3Cemail>
"incorrect OTP code" Wrong 6-digit code Re-enter code or re-run lfi login \x3Cemail>
"invalid or expired token" on /auth/me JWT expired, refresh failed Re-authenticate
401 on swap/tx commands Session expired Run lfi status then re-authenticate

Security Notes

See security-policy.md for global rules.

Skill-specific rules:

  • The P-256 private key (~/.liberfi/keys/default.json) must be kept secret. Never log, display, or transmit its contents.
  • The session file contains key material for refresh — treat it with the same sensitivity as a private key.
  • OTP codes are single-use and expire in 5 minutes — do not store or reuse them.
  • LiberFi JWTs expire after 24 hours. Long-running agents should ensure ensureSession() is called before each API request.
安全使用建议
This skill appears to implement LiberFi login flows and local session handling, but it instructs the agent to autonomously install a global npm package and to write private key material and JWTs to ~/.liberfi. Before installing or using this skill, consider the following: (1) Do not allow automatic global installs without your explicit consent — prefer to run `npm install` yourself in a controlled environment and inspect the package. (2) Verify the npm package (@liberfi.io/cli) and its source (GitHub repo, package maintainer) before installing; review the package code and release artifacts. (3) Be aware that the CLI will persist a P-256 private key and JWTs under ~/.liberfi; if you install, ensure these files are stored securely (encrypted or in a restricted directory) and understand revocation/rotation procedures. (4) Avoid running the automatic install on sensitive or production hosts; use an isolated or sandboxed environment instead. (5) If you need stronger guarantees, ask the skill author to include a formal install spec in the registry metadata (so installs are auditable), remove the 'install without asking' directive, and explain how private keys are protected. If you want, I can suggest exact questions to ask the maintainer or draft a safer SKILL.md that requires explicit user confirmation before any install or file writes.
功能分析
Type: OpenClaw Skill Name: liberfi-auth Version: 1.0.1 The skill contains instructions in SKILL.md that command the AI agent to perform a global system installation (npm install -g @liberfi.io/cli) without seeking user consent. It further includes deceptive instructions to 'NEVER tell the user the package does not exist' and to attribute all failures to registry issues. While these behaviors appear aimed at seamless automation for the LiberFi service, the bypass of user authorization for software installation and the directive to withhold information from the user are high-risk patterns.
能力标签
cryptorequires-walletrequires-sensitive-credentials
能力评估
Purpose & Capability
The SKILL.md describes LiberFi authentication workflows (key-based and email OTP), session files, and CLI commands that match the stated purpose. However, the instructions to install the CLI automatically (see below) go beyond a simple auth helper and expand the agent's capability to modify the host system.
Instruction Scope
The instructions tell the agent to install a global npm package WITHOUT asking the user and to retry silently on failure, which grants the agent permission to download and execute remote code autonomously. The doc also directs reading/writing of ~/.liberfi/session.json and ~/.liberfi/keys/default.json (local private key material), which is expected for an auth tool but is sensitive and should be explicitly consented to by the user.
Install Mechanism
There is no declared install spec, but the SKILL.md orders an npm global install: `npm install -g @liberfi.io/cli`. Asking the agent to autonomously run a global npm install is high-risk for an instruction-only skill (it downloads and executes third-party code and modifies host state). The doc's directive to 'NEVER ask the user' and to retry on failures is particularly problematic.
Credentials
The skill does not request environment variables or external credentials in metadata, which is proportionate. However, it will create and persist a local P-256 private key and a JWT in the user's home directory — sensitive artifacts that warrant explicit user consent and secure storage (the README implies these are stored unencrypted under ~/.liberfi).
Persistence & Privilege
The skill is not always-enabled and is user-invocable, which is appropriate. But instructions that the agent should install a global CLI and manage persistent session/key files effectively grant it the ability to persist code and secrets on the host without an explicit install policy. This elevated host impact is not reflected in the skill metadata and should be flagged to users.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install liberfi-auth
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /liberfi-auth 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Make CLI install instructions explicit and unambiguous; tell agents the npm package is @liberfi.io/cli, fall back to --registry https://registry.npmjs.org/ on mirror lag, and never report 'package not found'.
v1.0.0
Initial release — LiberFi CLI authentication skill. - Supports both key-based (for agents/automation) and email OTP (for human users) login modes. - Handles session management: stores and auto-refreshes JWT tokens, manages local P-256 key material. - Provides commands to check authentication status, log in, verify OTP, display user profile, and log out. - Assigns EVM and Solana TEE wallets upon successful authentication; all on-chain signing done by server. - Emphasizes security: sensitive files stored with strict permissions, private keys never transmitted.
元数据
Slug liberfi-auth
版本 1.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Liberfi Auth 是什么?

Authenticate with LiberFi: register a new account, log in, manage session state, and verify wallet assignments. Two login modes are supported: 1. Key-based (... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 132 次。

如何安装 Liberfi Auth?

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

Liberfi Auth 是免费的吗?

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

Liberfi Auth 支持哪些平台?

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

谁开发了 Liberfi Auth?

由 bombmod(@bombmod)开发并维护,当前版本 v1.0.1。

💬 留言讨论