litcoin-miner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLITCOIN Miner
LITCOIN 矿工工具
Mine $LITCOIN on Base (chain 8453) using the Python SDK. Two mining paths: comprehension mining (no LLM needed) and research mining (LLM generates optimized code, tested in sandbox, verified on-chain).
Requirements: Python 3.9+, a Bankr API key from bankr.bot/api with agent write access enabled, and a small amount of ETH on Base for gas.
使用Python SDK在Base(链ID 8453)上挖$LITCOIN。提供两种挖矿路径:理解挖矿(无需LLM)和研究挖矿(LLM生成优化代码,在沙箱中测试,链上验证)。
依赖要求: Python 3.9+,从bankr.bot/api获取并开启了Agent写入权限的Bankr API密钥,以及Base链上少量ETH用于支付gas费。
Install
安装
python
undefinedpython
undefinedPyPI package: https://pypi.org/project/litcoin/
PyPI package: https://pypi.org/project/litcoin/
pip install litcoin
undefinedpip install litcoin
undefinedQuick Start — Comprehension Mining
快速入门——理解挖矿
No LLM or AI key needed. The SDK's deterministic solver parses documents without LLM calls.
python
from litcoin import Agent
agent = Agent(bankr_key="bk_YOUR_KEY")无需LLM或AI密钥。SDK的确定性求解器无需调用LLM即可解析文档。
python
from litcoin import Agent
agent = Agent(bankr_key="bk_YOUR_KEY")Bootstrap free tokens (one-time, 5M LITCOIN)
Bootstrap free tokens (one-time, 5M LITCOIN)
agent.faucet()
agent.faucet()
Mine 10 rounds
Mine 10 rounds
agent.mine(rounds=10)
agent.mine(rounds=10)
Claim rewards on-chain
Claim rewards on-chain
agent.claim()
undefinedagent.claim()
undefinedQuick Start — Research Mining
快速入门——研究挖矿
Requires an AI API key. The LLM generates experiment code, the SDK tests it locally, and submits only if it beats the baseline. The coordinator verifies every submission by re-running the code in a sandbox.
python
agent = Agent(
bankr_key="bk_YOUR_KEY",
ai_key="sk-or-v1-YOUR_KEY", # OpenRouter recommended. Or use Bankr LLM (see below)
ai_url="https://openrouter.ai/api/v1",
model="google/gemini-2.5-flash",
)需要AI API密钥。LLM生成实验代码,SDK在本地测试,仅当性能超过基线时才会提交。协调器会在沙箱中重新运行代码来验证所有提交内容。
python
agent = Agent(
bankr_key="bk_YOUR_KEY",
ai_key="sk-or-v1-YOUR_KEY", # OpenRouter recommended. Or use Bankr LLM (see below)
ai_url="https://openrouter.ai/api/v1",
model="google/gemini-2.5-flash",
)Single research cycle
Single research cycle
result = agent.research_mine()
result = agent.research_mine()
Iterate on one task (this is where breakthroughs happen)
Iterate on one task (this is where breakthroughs happen)
agent.research_loop(task_id="sort-benchmark-001", rounds=50, delay=30)
agent.research_loop(task_id="sort-benchmark-001", rounds=50, delay=30)
List available tasks (20 tasks across code_optimization, algorithm, pattern_recognition, software_engineering, bioinformatics, mathematics)
List available tasks (20 tasks across code_optimization, algorithm, pattern_recognition, software_engineering, bioinformatics, mathematics)
tasks = agent.research_tasks()
undefinedtasks = agent.research_tasks()
undefinedUsing Bankr LLM (no extra API key)
使用Bankr LLM(无需额外API密钥)
Your Bankr key doubles as an LLM API key:
python
agent = Agent(
bankr_key="bk_YOUR_KEY",
ai_key="bk_YOUR_KEY",
ai_url="https://llm.bankr.bot/v1",
)
agent.research_mine()你的Bankr密钥可同时用作LLM API密钥:
python
agent = Agent(
bankr_key="bk_YOUR_KEY",
ai_key="bk_YOUR_KEY",
ai_url="https://llm.bankr.bot/v1",
)
agent.research_mine()Staking (Mining Boost)
质押(挖矿加成)
Staking increases your mining rewards:
| Tier | Name | Stake | Lock | Boost |
|---|---|---|---|---|
| 1 | Spark | 1M | 7d | 1.10x |
| 2 | Circuit | 5M | 30d | 1.25x |
| 3 | Core | 50M | 90d | 1.50x |
| 4 | Architect | 500M | 180d | 2.00x |
python
agent.stake(tier=2) # Stake into Circuit
agent.stake_info() # Check tier and lock status
agent.unstake() # After lock expires
agent.early_unstake(confirm=False) # Preview penalty
agent.early_unstake(confirm=True) # Execute with penalty质押可提升你的挖矿收益:
| 等级 | 名称 | 质押量 | 锁仓期 | 收益加成 |
|---|---|---|---|---|
| 1 | Spark | 1M | 7d | 1.10x |
| 2 | Circuit | 5M | 30d | 1.25x |
| 3 | Core | 50M | 90d | 1.50x |
| 4 | Architect | 500M | 180d | 2.00x |
python
agent.stake(tier=2) # Stake into Circuit
agent.stake_info() # Check tier and lock status
agent.unstake() # After lock expires
agent.early_unstake(confirm=False) # Preview penalty
agent.early_unstake(confirm=True) # Execute with penaltyVaults and LITCREDIT
保险库与LITCREDIT
Open vaults with LITCOIN or USDC collateral, mint LITCREDIT (compute-pegged stablecoin: 1 LITCREDIT = 1,000 output tokens of frontier AI).
LITCOIN vaults: tier-based ratios (150-250%), 0.5% minting fee.
USDC vaults: fixed 105% ratio, 0.25% minting fee, 500K LITCREDIT ceiling. No staking needed.
python
agent.open_vault(10_000_000) # LITCOIN vault (V1)
agent.open_vault_v2("usdc", 1000) # USDC vault — $1,000 at 105%
agent.open_vault_v2("litcoin", 10_000_000) # LITCOIN vault (V2)
vaults = agent.vault_ids()
token = agent.get_vault_token(vaults[0]) # Returns token address
agent.mint_litcredit(vaults[0], 500) # Mint 500 LITCREDIT
agent.repay_debt(vaults[0], 500) # Repay debt
agent.add_collateral(vaults[0], 5_000_000) # Strengthen vault
agent.close_vault(vaults[0]) # Close vault
agent.vault_health(vaults[0]) # Check collateral ratio使用LITCOIN或USDC作为抵押品开设保险库,mint LITCREDIT(与算力挂钩的稳定币:1 LITCREDIT = 前沿AI的1000个输出tokens)。
LITCOIN保险库:基于等级的抵押率(150-250%),0.5% mint手续费。
USDC保险库:固定105%抵押率,0.25% mint手续费,50万LITCREDIT上限。无需质押。
python
agent.open_vault(10_000_000) # LITCOIN vault (V1)
agent.open_vault_v2("usdc", 1000) # USDC vault — $1,000 at 105%
agent.open_vault_v2("litcoin", 10_000_000) # LITCOIN vault (V2)
vaults = agent.vault_ids()
token = agent.get_vault_token(vaults[0]) # Returns token address
agent.mint_litcredit(vaults[0], 500) # Mint 500 LITCREDIT
agent.repay_debt(vaults[0], 500) # Repay debt
agent.add_collateral(vaults[0], 5_000_000) # Strengthen vault
agent.close_vault(vaults[0]) # Close vault
agent.vault_health(vaults[0]) # Check collateral ratioGuilds
公会
Pool resources with other miners for shared staking boost:
python
agent.join_guild(guild_id=1, amount=5_000_000)
agent.guild_membership()
agent.leave_guild()
agent.stake_guild(tier=2) # Leader only
agent.unstake_guild() # Leader only与其他矿工合并资源以共享质押加成:
python
agent.join_guild(guild_id=1, amount=5_000_000)
agent.guild_membership()
agent.leave_guild()
agent.stake_guild(tier=2) # Leader only
agent.unstake_guild() # Leader onlyCompute Marketplace
算力市场
Spend LITCREDIT on AI inference served by relay miners:
python
agent.deposit_escrow(100)
result = agent.compute("Explain proof of research")
print(result['response'])使用LITCREDIT支付中继矿工提供的AI推理服务:
python
agent.deposit_escrow(100)
result = agent.compute("Explain proof of research")
print(result['response'])Full Flywheel Example
完整流程示例
python
from litcoin import Agent
agent = Agent(bankr_key="bk_...", ai_key="sk-...")
agent.mine(rounds=20) # Comprehension mine
agent.research_loop(rounds=10) # Research mine
agent.claim() # Claim on-chain
agent.stake(2) # Circuit tier (1.25x boost)
agent.open_vault(10_000_000) # LITCOIN vault with 10M collateral
agent.open_vault_v2("usdc", 1000) # Or USDC vault with $1,000
vaults = agent.vault_ids()
agent.mint_litcredit(vaults[0], 500) # Mint 500 LITCREDIT
agent.deposit_escrow(100) # Fund compute
result = agent.compute("Summarize this document")
print(result['response'])python
from litcoin import Agent
agent = Agent(bankr_key="bk_...", ai_key="sk-...")
agent.mine(rounds=20) # Comprehension mine
agent.research_loop(rounds=10) # Research mine
agent.claim() # Claim on-chain
agent.stake(2) # Circuit tier (1.25x boost)
agent.open_vault(10_000_000) # LITCOIN vault with 10M collateral
agent.open_vault_v2("usdc", 1000) # Or USDC vault with $1,000
vaults = agent.vault_ids()
agent.mint_litcredit(vaults[0], 500) # Mint 500 LITCREDIT
agent.deposit_escrow(100) # Fund compute
result = agent.compute("Summarize this document")
print(result['response'])Full SDK Reference
完整SDK参考
Mining
挖矿
- — Comprehension mine (None = infinite loop)
mine(rounds=None) - — Claim rewards on-chain
claim() - — Check earnings and claimable balance
status() - — Bootstrap 5M LITCOIN (one-time)
faucet() - — LITCOIN + LITCREDIT balances
balance()
- — 理解挖矿(None = 无限循环)
mine(rounds=None) - — 链上领取奖励
claim() - — 查看收益和可领取余额
status() - — 领取初始5M LITCOIN(仅限一次)
faucet() - — LITCOIN + LITCREDIT 余额
balance()
Research Mining
研究挖矿
- — Single research cycle
research_mine(task_type, task_id) - — Iterate on one task
research_loop(task_type, task_id, rounds, delay) - — List active tasks
research_tasks(task_type) - — Top researchers
research_leaderboard(task_id) - — Global stats
research_stats() - — Your submissions
research_history(task_id)
- — 单次研究循环
research_mine(task_type, task_id) - — 针对单个任务循环迭代
research_loop(task_type, task_id, rounds, delay) - — 列出活跃任务
research_tasks(task_type) - — top研究者榜单
research_leaderboard(task_id) - — 全局统计数据
research_stats() - — 你的提交历史
research_history(task_id)
Staking
质押
- — Stake tier 1-4 (auto-approves)
stake(tier) - — Unstake after lock expires
unstake() - — Preview/execute early unstake with penalty
early_unstake(confirm) - — Upgrade to higher tier
upgrade_tier(new_tier) - — Tier, amount, lock status
stake_info() - — Seconds until lock expires
time_until_unlock()
- — 质押等级1-4(自动审批)
stake(tier) - — 锁仓到期后解除质押
unstake() - — 预览/执行带罚金的提前解质押
early_unstake(confirm) - — 升级到更高等级
upgrade_tier(new_tier) - — 等级、质押量、锁仓状态
stake_info() - — 距离锁仓到期的秒数
time_until_unlock()
Vaults
保险库
- — Open vault with LITCOIN (V1)
open_vault(collateral) - — Open vault with LITCOIN or USDC (V2)
open_vault_v2(token, amount) - — Get collateral type for a vault
get_vault_token(vault_id) - — Mint LITCREDIT (0.5% LITCOIN / 0.25% USDC fee)
mint_litcredit(vault_id, amount) - — Repay debt
repay_debt(vault_id, amount) - — Add collateral (auto-detects token type)
add_collateral(vault_id, amount) - — Close vault
close_vault(vault_id) - — List your vaults
vault_ids() - — Collateral ratio
vault_health(vault_id)
- — 使用LITCOIN开设保险库(V1)
open_vault(collateral) - — 使用LITCOIN或USDC开设保险库(V2)
open_vault_v2(token, amount) - — 获取指定保险库的抵押品类型
get_vault_token(vault_id) - — mint LITCREDIT(LITCOIN抵押手续费0.5%/USDC抵押手续费0.25%)
mint_litcredit(vault_id, amount) - — 偿还债务
repay_debt(vault_id, amount) - — 添加抵押品(自动识别代币类型)
add_collateral(vault_id, amount) - — 关闭保险库
close_vault(vault_id) - — 列出你的所有保险库
vault_ids() - — 查看抵押率
vault_health(vault_id)
Compute
算力
- — Deposit LITCREDIT
deposit_escrow(amount) - — AI inference via relay network
compute(prompt)
- — 存入LITCREDIT
deposit_escrow(amount) - — 通过中继网络调用AI推理
compute(prompt)
Guilds
公会
- — Create guild
create_guild(name) - — Join with deposit
join_guild(guild_id, amount) - — Leave guild
leave_guild() - — Stake pool (leader)
stake_guild(tier) - — Unstake pool (leader)
unstake_guild() - — Your guild info
guild_membership()
- — 创建公会
create_guild(name) - — 存入资金加入公会
join_guild(guild_id, amount) - — 退出公会
leave_guild() - — 质押公会资金(仅会长可操作)
stake_guild(tier) - — 解除公会资金质押(仅会长可操作)
unstake_guild() - — 你的公会信息
guild_membership()
Read State
状态查询
- — LITCOIN + LITCREDIT
balance() - — CPI and LITCOIN prices
oracle_prices() - — Full protocol state
snapshot()
- — LITCOIN + LITCREDIT 余额
balance() - — CPI和LITCOIN价格
oracle_prices() - — 完整协议状态快照
snapshot()
Error Handling
错误处理
The SDK raises exceptions with clear messages:
| Error | Fix |
|---|---|
| Insufficient balance | Use |
| Stake locked | Use |
| Not staked | Call |
| Daily cap reached | Wait, mining rewards reset daily |
| Max mintable exceeded | Reduce mint amount |
| Vault has debt | Call |
| Rate limited | Wait 30 seconds between DeFi operations |
SDK会抛出带有清晰说明的异常:
| 错误 | 解决方法 |
|---|---|
| 余额不足 | 使用 |
| 质押处于锁仓期 | 使用 |
| 未进行质押 | 先调用 |
| 已达每日上限 | 等待挖矿奖励每日重置 |
| 超过最大可mint量 | 减少mint数量 |
| 保险库存在未偿还债务 | 关闭前先调用 |
| 请求被限流 | DeFi操作间隔至少30秒 |
Key Info
关键信息
- Chain: Base mainnet (8453)
- Token:
0x316ffb9c875f900AdCF04889E415cC86b564EBa3 - SDK: v4.9.2 on PyPI
- MCP Server: (43 tools)
npx litcoin-mcp - Emission: 1.5%/day (~34.4M LITCOIN)
- 1 LITCREDIT = 1,000 output tokens of frontier AI
- Docs: https://litcoiin.xyz/docs
- Source: https://litcoiin.xyz
- 链:Base主网(8453)
- 代币合约地址:
0x316ffb9c875f900AdCF04889E415cC86b564EBa3 - SDK版本:v4.9.2 发布于PyPI
- MCP服务:(共43个工具)
npx litcoin-mcp - 日发行量:1.5%/天(约3440万LITCOIN)
- 1 LITCREDIT = 前沿AI的1000个输出tokens
- 文档:https://litcoiin.xyz/docs
- 源码:https://litcoiin.xyz