name: operate-clawcommit description: Operate ClawCommit workflows in this repository, including contract deployment, commit/reveal execution, deterministic replay verification, Merkle batch commitments, OpenClaw Native PR/merge tracking, and integration setup for MCP/SDK/GitHub Actions. Use when requests involve scripts under scripts/ or scripts/batch/, deployment-proof artifacts, OpenClaw artifacts/workflows, V2 hash validation, or ClawCommit integration wiring.
Operate ClawCommit
Overview
Execute ClawCommit protocol operations with the repository's canonical commands and deterministic hash model. Load only the reference file needed for the requested workflow.
Start
- Confirm environment and dependencies.
node -v(18+ expected)npm install
- Prepare environment for networked actions.
cp .env.example .env- Set
BSC_RPC_URL,DEPLOYER_PRIVATE_KEY, andBSCSCAN_API_KEYwhen needed.
- Run baseline checks before deployment or mainnet transactions.
npx hardhat compilenpm test
- Select and load the matching reference.
- Core commit/reveal/replay/deploy:
references/core-workflow.md - Merkle batch flow:
references/batch-workflow.md - MCP/SDK/GitHub Action integration:
references/integrations-workflow.md - OpenClaw workflow:
skills/openclaw-native/references/workflow.md
Operating Rules
- Preserve the V2 hash model exactly:
keccak256(abi.encode(prompt, output, modelVersion, nonce)). - Reuse identical payload fields and
noncebetween commit and reveal. - Default to
bsconly when the user requests mainnet or does not override network. - Save proof outputs in
deployment-proof/and batch outputs inartifacts/batches/. - Capture and report contract address, commit/batch IDs, transaction hashes, and verification results.
- Confirm intent before running any state-changing mainnet command.
Fast Paths
- One-shot deploy plus proof artifacts:
npx hardhat run scripts/deployAndProve.ts --network bsc - Local batch walkthrough:
npm run batch:demo:local - Standalone replay check:
npx ts-node scripts/replay.ts --tx <REVEAL_TX_HASH>
Bundled Scripts
scripts/preflight.shRun install, compile, and tests in one command before onchain work.
bash <skill-dir>/scripts/preflight.sh --repo <repo-path> [--skip-install]
scripts/decision_cycle.shRun commit -> reveal -> replay as one flow and emit a machine-readable summary.
bash <skill-dir>/scripts/decision_cycle.sh \
--repo <repo-path> \
--contract <CONTRACT_ADDRESS> \
--prompt "<PROMPT>" \
--output "<OUTPUT>" \
--model-version "<MODEL_VERSION>" \
--network bsc \
--json-out deployment-proof/decision-cycle-summary.json
Supports explicit mainnet opt-in for both commit and reveal:
--allow-mainnet-writes truescripts/batch_local_cycle.shRun build -> recomputeRoot -> generateProof -> replayBatch --local and optionally write summary JSON.
bash <skill-dir>/scripts/batch_local_cycle.sh \
--repo <repo-path> \
--in data/decisions-batch-001.ndjson \
--out artifacts/batches/batch-001.manifest.json \
--model-version clawcommit-v2.0 \
--leaf-index 1 \
--json-out artifacts/batches/batch-001.local-cycle.json
References
references/core-workflow.mdreferences/batch-workflow.mdreferences/integrations-workflow.md