Skip to content

ZCon portable demo: Raspberry Pi agent computer paid with Zcash - #79

Merged
amiller merged 30 commits into
mainfrom
work/zcon-portable-public
Oct 30, 2026
Merged

amiller merged 30 commits into
mainfrom
work/zcon-portable-public

Conversation

@amiller

@amiller amiller commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Adds the Raspberry Pi USB demo shown at ZCon as one commit on top of main, with a write-up at portable/zcon-demo/README.md.

The stick boots a Pi 4 from USB into RAM. Every connection goes through Tor, and anything kept lives in an encrypted vault. The agent runs GLM on NEAR AI's TEE hosts after checking attestation, and ~/fund turns ZEC into inference credit: 1Click swap to USDC on Base, then a NEAR AI invoice paid with it. Operator, agent, inference broker, funding and desktop each run as their own Unix user.

What's here: portable/ (Pi platform, inference broker, funding, workspace), the shared lib/ changes it needs (NEAR bridge with retry, coupon-near status reporting), their tests and fixtures, and README links (ZCon demo, teep, awesome-private-inference). The Zcash paragraph in the README is updated to match.

Publication review. Two independent reviewers read all 379 files for device identifiers, credentials, wallet and account IDs, and private-infrastructure references. Fixed before this commit:

  • activation.py hardcoded the demo's Base wallet; it now takes the payer from the custody record, as incoming.py already did.
  • Test fixtures that looked copied from real runs (a home SSID and LAN IP, a disk PARTUUID, the demo vault passphrase, two checksum-valid Zcash deposit addresses, realistic activation amounts) are synthetic now. The fund-view QR reference rows were regenerated with python-qrcode 7.4.2, the independent encoder the test names.
  • Mentions of private hosts and the workspace's local-data/ convention were removed.

No private keys, API keys or tokens were found. The NEAR/NVIDIA attestation fixtures hold only provider evidence and random nonces.

Open question: tests/fixtures/chutes/local-rim.json (and the RIM responses inside tests/fixtures/near/nvidia-local-attestation.json) are NVIDIA RIM files fetched from NVIDIA's public service. tests/fixtures/chutes/README.md notes no redistribution licence was established. Decide whether to keep them before merging.

Tests. Apart from the docs and the sanitized values, the code is identical to the private branch, where the bridge, broker and transport suites pass along with a new retry test. One coupon-near test fails identically on its base. In this tree, the funding test-*.py suites, the edited enrollment, console-status, fund-view and incoming tests pass. Doc link and whitespace checks pass. The offline integration gate has not been run; it's required before main moves.

Not an installable release: building a stick from this tree is not a documented recipe yet.

amiller and others added 30 commits October 25, 2026 18:58
…only networking, encrypted vault, attested NEAR inference and Zcash funding

Imported as one commit from the private development branch (work/zcon-agent-ux at c590366)
after a publication review. Device and wallet identifiers in tests and code were replaced
with synthetic values; activation.py takes its payer from the custody record.
…(account 1000+n), login over per-name Tor circuits, token in the vault
…ed exit (Free2Z refuses Tor exits); pseudonym exit NAME picks a new one
Zcash pseudonyms on Free2Z over Nym
…ough the agent wallet's approved sends; wallet address returns the Orchard-only UA
personalize.py wrote country=US into wpa_supplicant for every stick. The
Wi-Fi JSON now requires a country field (ISO 3166 alpha-2, upper case)
and refuses input without it.
The agent wallet copies the seed of one named account from the desktop
Zkool database. The name was the demo's account label; use a generic
default. The operator creates an account with this name in Zkool, and
agent-wallet.mjs still refuses to start unless exactly one account with
that name and a seed exists. BUILD.md documents the step.
dsmack-wallet wrote disclaimer_accepted into Zkool's first-run
preferences, so whoever opened the wallet never saw the disclaimer.
Zkool now shows it on first open and the user accepts it. Nothing else
reads the flag: the transport and Tor proxy presets are unchanged and
the Super+W flow only gains the one screen on first use.
Both root-only namespace fixtures copied node from the rehearsal VM's
home directory. They now copy the binary named by NODE and fail with
KeyError when it is unset.
pi-ssh, pi-deploy, pi-view, demo-record and vkbd.py, taken from the
operator's own scripts and parameterized: the key, known_hosts, MAC,
capture device and stick serial come from PI_* variables, and the vault
passphrase for demo-record comes from stdin. pi-deploy persist resolves
the stick from PI_STICK_SERIAL on the Pi and refuses unless exactly one
disk matches and the running boot partition is on it.
fetch-zkool.sh downloads the Zkool 6.34.0 aarch64 deb and the trixie
libraries it needs, each checked against a pinned sha256 (libraries
through Debian's signed indexes), and lays out /opt/zkool.
build-teep.sh builds teep at the pinned commit with Go 1.27.3 and
refuses unless the binary matches the shipped hash. zkool_graphql has
no upstream binary for this target, so build-zkool-graphql.sh builds it
from the pinned tag and commit; the README records that a rebuild has
not been compared with the stick's binary.
BUILD.md gives the hardware, the pinned Raspberry Pi OS image, the
steps in order with the public script for each, costs and limits. It
states that no stick has been built end to end from these scripts and
that the demo stick's install layout differs from what stage-runtime.py
writes. The README gains a paragraph on ZECpublish, notes that
pseudonyms are code only, and links BUILD.md and the laptop tools.
The QEMU rehearsal and kiosk recipe, with rehearse.sh,
provision-guest.sh and verify-workspace.py that only it used, and the
workflow for the old portable-pi branch move to docs/history with a
one-line header. portable/raspberry-pi/README.md becomes a short index
pointing to BUILD.md and the subdirectory READMEs.

Kept in place because they are still referenced: the direct-zai profile
(stage-runtime.py, and direct-near-entry.mjs imports direct-zai-broker),
funding/ppq-* (credit-lease-entry.mjs, stage-runtime.py),
browser-ram-launcher.py (sway.config Super+B, stage-runtime.py) and
agent-terminal.py (console-status.py, home-command.py, its tests).

Drop wording that the demo made outdated: portable components are no
longer called experimental, and the funding CLI README no longer says it
has not run on the Pi.
The payload is a tar of DIR's ./, and plain tar -xp applies the archived
mode and mtime of ./ and of every existing directory (/opt, ...) to the
target. A 0700 DIR made / 0700, and persist wrote that to the stick.
Both extractions now use --no-overwrite-dir. test-pi-deploy.sh shows
the old extraction changing a 0755 root to 0700 and pi-deploy try,
with a fake pi-ssh, leaving it 0755.
pi-ssh matched PI_MAC anywhere in an ip neigh line; it now matches the
lladdr field as a prefix. demo-record's screen reader swallowed ssh
errors with || true; a failed read now stops the recording. It also
drops the grep that failed on a blank screen and the bc dependency for
log timestamps. The README says pi-deploy and demo-record need PI_MAC.
The label quoted info.os_image_hash, which the operator supplies and the
quote does not bind, and threw a TypeError when it was missing. It now
quotes the RTMR1 and RTMR2 prefixes from the verified quote. A new test
admits reviewed firmware with an unknown kernel and no os_image_hash.
… forms

Pseudonyms need a Nym client and Free2Z setup that no stick built from
these docs has, so the operator help no longer lists ~/pseudonym; the
command and its wrapper stay. home-command.py accepted ~/pseudonym with
no arguments and passed any one or two words through; it now accepts
only 'pseudonym list' and 'pseudonym new|exit|login|whoami NAME', and a
test covers both the accepted and refused forms.
The ZCon README now says exactly what the broker enforces: UpToDate TDX
and pinned firmware (MRTD, RTMR0); kernel and initrd (RTMR1, RTMR2)
reported only; local GPU verification without revocation; and compose
admission through the instance's DstackApp contract on Base, so NEAR's
contract owner decides which code runs. It states what NEAR can see.

BUILD.md lists the four keys of transit-private.json and what the Base
ETH pays for, and tells upgraders to rename the Zkool account to
"agent" and add country to existing Wi-Fi JSON. The agent guide
describes the repository install layout and the same admission scope.
@amiller

amiller commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

Offline gate (make verify-offline, Node 24.22.1, Linux, locked installs per CONTRIBUTING) at f784063 and at main 7c1d9fa, same checkout and builds:

  • f784063: no suite fails that passes on main.
  • Both fail the same 9 suites with identical per-test failures: mcp, canary, private-work, state-modes, session, tui, fetch, browser, browser-session. On this host that comes from no /usr/bin/chromium and a numpy ABI mismatch in the system Python.
  • The run at cd681ac also failed credit and coupon-no-replay: their out-of-range value was still 4097 after 8b1be7a raised the NEAR coupon cap to 16384. f784063 changes it to 16385; both suites now pass (34/34, 9/9).

@amiller
amiller marked this pull request as ready for review October 30, 2026 12:48
@amiller
amiller merged commit f784063 into main Oct 30, 2026
1 check passed
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