ZK Shark Agent
ZK Shark is the Shark of All Streets agent, named in honor of zk Shark,
the legend of ordinals. It wraps the lower-level @clawd/zk-client SDK
and exposes the four operations an agent needs most:
| Method |
Purpose |
agent.attestModel({ modelHash, payloadCommitment, proof, context }) |
Build a publish_attestation instruction. |
agent.commitEncryptedState({ modelHash, ciphertextCommitment, stateVersion, proof }) |
Build a commit_encrypted_state instruction. |
agent.verifyProof({ proof, publicInputs?, ... }) |
Off-chain Groth16 sanity check. |
agent.computeNullifierFor(secret, context) |
Deterministic 32-byte nullifier. |
The class name is ZkSharkAgent. ClawdZkAgent remains exported as a
compatibility alias.
Quick Start
import { ZkSharkAgent, routeIntent, dispatchRoute } from "@clawd/zk-shark-agent";
const agent = await ZkSharkAgent.fromEnv();
const route = routeIntent(
"attest this model 0xab12cd34... with my proof.json",
agent,
{ payloadCommitment: "0x" + "ab".repeat(32), proofPath: "./proof.json" },
);
const result = await dispatchRoute(route, agent);
console.log(result);
The router is deterministic and rule-based. It makes no model calls.
Recognised Intents
| Verb pattern |
Routed action |
Required context |
attest, attestation, publish, publish_attestation |
attestModel |
modelHash, payloadCommitment, proofPath |
commit, commit_state, encrypted state, ciphertext |
commitEncryptedState |
ciphertextCommitment, stateVersion, proofPath |
verify, check, validate |
verifyProof |
proofPath |
nullifier, derive, compute_nullifier |
computeNullifier |
context |
inspect, config, status, show |
describe |
none |
help, usage, how, what |
help |
none |
CLI
zk-shark-agent inspect
zk-shark-agent attest <modelHash> <payloadCommitment> <proof.json> [--context "..."]
zk-shark-agent commit <ciphertextCommitment> <stateVersion> <proof.json> [--model <modelHash>]
zk-shark-agent verify <proof.json>
zk-shark-agent nullifier "context-tag"
zk-shark-agent ask "natural language"
shark-of-all-streets is also available as a binary alias. The legacy
clawd-zk-agent binary remains available for older scripts.
The proof JSON shape is:
{
"a": "0x...",
"b": "0x...",
"c": "0x...",
"verifyingKey": "0x..."
}
Configuration
Use ZK_SHARK_RPC_URL plus the optional ZK_SHARK_* variables declared
in the frontmatter. Legacy CLAWD_ZK_* variables are still accepted as
fallbacks.
Named program aliases:
| Alias |
Purpose |
ZK_SHARK_MAINNET |
Default mainnet placeholder. |
ZK_SHARK_DEVNET |
Devnet placeholder. |
ZK_SHARK_LOCALNET |
Localnet placeholder. |
Legacy CLAWDZK_MAINNET, CLAWDZK_DEVNET, and CLAWDZK_LOCALNET are
also accepted.
Failure Modes
ZK_SHARK_RPC_URL is not set - add it to the environment, or keep
using legacy CLAWD_ZK_RPC_URL.
Invalid ZK_SHARK_PROGRAM_ID/CLAWD_ZK_PROGRAM_ID - the value is not
a base58 pubkey and not a known alias.
proof.a must be 64 bytes - the proof JSON is malformed; re-export
from the prover.
Secret must be at least 16 bytes - supply a real nullifier secret.
Cross-References
- Lower-level SDK:
zk-primitives/client/
- Anchor program:
zk-primitives/programs/clawd-zk/
- Architecture notes:
zk-primitives/docs/ARCHITECTURE.md
- Agent catalog:
AGENTS.md
1---2name: zk-shark-agent3description: Drive ZK Shark, the Shark of All Streets agent, for nullifiers, Groth16 proofs, Light Protocol compressed state, model attestations, encrypted-state commitments, proof checks, nullifier derivation, and deterministic natural-language routing.4when_to_use: |5 Use this skill whenever the request is one of:6 - "attest this model with hash 0xab12... and proof.json"7 - "publish an attestation for my fine-tuned model"8 - "commit this encrypted state blob"9 - "verify this Groth16 proof against the publish inputs"10 - "derive a nullifier for context foo"11 - "show me the ZK Shark config" / "inspect the zk shark agent"12 Do not use it for on-chain trading, voice calls, or generic Solana RPC queries.13inputs:14 - modelHash (optional, hex) - 32-byte model hash for attest intents15 - payloadCommitment (optional, hex) - 32-byte payload commitment for attest16 - ciphertextCommitment (optional, hex) - 32-byte ciphertext commitment for commit17 - stateVersion (optional, number) - version number for commit (default 1)18 - context (optional, string) - domain-separated context tag19 - proofPath (optional, string) - path to a Groth16 proof JSON file20 - proof (optional, Groth16Proof) - inline proof if not loading from disk21outputs:22 - nullifierHex (string) - the derived 32-byte nullifier23 - publicInputsPackedHex (string) - the canonical public input vector24 - instruction (TransactionInstruction) - ready-to-sign Solana instruction25 - signature (string, optional) - transaction signature when a signer is attached26 - summary (string) - human-readable operation summary27env:28 required: [ZK_SHARK_RPC_URL]29 optional:30 - ZK_SHARK_PROGRAM_ID31 - ZK_SHARK_PHOTON_URL32 - ZK_SHARK_API_KEY33 - ZK_SHARK_COMMITMENT34 - ZK_SHARK_KEYPAIR35 - ZK_SHARK_NETWORK36metadata:37 source: https://skillmd.com/skills/solizardking/zk-shark-agent38---3940# ZK Shark Agent4142ZK Shark is the Shark of All Streets agent, named in honor of zk Shark,43the legend of ordinals. It wraps the lower-level `@clawd/zk-client` SDK44and exposes the four operations an agent needs most:4546| Method | Purpose |47|---|---|48| `agent.attestModel({ modelHash, payloadCommitment, proof, context })` | Build a `publish_attestation` instruction. |49| `agent.commitEncryptedState({ modelHash, ciphertextCommitment, stateVersion, proof })` | Build a `commit_encrypted_state` instruction. |50| `agent.verifyProof({ proof, publicInputs?, ... })` | Off-chain Groth16 sanity check. |51| `agent.computeNullifierFor(secret, context)` | Deterministic 32-byte nullifier. |5253The class name is `ZkSharkAgent`. `ClawdZkAgent` remains exported as a54compatibility alias.5556## Quick Start5758```ts59import { ZkSharkAgent, routeIntent, dispatchRoute } from "@clawd/zk-shark-agent";6061const agent = await ZkSharkAgent.fromEnv();6263const route = routeIntent(64 "attest this model 0xab12cd34... with my proof.json",65 agent,66 { payloadCommitment: "0x" + "ab".repeat(32), proofPath: "./proof.json" },67);6869const result = await dispatchRoute(route, agent);70console.log(result);71```7273The router is deterministic and rule-based. It makes no model calls.7475## Recognised Intents7677| Verb pattern | Routed action | Required context |78|---|---|---|79| `attest`, `attestation`, `publish`, `publish_attestation` | `attestModel` | `modelHash`, `payloadCommitment`, `proofPath` |80| `commit`, `commit_state`, `encrypted state`, `ciphertext` | `commitEncryptedState` | `ciphertextCommitment`, `stateVersion`, `proofPath` |81| `verify`, `check`, `validate` | `verifyProof` | `proofPath` |82| `nullifier`, `derive`, `compute_nullifier` | `computeNullifier` | `context` |83| `inspect`, `config`, `status`, `show` | `describe` | none |84| `help`, `usage`, `how`, `what` | `help` | none |8586## CLI8788```bash89zk-shark-agent inspect90zk-shark-agent attest <modelHash> <payloadCommitment> <proof.json> [--context "..."]91zk-shark-agent commit <ciphertextCommitment> <stateVersion> <proof.json> [--model <modelHash>]92zk-shark-agent verify <proof.json>93zk-shark-agent nullifier "context-tag"94zk-shark-agent ask "natural language"95```9697`shark-of-all-streets` is also available as a binary alias. The legacy98`clawd-zk-agent` binary remains available for older scripts.99100The proof JSON shape is:101102```json103{104 "a": "0x...",105 "b": "0x...",106 "c": "0x...",107 "verifyingKey": "0x..."108}109```110111## Configuration112113Use `ZK_SHARK_RPC_URL` plus the optional `ZK_SHARK_*` variables declared114in the frontmatter. Legacy `CLAWD_ZK_*` variables are still accepted as115fallbacks.116117Named program aliases:118119| Alias | Purpose |120|---|---|121| `ZK_SHARK_MAINNET` | Default mainnet placeholder. |122| `ZK_SHARK_DEVNET` | Devnet placeholder. |123| `ZK_SHARK_LOCALNET` | Localnet placeholder. |124125Legacy `CLAWDZK_MAINNET`, `CLAWDZK_DEVNET`, and `CLAWDZK_LOCALNET` are126also accepted.127128## Failure Modes129130- `ZK_SHARK_RPC_URL is not set` - add it to the environment, or keep131 using legacy `CLAWD_ZK_RPC_URL`.132- `Invalid ZK_SHARK_PROGRAM_ID/CLAWD_ZK_PROGRAM_ID` - the value is not133 a base58 pubkey and not a known alias.134- `proof.a must be 64 bytes` - the proof JSON is malformed; re-export135 from the prover.136- `Secret must be at least 16 bytes` - supply a real nullifier secret.137138## Cross-References139140- Lower-level SDK: `zk-primitives/client/`141- Anchor program: `zk-primitives/programs/clawd-zk/`142- Architecture notes: `zk-primitives/docs/ARCHITECTURE.md`143- Agent catalog: `AGENTS.md`