litcoin-miner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LITCOIN 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
undefined
python
undefined
pip install litcoin
undefined
pip install litcoin
undefined

Quick 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()
undefined
agent.claim()
undefined

Quick 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()
undefined
tasks = agent.research_tasks()
undefined

Using 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:
TierNameStakeLockBoost
1Spark1M7d1.10x
2Circuit5M30d1.25x
3Core50M90d1.50x
4Architect500M180d2.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
质押可提升你的挖矿收益:
等级名称质押量锁仓期收益加成
1Spark1M7d1.10x
2Circuit5M30d1.25x
3Core50M90d1.50x
4Architect500M180d2.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

Vaults 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 ratio

Guilds

公会

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 only

Compute 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

挖矿

  • mine(rounds=None)
    — Comprehension mine (None = infinite loop)
  • claim()
    — Claim rewards on-chain
  • status()
    — Check earnings and claimable balance
  • faucet()
    — Bootstrap 5M LITCOIN (one-time)
  • balance()
    — LITCOIN + LITCREDIT balances
  • mine(rounds=None)
    — 理解挖矿(None = 无限循环)
  • claim()
    — 链上领取奖励
  • status()
    — 查看收益和可领取余额
  • faucet()
    — 领取初始5M LITCOIN(仅限一次)
  • balance()
    — LITCOIN + LITCREDIT 余额

Research Mining

研究挖矿

  • research_mine(task_type, task_id)
    — Single research cycle
  • research_loop(task_type, task_id, rounds, delay)
    — Iterate on one task
  • research_tasks(task_type)
    — List active tasks
  • research_leaderboard(task_id)
    — Top researchers
  • research_stats()
    — Global stats
  • research_history(task_id)
    — Your submissions
  • research_mine(task_type, task_id)
    — 单次研究循环
  • research_loop(task_type, task_id, rounds, delay)
    — 针对单个任务循环迭代
  • research_tasks(task_type)
    — 列出活跃任务
  • research_leaderboard(task_id)
    — top研究者榜单
  • research_stats()
    — 全局统计数据
  • research_history(task_id)
    — 你的提交历史

Staking

质押

  • stake(tier)
    — Stake tier 1-4 (auto-approves)
  • unstake()
    — Unstake after lock expires
  • early_unstake(confirm)
    — Preview/execute early unstake with penalty
  • upgrade_tier(new_tier)
    — Upgrade to higher tier
  • stake_info()
    — Tier, amount, lock status
  • time_until_unlock()
    — Seconds until lock expires
  • stake(tier)
    — 质押等级1-4(自动审批)
  • unstake()
    — 锁仓到期后解除质押
  • early_unstake(confirm)
    — 预览/执行带罚金的提前解质押
  • upgrade_tier(new_tier)
    — 升级到更高等级
  • stake_info()
    — 等级、质押量、锁仓状态
  • time_until_unlock()
    — 距离锁仓到期的秒数

Vaults

保险库

  • open_vault(collateral)
    — Open vault with LITCOIN (V1)
  • open_vault_v2(token, amount)
    — Open vault with LITCOIN or USDC (V2)
  • get_vault_token(vault_id)
    — Get collateral type for a vault
  • mint_litcredit(vault_id, amount)
    — Mint LITCREDIT (0.5% LITCOIN / 0.25% USDC fee)
  • repay_debt(vault_id, amount)
    — Repay debt
  • add_collateral(vault_id, amount)
    — Add collateral (auto-detects token type)
  • close_vault(vault_id)
    — Close vault
  • vault_ids()
    — List your vaults
  • vault_health(vault_id)
    — Collateral ratio
  • open_vault(collateral)
    — 使用LITCOIN开设保险库(V1)
  • open_vault_v2(token, amount)
    — 使用LITCOIN或USDC开设保险库(V2)
  • get_vault_token(vault_id)
    — 获取指定保险库的抵押品类型
  • mint_litcredit(vault_id, amount)
    — mint LITCREDIT(LITCOIN抵押手续费0.5%/USDC抵押手续费0.25%)
  • repay_debt(vault_id, amount)
    — 偿还债务
  • add_collateral(vault_id, amount)
    — 添加抵押品(自动识别代币类型)
  • close_vault(vault_id)
    — 关闭保险库
  • vault_ids()
    — 列出你的所有保险库
  • vault_health(vault_id)
    — 查看抵押率

Compute

算力

  • deposit_escrow(amount)
    — Deposit LITCREDIT
  • compute(prompt)
    — AI inference via relay network
  • deposit_escrow(amount)
    — 存入LITCREDIT
  • compute(prompt)
    — 通过中继网络调用AI推理

Guilds

公会

  • create_guild(name)
    — Create guild
  • join_guild(guild_id, amount)
    — Join with deposit
  • leave_guild()
    — Leave guild
  • stake_guild(tier)
    — Stake pool (leader)
  • unstake_guild()
    — Unstake pool (leader)
  • guild_membership()
    — Your guild info
  • create_guild(name)
    — 创建公会
  • join_guild(guild_id, amount)
    — 存入资金加入公会
  • leave_guild()
    — 退出公会
  • stake_guild(tier)
    — 质押公会资金(仅会长可操作)
  • unstake_guild()
    — 解除公会资金质押(仅会长可操作)
  • guild_membership()
    — 你的公会信息

Read State

状态查询

  • balance()
    — LITCOIN + LITCREDIT
  • oracle_prices()
    — CPI and LITCOIN prices
  • snapshot()
    — Full protocol state
  • balance()
    — LITCOIN + LITCREDIT 余额
  • oracle_prices()
    — CPI和LITCOIN价格
  • snapshot()
    — 完整协议状态快照

Error Handling

错误处理

The SDK raises exceptions with clear messages:
ErrorFix
Insufficient balanceUse
faucet()
or buy more LITCOIN
Stake lockedUse
early_unstake()
or wait for lock to expire
Not stakedCall
stake(tier)
first
Daily cap reachedWait, mining rewards reset daily
Max mintable exceededReduce mint amount
Vault has debtCall
repay_debt()
before closing
Rate limitedWait 30 seconds between DeFi operations
SDK会抛出带有清晰说明的异常:
错误解决方法
余额不足使用
faucet()
领取或购买更多LITCOIN
质押处于锁仓期使用
early_unstake()
或等待锁仓到期
未进行质押先调用
stake(tier)
已达每日上限等待挖矿奖励每日重置
超过最大可mint量减少mint数量
保险库存在未偿还债务关闭前先调用
repay_debt()
请求被限流DeFi操作间隔至少30秒

Key Info

关键信息

  • Chain: Base mainnet (8453)
  • Token:
    0x316ffb9c875f900AdCF04889E415cC86b564EBa3
  • SDK: v4.9.2 on PyPI
  • MCP Server:
    npx litcoin-mcp
    (43 tools)
  • 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服务:
    npx litcoin-mcp
    (共43个工具)
  • 日发行量:1.5%/天(约3440万LITCOIN)
  • 1 LITCREDIT = 前沿AI的1000个输出tokens
  • 文档:https://litcoiin.xyz/docs
  • 源码:https://litcoiin.xyz