Skip to content

Add shared wallet planning and protocol policies for v0.2.0 - #1

Merged
yapishu merged 1 commit into
mainfrom
reid/shared-wallet-planner
Oct 20, 2026
Merged

yapishu merged 1 commit into
mainfrom
reid/shared-wallet-planner

Conversation

@yapishu

@yapishu yapishu commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Wallet clients need the shared core's lock, metadata, fee, and allocation rules to produce the same transactions across runtimes. This implements those rules natively against tx-types at 02d194605c475013745cc65b26f1413cd098932e and the official Hoon fixtures at 9bcc26c6c57019dfde7f83aad9a9dd4ed5cd7902, and sets the SDK version to 0.2.0.

  • A pure planner handles deterministic automatic/manual selection, sweeps, exact or solved fees, per-input positive seeds, complete parent commitments, and refunds. Payment helpers use this planner.
  • Lock conditions support PKH, inclusive timelocks, hashlocks, and burn primitives; tagged trees preserve full Merkle paths. Fund admission uses an explicit authoritative identity and candidate-height maturity policy.
  • Typed note data covers lock and bridge payloads. Fee sizing follows phase-dependent metadata merging, witness discounts, and saturating arithmetic. Canonical JAM uses structural backreferences with bounded expansion.
  • V0 notes migrate into V1 outputs using complete source, coinbase, and timelock records. Parsing requires those records; signing and merging preserve the reviewed plan and fee context.

The shared corpus checks all 31 tagged lock leaves, Hoon metadata and fee results, seven Rust planner scenarios, and four migration scenarios with exact unsigned and signed bytes. Documentation describes the APIs, height/fee context, and validation boundaries. This does not publish a package or tag.

The native Go APIs and typed WebAssembly adapter expose the same planner. The adapter accepts complete note JAM, returns selected records and fee breakdowns, and carries migration/fund context through inspection and signing. The repository also contains the reproducible cross-SDK fixture exporter.

Validation:

  • go vet ./..., go test -race ./..., and gofmt checks pass.
  • Five parser/JSON fuzz targets pass 5-second smoke runs.
  • Compiled js/wasm integration tests pass, including planner and signed migration goldens; TypeScript declarations check successfully.
  • Fixture regeneration with --check --protocol-corpus testdata/reference.json and all copied Hoon SHA-256 checksums pass.

Related core work: SWPSCO/tx-types#25

@yapishu
yapishu merged commit 2df2a6a into main Oct 20, 2026
4 checks 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