OpenMath Claim Reward
Instructions
Query and withdraw rewards for verified OpenMath activity on Shentu. Flow: query bounty rewards → withdraw via bounty withdraw-rewards → wait 5–10 s → re-query. Uses SHENTU_CHAIN_ID and SHENTU_NODE_URL for runtime chain/RPC settings, with built-in mainnet defaults if unset. Shared config resolution order: --config <path> → OPENMATH_ENV_CONFIG → ./.openmath-skills/openmath-env.json → ~/.openmath-skills/openmath-env.json. If OPENMATH_ENV_CONFIG is set, treat it as the selected config path. If that file is missing or invalid, stop and fix it instead of silently falling back.
Requires trusted local python3 and shentud binaries on PATH. Read-only reward queries shell out to local shentud and query a Shentu RPC endpoint. Withdrawals additionally rely on the local OS keyring via shentud --keyring-backend os. Before any withdrawal, confirm the key name, resolved address, and node URL with the user.
First-run gate
If the user already provided an address explicitly, reward query can run immediately.
If no address was provided, auto-discover prover_address from OPENMATH_ENV_CONFIG when it is set; otherwise check only ./.openmath-skills/openmath-env.json or ~/.openmath-skills/openmath-env.json. If no usable config exists, or if the config exists but prover_address is missing, do not guess the address. Follow references/init-setup.md.
For withdrawals, do not proceed until a local os keyring key is known for the same address.
Do not broadcast a withdrawal until the user confirms the matching key name/address and the RPC node they want to use.
Workflow checklist
- - [ ] Env: If needed, export
SHENTU_CHAIN_ID / SHENTU_NODE_URL, or set OPENMATH_ENV_CONFIG to a specific openmath-env.json; otherwise use the built-in mainnet defaults and standard config auto-discovery. - [ ] Address: Use an explicit address, or let
query_reward_status.py rewards auto-discover prover_address from OPENMATH_ENV_CONFIG or the standard openmath-env.json locations. - [ ] Query: Run
query_reward_status.py rewards [address] (or shentud q bounty rewards <address> --node <shentu_node_url>) to see imported_rewards and/or proof_rewards. - [ ] Withdraw: If any bucket is non-empty, first make sure a local
os keyring key controls the same address, confirm shentud keys show <your-key> -a --keyring-backend os matches the reward address, then run shentud tx bounty withdraw-rewards --from <your-key> --keyring-backend os --chain-id <shentu_chain_id> --node <shentu_node_url> --gas-prices 0.025uctk --gas-adjustment 2.0 --gas auto (use SHENTU_CHAIN_ID / SHENTU_NODE_URL or the built-in defaults). - [ ] Wait: 5–10 s for block inclusion.
- [ ] Re-query: Run
query_reward_status.py tx <txhash> --wait-seconds 6, then query_reward_status.py rewards <address> --wait-seconds 6 to confirm withdrawal; empty buckets are reported as zero, not error.
Scripts
| Script | Command | Use when |
|---|
| Query rewards | INLINECODE39 | Checking claimable importedrewards and proofrewards for an address, or auto-discovering prover_address from --config, OPENMATH_ENV_CONFIG, or the default config locations when omitted. |
| Query tx |
python3 scripts/query_reward_status.py tx <txhash> [--wait-seconds 6] | After withdraw broadcast to confirm inclusion. |
Withdraw is done with raw shentud tx bounty withdraw-rewards --keyring-backend os (see workflow above).
Notes
- - Buckets:
imported_rewards (theorem imported/referenced), proof_rewards (proofs verified). One withdraw pulls both if present. - Mainnet: Default
--chain-id shentu-2.2 --node https://rpc.shentu.org:443. - Config override: Set
OPENMATH_ENV_CONFIG=/path/to/openmath-env.json or use --config if you want a non-default config path. - Requirements: Requires trusted local
python3 and shentud on PATH. - Env vars:
OPENMATH_ENV_CONFIG, SHENTU_CHAIN_ID, and SHENTU_NODE_URL are optional overrides, not required for the default mainnet flow. - Keyring: Always use
--keyring-backend os for reward withdrawal commands generated from this skill. - Trust boundary: Reward queries shell out to local
shentud; withdrawals also sign through the local OS keyring. Verify the key name, resolved address, and RPC/node URL before broadcasting.
References
Load when needed (one level from this file):
Identity setup for theorem submission still lives in openmath-submit-theorem, but reward querying itself does not require openmath-env.json.
OpenMath 奖励领取
说明
查询并提取在Shentu上已验证的OpenMath活动奖励。流程:查询bounty rewards → 通过bounty withdraw-rewards提取 → 等待5-10秒 → 重新查询。使用SHENTUCHAINID和SHENTUNODEURL进行运行时链/RPC设置,若未设置则使用内置主网默认值。共享配置解析顺序:--config <路径> → OPENMATHENVCONFIG → ./.openmath-skills/openmath-env.json → ~/.openmath-skills/openmath-env.json。如果设置了OPENMATHENVCONFIG,则将其视为选定的配置路径。如果该文件缺失或无效,则停止并修复,而不是静默回退。
需要在PATH上存在可信的本地python3和shentud二进制文件。只读奖励查询通过本地shentud执行,并查询Shentu RPC端点。提取操作额外依赖本地操作系统密钥环,通过shentud --keyring-backend os实现。在任何提取操作前,需与用户确认密钥名称、解析地址和节点URL。
首次运行门控
如果用户已明确提供地址,奖励查询可立即执行。
如果未提供地址,当设置了OPENMATHENVCONFIG时,自动发现其中的proveraddress;否则仅检查./.openmath-skills/openmath-env.json或~/.openmath-skills/openmath-env.json。如果不存在可用的配置,或配置存在但缺少proveraddress,不要猜测地址。请参考references/init-setup.md。
对于提取操作,在确认本地os密钥环中存在对应地址的密钥之前,不要继续执行。
在用户确认匹配的密钥名称/地址以及要使用的RPC节点之前,不要广播提取交易。
工作流检查清单
- - [ ] 环境:如有需要,导出SHENTUCHAINID / SHENTUNODEURL,或将OPENMATHENVCONFIG设置为特定的openmath-env.json;否则使用内置主网默认值和标准配置自动发现。
- [ ] 地址:使用明确的地址,或让queryrewardstatus.py rewards从OPENMATHENVCONFIG或标准openmath-env.json位置自动发现proveraddress。
- [ ] 查询:运行queryrewardstatus.py rewards [地址](或shentud q bounty rewards <地址> --node nodeurl>)查看importedrewards和/或proofrewards。
- [ ] 提取:如果任一桶非空,首先确保本地os密钥环密钥控制同一地址,确认shentud keys show <你的密钥> -a --keyring-backend os与奖励地址匹配,然后运行shentud tx bounty withdraw-rewards --from <你的密钥> --keyring-backend os --chain-id chainid> --node nodeurl> --gas-prices 0.025uctk --gas-adjustment 2.0 --gas auto(使用SHENTUCHAINID / SHENTUNODEURL或内置默认值)。
- [ ] 等待:等待5-10秒以包含区块。
- [ ] 重新查询:运行queryrewardstatus.py tx <交易哈希> --wait-seconds 6,然后运行queryreward_status.py rewards <地址> --wait-seconds 6确认提取;空桶报告为零,而非错误。
脚本
| 脚本 | 命令 | 使用场景 |
|---|
| 查询奖励 | python3 scripts/queryrewardstatus.py rewards [地址] [--config <路径>] [--wait-seconds 0] | 检查地址的可领取importedrewards和proofrewards,或从--config、OPENMATHENVCONFIG或省略时的默认配置位置自动发现proveraddress。 |
| 查询交易 |
python3 scripts/queryreward_status.py tx <交易哈希> [--wait-seconds 6] | 提取广播后确认包含情况。 |
提取使用原始shentud tx bounty withdraw-rewards --keyring-backend os完成(参见上方工作流)。
备注
- - 桶:importedrewards(导入/引用的定理),proofrewards(已验证的证明)。一次提取可同时提取两者(如果存在)。
- 主网:默认--chain-id shentu-2.2 --node https://rpc.shentu.org:443。
- 配置覆盖:设置OPENMATHENVCONFIG=/path/to/openmath-env.json或使用--config(如需非默认配置路径)。
- 要求:需要在PATH上存在可信的本地python3和shentud。
- 环境变量:OPENMATHENVCONFIG、SHENTUCHAINID和SHENTUNODEURL为可选覆盖项,默认主网流程不需要。
- 密钥环:对于此技能生成的奖励提取命令,始终使用--keyring-backend os。
- 信任边界:奖励查询通过本地shentud执行;提取操作还通过本地操作系统密钥环签名。在广播前验证密钥名称、解析地址和RPC/节点URL。
参考
需要时加载(相对于此文件一级目录):
定理提交的身份设置仍在openmath-submit-theorem中,但奖励查询本身不需要openmath-env.json。