← 返回
未分类 中文

ZKGov

Anonymous governance on HashKey Chain using zero-knowledge proofs. Query proposals, check voter status, register, create proposals, vote anonymously with ZK...
在HashKey链上使用零知识证明实现匿名治理:查询提案、查看投票者状态、注册、创建提案、ZK匿名投票
blockchain-oracle blockchain-oracle 来源
未分类 clawhub v0.0.3 1 版本 100000 Key: 无需
★ 0
Stars
📥 324
下载
💾 0
安装
1
版本
#blockchain#governance#hashkey#latest#zk

概述

ZKGov

ZKGov is a zero-knowledge governance platform on HashKey Chain testnet (chain ID 133). Voters register with Semaphore identity commitments and cast anonymous, Groth16-verified votes on governance proposals.

Install

# MCP server (preferred — works with Claude Code, Cursor, Windsurf, VS Code)
# https://www.npmjs.com/package/@zkgov/mcp
claude mcp add zkgov npx @zkgov/mcp

# Standalone CLI
# https://www.npmjs.com/package/@zkgov/cli
npm install -g @zkgov/cli
zkgov --help

Mode priority

  1. MCP tools first. If tools prefixed mcp__zkgov__* are available, call them directly.
  2. CLI fallback. If no MCP tools are available, run zkgov via the Bash tool.
  3. --json flag. Always use --json when calling CLI from an agent for reliable parsing.

When to use

  • User asks about governance proposals, voting, or on-chain governance
  • User wants to create, vote on, or check proposals
  • User asks about voter registration or ZK identity
  • User asks about HashKey Chain governance activity
  • User wants an agent to participate in governance autonomously

When NOT to use

  • General blockchain questions answerable from training data
  • Questions about other chains or protocols
  • Math, code review, or general programming tasks

Available tools

Read tools (no wallet needed)

MCP ToolCLI CommandDescription
---------
zkgov-statszkgov statsPlatform stats: total proposals, members, group ID
zkgov-list-proposalszkgov proposalsList all proposals with vote tallies and status
zkgov-proposalzkgov proposal Full proposal detail by ID
zkgov-check-voterzkgov voter
Check if address is a registered voter
zkgov-memberszkgov membersSemaphore group info: member count, Merkle root
zkgov-activityzkgov activityRecent on-chain events with tx hashes

Write tools (require wallet with HSK for gas)

MCP ToolCLI CommandDescription
---------
zkgov-walletzkgov walletShow agent wallet: address, balance, voter status
zkgov-registerzkgov registerRegister wallet as voter (one-time on-chain tx)
zkgov-create-proposalzkgov create </code></td><td>Create a governance proposal</td></tr><tr><td><code>zkgov-vote</code></td><td><code>zkgov vote <id> <choice></code></td><td>Cast anonymous ZK-verified vote</td></tr><tr><td><code>zkgov-finalize</code></td><td><code>zkgov finalize <id></code></td><td>Finalize proposal after voting period ends</td></tr></tbody></table><h2>Wallet</h2><p>On first write operation, a wallet is auto-generated at <code>~/.zkgov/config.json</code> (mode 0o600). The same private key derives both the EVM account and the Semaphore ZK identity.</p><p>Override with env var: <code>ZKGOV_PRIVATE_KEY=0x...</code></p><p>The wallet needs testnet HSK for gas (very cheap — 0.001 gwei gas price).</p><h2>Workflow</h2><ol><li><strong>Check state</strong>: <code>zkgov-stats</code> to see proposals/members count</li><li><strong>Check wallet</strong>: <code>zkgov-wallet</code> to see balance and registration</li><li><strong>Register</strong>: <code>zkgov-register</code> (one-time, ~0.0003 HSK gas)</li><li><strong>Browse</strong>: <code>zkgov-list-proposals</code> → <code>zkgov-proposal</code> for detail</li><li><strong>Vote</strong>: <code>zkgov-vote</code> with proposalId and choice (generates ZK proof, ~3-5s)</li><li><strong>Finalize</strong>: <code>zkgov-finalize</code> after voting period ends (anyone can call)</li></ol><h2>CLI flags</h2><ul><li><code>--json</code> — machine-readable output on every command</li><li><code>zkgov activity --limit 10</code> — limit activity events</li><li><code>zkgov create "Title" -d "Body" -p 86400 -q 3</code> — set period (seconds) and quorum</li></ul><h2>Key facts</h2><ul><li><strong>Chain</strong>: HashKey Chain Testnet (ID: 133, RPC: https://testnet.hsk.xyz)</li><li><strong>Contract</strong>: <code>0xEa625841E031758786141c8b13dD1b1137C9776C</code></li><li><strong>Explorer</strong>: https://testnet-explorer.hsk.xyz</li><li><strong>Vote choices</strong>: 0 = Against, 1 = For, 2 = Abstain</li><li><strong>Nullifiers</strong> prevent double-voting per proposal (hash of identity + proposalId)</li><li><strong>castVote</strong> does NOT check msg.sender — only the ZK proof matters</li><li>Proof generation uses snarkjs WASM, takes 3-5 seconds</li></ul><h2>Error handling</h2><ul><li>"Already registered" → wallet is already a voter, skip registration</li><li>"Nullifier" error → already voted on this proposal</li><li>"Voting ended" → voting period has closed, try <code>zkgov-finalize</code> instead</li><li>"Proposal does not exist" → invalid proposal ID</li><li>Insufficient balance → wallet needs HSK for gas</li></ul></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 1 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v0.0.3</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-05-07 15:31 安全 安全 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://tix.qq.com/search/skill?keyword=4b2a33da77f5084bde67e48c58d73c55" target="_blank">查看报告</a> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://static.cloudsec.tencent.com/html-report-v2/2026/05/26/445444_b994a479ad97f5bfaf4d422f3fcaaf2e.html?q-sign-algorithm=sha1&q-ak=AKID8JMG1bzBC1dz96qNhssfFftujT1NCoFi&q-sign-time=1782548048%3B1814084048&q-key-time=1782548048%3B1814084048&q-header-list=host&q-url-param-list=&q-signature=fd54b73cda969e8fba03243b89b9b3a17461181a" target="_blank">查看报告</a> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">professional</span> <h3><a href="/s/stock-market-pro">Stock Market Pro</a></h3> <div class="rec-owner">kys42</div> <div class="rec-desc">Yahoo Finance (yfinance) 驱动的股票分析技能:行情报价、基本面、ASCII 趋势图、高分辨率图表(RSI/MACD/BB/VWAP/ATR),以及可选的网络...</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 163</span> <span style="color:#5b6abf;">📥 40,261</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">professional</span> <h3><a href="/s/mx-finance-data">All-Market Financial Data Hub</a></h3> <div class="rec-owner">financial-ai-analyst</div> <div class="rec-desc">基于东方财富数据库,支持自然语言查询金融数据,覆盖A股、港股、美股、基金、债券等资产,提供实时行情、公司信息、估值、财务报表等,适用于投资研究、交易复盘、市场监控、行业分析、信用研究、财报审计、资产配置等场景,满足机构与个人需求。返回结果为</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 130</span> <span style="color:#5b6abf;">📥 42,442</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">professional</span> <h3><a href="/s/stock-monitor-skill">Stock Monitor</a></h3> <div class="rec-owner">thirtyfang</div> <div class="rec-desc">全功能智能股票监控预警系统。支持成本百分比、均线金叉死叉、RSI超买超卖、成交量异动、跳空缺口、动态止盈等7大预警规则。符合中国投资者习惯(红涨绿跌)。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 95</span> <span style="color:#5b6abf;">📥 32,810</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>