Skip to content

feat(plugins): ProofKiosk — pay-to-actuate + attested kiosk suite (Track C) - #144

Draft
Sushant6095 wants to merge 34 commits into
zeroclaw-labs:mainfrom
Sushant6095:feat/proofkiosk
Draft

feat(plugins): ProofKiosk — pay-to-actuate + attested kiosk suite (Track C)#144
Sushant6095 wants to merge 34 commits into
zeroclaw-labs:mainfrom
Sushant6095:feat/proofkiosk

Conversation

@Sushant6095

Copy link
Copy Markdown

ProofKiosk — the machine that earns, acts, and proves it

Track C (DePIN & the physical edge) with Track A payment rails inside. A Raspberry Pi
running ZeroClaw becomes a self-service kiosk: a customer pays USDC via Solana Pay in
chat, a cron SOP verifies the payment on-chain and fires a GPIO relay (lock /
dispenser / charger), and the machine keeps a tamper-evident, hash-chained,
Merkle-batched
record of its sensor readings and sale receipts. The agent sells;
deterministic SOPs deliver; the chain proves. No component ever holds a spendable key.

This is not another attestation builder — it is the closed physical loop: money in,
actuation out, proof forever. Every plugin is also useful standalone from a laptop
(no hardware needed to start), and works on any ZeroClaw channel (demoed on Telegram).

What's in it

Component Track Tier Role
crates/kiosk-core E Wasm-friendly Solana substrate: base58, shortvec, Solana Pay, mockable JSON-RPC, memo, durable-nonce, unsigned legacy-message encode, seq/prev chain recovery, output shaping. No solana-sdk.
plugins/kiosk-charge A T1 Solana Pay charge URL + QR payload + unique reference. permissions = ["config_read"] only — zero network, zero secrets; the component imports no wasi:http at all.
plugins/kiosk-watch A T0 Verifies a payment on-chain (recipient + mint + amount + reference + finality) in ONE getSignaturesForAddress + ≤1 getTransaction; single-use reference = replay guard. Its structured verdict — not model text — is what the SOP gates the relay on. Also a device heartbeat.
plugins/kiosk-attest C T1 Hash-chained, durable-nonce, memo-only attestation of readings and receipts (a transfer is not expressible in its output); seq/prev recovered from the chain in ONE call.

Verified (all host-run, no live network)

  • 107 host tests green across the suite (incl. property tests + untrusted-input fuzz hardening), cargo clippy --all-targets -D warnings clean, cargo fmt clean.
  • cargo build --target wasm32-wasip2 --release clean for all three plugins (209 / 347 / 383 KB).
  • Permissions == imports, verified: kiosk-charge imports 0 wasi:http (config_read only); watch/attest import wasi:http exactly matching their http_client grant. Script: scripts/verify-no-network.sh.
  • Layout matches plugins/redact-text exactly: pure core / thin #[cfg(target_family="wasm")] shim, cdylib+rlib, standalone [workspace], structured logging via log-record, wit-bindgen 0.46 against the vendored wit/v0.
  • CI workflow (.github/workflows/proofkiosk-ci.yml): test + clippy + wasm build + no-network proof.

Safety posture

The LLM is untrusted wherever money or actuation is concerned — it sells; deterministic
SOP rules deliver; the chain proves. Recipient, prices, caps, metric bounds all live in
operator config, unreachable from the prompt. Fail-closed injection drills ship as
executable tests + README transcripts per plugin. Third-party trust is declared in
SECURITY.md: the only trusted external system is the operator's own chosen RPC
endpoint — no facilitator, no MCP server, no oracle. Custody is strictly T0/T1; no
shipped component can sign or submit.

Hardware (the Track C part)

Pi 4 + BME280 (I2C) + relay (GPIO). Host built with
plugins-wasm,plugins-wasm-cranelift,hardware,peripheral-rpi. The plugins are
hardware-independent by design (readings/events arrive as tool args from the host's
hardware tools via SOP), so all logic is host-tested today. Wiring diagram + the
on-camera pay→relay→attest demo land this week; SOP examples for the payment loop,
sensor loop, and heartbeat are in sops/.

Reproducibility

PROOFKIOSK.md has a 3-rung ladder (laptop / +sensor / +relay), a 3-line minimal config,
and a 5-minute rung-1 quickstart. scripts/devnet-setup.sh creates a test SPL mint on
devnet/localnet so a reviewer can run the full loop without hardware.

Questions for maintainers

  1. Preferred home for the shared crate: top-level crates/kiosk-core (as here) or publish to crates.io and depend on the registry version?
  2. For a cron SOP step gating relay actuation on kiosk-watch's structured output (when: $.steps.N.paid == "true") — is engine-side condition evaluation the intended pattern, or is there a better host-native gate?

Happy to split into per-plugin PRs if preferred. Building in public on X; active in #solana-bounty.

— Superteam Earn "Build Solana-native plugins for ZeroClaw" submission (Track C ⭐)

…/3 (Track C)

ProofKiosk: pay-to-actuate + attested kiosk suite for a Raspberry Pi running
ZeroClaw. Part 1 is the sales surface:

- kiosk-charge (T1): Solana Pay charge URL + QR payload + payment reference.
  permissions = [config_read] only - zero network, zero secrets; recipient,
  mint, prices and caps come from operator config, never from the model.
  Fail-closed injection drill as executable tests + transcript in README.
- crates/kiosk-core: shared pure substrate - hand-rolled base58 (golden
  vectors), Solana shortvec, Solana Pay transfer-request builder, token-
  budgeted output shaping. No solana-sdk. wasm32-wasip2-friendly.

Layout matches plugins/redact-text: pure core / thin wasm shim, cdylib+rlib,
standalone [workspace], structured logging via log-record, wit-bindgen 0.46.
28 host tests green (no network); wasm32-wasip2 release build clean (~210 KB).

Parts 2-3 (kiosk-watch T0, kiosk-attest T1 with durable nonce + Merkle
batching) land next on this branch, with the Pi wiring diagram and demo.
Sushant6095 pushed a commit to Sushant6095/proofkiosk that referenced this pull request Jul 31, 2026
…holders

Adds the mermaid architecture diagram, the custody-tier table with the honest
'where a skill would suffice' section, the three-rung ladder, the consolidated
injection transcript, and the reproduce-in-an-evening path.

Provenance & links records, plainly:
  - this suite began as draft PR zeroclaw-labs/zeroclaw-plugins#144, opened
    before the listing moved to the showcase format; canonical code now lives
    here per the updated rules, and that PR stays open as the design trail.
  - the explainer site is labelled an EXPLAINER, not the demo — the animated
    sale is illustrative and the real running demo is the video.
  - placeholders for the demo video and the Discord showcase post.

Rung 3 is labelled demo-wired rather than production-wired, in the README body
and not only in the SOP, so a reader cannot miss it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant