Skip to content

Add native wallet planning and protocol policies for v0.2.0 - #2

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 TypeScript implementation remains native in Node and browsers, with immutable policies and bigint protocol values. It does not require a Go or Rust runtime.

Validation:

  • npm test: 27 tests pass, including the browser bundle and exact Rust/Hoon fixtures.
  • npm run check: TypeScript and Prettier pass.
  • npm pack: version 0.2.0 builds; the resulting tarball installs and its planner, migration, lock-tree, and fee exports pass a smoke check.
  • Shared JSON copies and Hoon SHA-256 checksums match the reproducible Go-repository fixture exporter.

Related core work: SWPSCO/tx-types#25

@yapishu
yapishu merged commit 7a06a5c 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