Grants DAO trial
28 November 2026 · Playground lane xx2 · Wave plan
The cooperative uses a 100-credit sandbox treasury. Its controller changes the roster, opens bounded grant proposals and authorizes disbursements. A proposal captures its eligible voter roster and quorum at creation. Members can cast one vote each. The recipient gets a sandbox balance and each successful payout creates one public Rechain award record.
What we built
The app lives at playground/xx2/. It composes a Nyxus governance owner with an
opaque Ashroot database child for ballots. Ashroot's unique secondary index is
(proposal_id, electorate_slot). The slot comes from the actual IC caller's
position in the proposal's immutable sorted electorate. The app maps the index's
expected duplicate refusal to AlreadyVoted and increments the tally after an
accepted ballot. Tallies, roster, proposals and sandbox balances remain within
the governance owner. The actor root attaches that owner and the Rechain award
history, then binds their transient services.
The payout reducer validates quorum, the paid marker and remaining credit while preparing. Rechain admits the record before the reducer's commit writes the paid marker, treasury debit and recipient credit in the same synchronous frame. The history supports verification and replay of awards. Ballot decisions and roster changes stay in the governance owner. The app uses fixed bounded Wire method schemas and registers the audit body and header as named standalone payloads.
Installed results
Canonical wasm64 and the local PocketIC run passed at SDK commit
1d8ed59866a47dcd54c332e4790356524873f15a, SDK tree
c699daad6688a2bb1338634be5f223e58736ea58, with no app features selected.
The compiler was nightly-2026-10-15, rustc 7df81381d027710708209f36b98d11b1c88f8d2e.
The generated-client runner verified 1,636 input and output file hashes from
the canonical manifest. The recorded source list has 1,616 entries and SHA-256
583e87bd5735410d43d4f06dd2913d3417cbdaeb4efdf2fc90ab51f906dbda3f.
The installed Wasm SHA-256 was
248a96f8b2fb73407d6ce647ebfbb84815a0524bba69fe0991c7e83f0dc7a288.
The PocketIC 16.1.0 SHA-256 was
6a9a75ad9b4551d2b0f4a0d954ffb8bd5bbd0ebc44ac00290679b06ad0b2f8e6.
- Changing the current roster preserved older proposals' voter eligibility. The test refused an unauthorized controller call, duplicate roster member, ineligible caller, duplicate ballot and premature payout.
- Two approved grants paid 55 and 35 credits and produced exactly two audit records. A repeated payout and a request for eleven credits with ten credits remaining left balances and history unchanged.
- A populated same-artifact KEEP retained the two records, the paid marker and unique ballot index. A new grant paid the final ten credits and added a third hash-linked record. The host decoded every original payout and independently checked its body commitment and parent link.
The audit check covers hash-chain consistency and the app's payout oracle using generated schemas. IC certificate verification, archives and independent client/service upgrades belong to separate cases. The first canonical native release stage took 3m 6s with a cold target. The last warm build, which recaptured a changed host runner, took 6.35s with the same installed Wasm hash. These are build observations inside the parallel wave.
Authoring findings
| Where the attempt stopped | Cause and working change | What to preserve for a future skill |
|---|---|---|
cargo generate-lockfile --offline could not resolve ic-wire = "=0.34.0". |
The private registry seed predated that release. Running lock generation online followed by cargo fetch --locked on the app populated the lane cache. |
Identify the package and exact version before changing dependencies. Populate a private cache, then run builds with the unchanged pins and --offline --locked. |
The offline canonical build got through app metadata and failed to download cipher v0.5.2. |
The builder also resolves the SDK's full workspace metadata. App-only fetch left dependencies of SDK workspace members absent. cargo fetch --manifest-path cdk-rsx/Cargo.toml --locked fetched the missing locked releases. |
A first-build recipe needs both cache preparations. Add a builder diagnostic that names the manifest and shows its matching fetch command. |
Private Ashroot markers produced E0603. Restricting visibility to the owning module then produced E0446 through the generated root's associated type and E0451 constructing a private ballot row. |
module_memory! exposes a concrete generic memory alias. The compiler needs compatible visibility on schema types that flow through it. Use pub marker types inside the private owner module and a restricted row constructor. Neither requires exporting a memory key or mutable stored row. |
Include a compiled Ashroot-plus-Store example with this exact module split, its required macro syntax such as unsafe pub Ballots, and the distinction between nameable schema markers and storage authority. |
Native cargo check accepted a derived Nyxus proposal with paid_block: Option<u64>. The canonical wasm64 build produced E0080 and native enum requires an explicit tagged representation at the outer module_memory!. |
The physical pass rejected the non-niche retained enum. An explicit repr(u8) alone gave the same diagnostic. The app now declares Payment with #[repr(C, u8)], cdk_rsx_memory_abi::Tagged, explicit numeric tags and the arbitrary_self_types_pointers feature. The public Wire decision schema stayed separate. |
Compile the actual target while choosing retained types. Link to the complete tagged-enum recipe and show the offending type or field in nested physical-layout diagnostics. Memory ABI enum rules |
| The reference for Rechain startup also wires physical peer delivery and certified-tip publishing. | This app only needs local dispatch and append history. It binds a Rechain runtime in the root and opens no controller or transport. The audit client decodes exported records and reconstructs the hash chain. | Choose local history, certified-tip publication, or peer delivery based on the product needs. Name the extra wiring for each option. |
After the first installed business checks passed, bindings.GrantAuditHeader.encode threw a JavaScript TypeError because the export was undefined. |
Registering PayloadType added a descriptor alias and TypeScript type. The canonical method bindings had no runtime object for that alias. The runner now uses the emitted runtime's createPayloadCodec with an extension-tuple root containing one reference to the alias. |
Document the runtime recipe beside the PayloadType example, or emit a generated bounded codec from a payload registration that includes its limits. |
These attempts changed the private app and runner. The verified business checks exposed authoring, diagnostics and setup friction.
Reproduce
From the repository root, with Node 24 and the harness's locked PocketIC and RRT host dependencies prepared:
lane="$PWD/tmp/ai-app-trials-wave1/xx2"
export CARGO_HOME="$lane/cargo-home" CARGO_TARGET_DIR="$lane/target" TMPDIR="$lane/temp"
export CARGO_BUILD_JOBS=3
source tools/env.sh
cargo fetch --manifest-path playground/xx2/Cargo.toml --locked
cargo fetch --manifest-path cdk-rsx/Cargo.toml --locked
cargo check --manifest-path playground/xx2/Cargo.toml --offline --locked
output="$(mktemp -d "$lane/grants-build.XXXXXX")"
python3 cdk-rsx/tools/build-app.py --manifest-path playground/xx2/Cargo.toml \
--out-dir "$output" --name grants --offline --locked
node playground/xx2/smoke.mjs "$output/grants" \
"$PWD/tmp/pr-benchmark-server-download/pocket-ic"
The run checks the generated grants.wire.ts method codecs through PocketIC,
using the artifact's native .wire.json for constructor and audit payload
schemas. Retain the matching .wire.runtime.mjs and .wire.codec.mjs beside
the bindings. Use createPayloadCodec with a single-slot sparse root for each
named payload. The payout decoder consumes the complete sparse Wire payload.
The V3 header hash commits the fixed header core, so the verifier checks and
strips the final empty extension block for this format.
Wire payload registration ·
Rechain commitments
Package boundary
This app's manifest uses path dependencies and mirrors the SDK workspace's
ic-certification vendor patch. The facade and source-policy crate declare
publish = false. The source-policy macro loads
../../../compatibility/resolve.rs outside its own package and expects
compatibility inputs at workspace-relative locations. A crates.io readiness
trial should package the public dependency closure, verify those inputs are
available in each extracted crate, and run the actual builder for an app
outside the SDK checkout. This is a source observation about the current
layout. Facade manifest ·
Source-policy implementation ·
Build guide