feat(plugins): Solana Edge Trio — token-risk-check (T0), depin-attest (T1) + shared core (Track E)#132
Open
mauyaa wants to merge 2 commits into
Open
feat(plugins): Solana Edge Trio — token-risk-check (T0), depin-attest (T1) + shared core (Track E)#132mauyaa wants to merge 2 commits into
mauyaa wants to merge 2 commits into
Conversation
…a shared Solana core crate Two Solana tool plugins built on one hand-rolled, zero-solana-sdk core (no wasm dependency, host-tested, differentially tested against real spl-token-2022 and solana-short-vec), matching the layout of plugins/redact-text. - token-risk-check (T0, read-only): SPL Token-2022 mint risk check -- mint/freeze authority, dangerous extensions (permanent delegate, transfer hook, transfer fee, non-transferable), holder concentration, and LP status via Jupiter's Tokens API v2. Red/amber/green verdict with reasons. - depin-attest (T1, build-only): packages an edge-node sensor/health reading into an unsigned, durable-nonce transaction targeting the SPL Memo program. No secrets held; the durable nonce sidesteps blockhash-expiry in an approval queue and doubles as the replay guard. - crates/zeroclaw-solana-core: shared substrate both plugins build on -- base58, borsh, versioned-transaction construction, durable-nonce handling, JSON-RPC over waki -- submitted for review as the Track E entry, vendored as a self-contained copy inside each plugin's own vendor/ directory so every plugins/*/ directory here builds standalone. Both plugins carry a prompt-injection transcript in their own README, fail closed on malformed/attacker-controlled arguments before any network call, and were verified against the real zeroclaw binary's own plugin install/info/list, plus one live agent turn where the model independently chose to call token_risk_check by name.
The reference plugin (redact-text) doesn't carry one, but the bounty's hard requirements list "MIT License" explicitly, and this matches the per-plugin LICENSE convention used by other Track E/D/C submissions in this repo (e.g. zeroclaw-labs#116).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two Solana tool plugins, one shared core, targeting three suggested tracks with depth over breadth:
plugins/token-risk-checkplugins/depin-attestcrates/zeroclaw-solana-coreNeither plugin ever holds a signing key.
token-risk-checknever mutates state at all.depin-attestreturns an unsigned, durable-nonce transaction for a human or the host to sign — it structurally cannot be prompt-injected into naming a different destination, because its arguments have no account-shaped field in the first place.Both plugins are built on one hand-rolled, zero-
solana-sdkcore (crates/zeroclaw-solana-core, submitted as the Track E entry, independentlycargo test-able with no wasm toolchain), vendored as a self-contained copy inside each plugin's ownvendor/directory soplugins/token-risk-check/andplugins/depin-attest/each build standalone.What it does
token-risk-check(T0): given a mint, reports mint/freeze authority status, dangerous Token-2022 extensions (permanent delegate, transfer hook, transfer fee, non-transferable), holder concentration, and LP status (via Jupiter's Tokens API v2, best-effort behind an optional key) — a red/amber/green verdict with reasons.depin-attest(T1): packages an edge-node sensor/health reading into an unsigned transaction targeting the well-known SPL Memo program, using a durable nonce instead of a recent blockhash — the structural fix for the bounty's own "blockhash expiry in an approval queue" trap, and the nonce doubles as the replay guard.Verified against the real thing, not just
cargo testEvery plugin here was checked against real, unmodified target-application code, not assumed to work from the spec alone:
.wasmcomponents were loaded and executed inside a realwasmtimecomponent-model host built from this repo's own vendoredwit/v0.token-risk-checkmade a realwasi:httpcall tohttps://api.mainnet-beta.solana.comagainst a real mainnet Token-2022 mint (PYUSD), independently confirmed live to carry 866 bytes of TLV extension data, and correctly identified its permanent-delegate and transfer-hook extensions from bytes the parser had never seen before.zeroclaw-labs/zeroclawbinary's ownplugin install/info/list(built locally withplugins-wasm-cranelift) — real production code, zero errors, correct capabilities/permissions reported back.token-risk-checkwas invoked for real inside a livezeroclaw agentturn against Gemini: the model independently decided to calltoken_risk_checkby name with the correctmintargument, and the real WASM component executed inside the real host's tool registry.token-risk-check, 6depin-attest),cargo fmt/clippy clean,wasm32-wasip2 --releasebuilds clean for both plugins.Full transcripts, including the one real interop bug this surfaced (a wasmtime-version-specific linker quirk in a throwaway test harness, unrelated to this repo's pinned
wasmtime = "45.0.3"), are in each plugin's own README.Threat model / prompt injection
Each plugin's README carries a required prompt-injection transcript demonstrating fail-closed behavior — malformed or attacker-controlled arguments (a malicious "mint" string, a smuggled account override) are rejected before any network call or transaction is built, never silently coerced.
What fought us on
wasm32-wasip2Detailed per-crate in
crates/zeroclaw-solana-core's own README and each plugin's README — short version:solana-sdk/solana-clientdon't targetwasm32-wasip2at all, so the core hand-rolls base58, borsh, versioned-transaction construction, and durable-nonce handling, differentially tested against the realspl-token-2022andsolana-short-veccrates (dev-only deps, never shipped in the wasm binary) rather than trusted blind.What's next
depin-attest, wired end-to-end:plugins/depin-attest/README.mdnow has a wiring diagram and a realcron.jobsSOP config chaining the host's actualgpio_readperipheral tool intodepin_attest— verified againstzeroclaw-hardware's real source. What's not done is running it against physical Pi hardware (this was built on a machine with none, andrppalis Linux-only by design).Note on
crates/zeroclaw-solana-coreThis repo has no top-level
crates/convention, so this directory is included for direct review as the Track E entry (cd crates/zeroclaw-solana-core && cargo test, no wasm toolchain needed) — the copies actually used by the two plugins live in their ownvendor/directories and are byte-identical snapshots of it, not forks. Happy to drop the top-level copy if maintainers would rather review it purely through the vendored copies.