Skip to content

Sign the change-paired Orchard spends NU6.3 bundles require - #11

Open
sqhell wants to merge 2 commits into
red-dev-inc:mainfrom
sqhell:fix/sign-change-paired-spends
Open

sqhell wants to merge 2 commits into
red-dev-inc:mainfrom
sqhell:fix/sign-change-paired-spends

Conversation

@sqhell

@sqhell sqhell commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

  • After the key-path pass, the snap signer tries every Orchard and Ironwood action with the account's spend authorizing key and keeps the signatures it controls; the signer rejects the rest with WrongSpendAuthorizingKey. This mirrors how librustzcash's own test harness signs these bundles.
  • A native test builds the post-NU6.3 bundle shape (one real spend, one change output), tags only the real spend, round-trips through the wire format, signs, and asserts both actions carry a signature. It fails on the previous signer.

Why

From NU6.3 the Orchard pool disallows cross-address transfers, so the builder pairs every change output with a zero-valued spend at the wallet's own change address. That spend carries no key path, the signer picked actions by key path, and every post-NU6.3 send failed at broadcast with Orchard(Extract(MissingSpendAuthSig)).

Stack

Position 7 of 15 in the WebZjs release order, to be merged in this order into main. Independent of the feature PRs but rebased on #20 (chore/rust-checks) so its checks are green; the commits of this PR alone are here: sqhell/WebZjs@chore/rust-checks...fix/sign-change-paired-spends

  1. Make rustfmt and clippy pass on main #20 chore/rust-checks
  2. Reuse one web worker for every sync instead of spawning per call #6 fix/reuse-sync-worker
  3. Accept Trailers-Only gRPC responses from lightwalletd #7 fix/grpc-web-trailers-only
  4. Keep the Full Resync form usable during background syncs #8 fix/resync-dialog
  5. Send again from the transaction history, with a caution for new recipients #9 feat/send-again
  6. Surface PCZT parse and signer errors instead of trapping; readable transfer errors #10 fix/pczt-parse-error
  7. Sign the change-paired Orchard spends NU6.3 bundles require #11 fix/sign-change-paired-spends (this PR)
  8. Stop a full resync from an old birthday exhausting the wasm heap #12 fix/historic-sync-oom
  9. Point to Full Resync from the end of the transaction history #13 feat/history-resync-hint
  10. Make wallet persistence refuse stale and silent overwrites #14 fix/wallet-store-epochs
  11. Spend and count the Ironwood (NU6.3) pool #15 feat/ironwood-pool
  12. Classify history by what the wallet spent, not only by what it received #16 fix/history-from-spends
  13. Wallet stats card on the account summary #17 feat/wallet-stats
  14. Bounded sync steps, instance ids, close and worker poisoning #18 feat/resumable-sync
  15. Resumable, checkpointed full resync driven by sync steps #19 feat/resync-resume

Rust pins reference sqhell/zcash_client_memory and sqhell/librustzcash by revision so CI builds exactly what was tested; once the zcash_client_memory stack (red-dev-inc/zcash_client_memory #16 to #21) merges, the memory pin goes back to red-dev-inc/zcash_client_memory feat/snap-nu63. The integration branch test/all-fixes on the fork merges all fourteen and is the build that was tested end to end.

Tests

cargo test -p webzjs-keys
just build

Rust-Checks has failed on main since the NU6.3 toolchain bump: rustfmt
differs in nine files, and clippy on nightly-2025-06-15 rejects ten
uninlined format arguments in webzjs-keys and one map iteration in
webzjs-requests under -D warnings. Apply rustfmt and clippy's own
suggestions; no behaviour changes.
From NU6.3 the Orchard pool disallows cross-address transfers, so the
transaction builder pairs every change output with a zero-valued spend at
the wallet's own change address. That spend carries no dummy key (the IO
finalizer cannot sign it) and zcash_client_backend attaches a ZIP 32 key
path only to the real spends. The snap signer picked actions by key path,
so the change-paired spend was never signed and every post-NU6.3 send
failed at broadcast with Orchard(Extract(MissingSpendAuthSig)).

After the key-path pass, try every Orchard and Ironwood action with the
account's spend authorizing key and keep the signatures it controls; the
signer rejects the rest with WrongSpendAuthorizingKey. This mirrors how
librustzcash's own test harness signs these bundles.

The native test builds the wallet's post-NU6.3 Orchard bundle shape (one
real spend, one change output), finalizes IO, tags only the real spend,
round-trips through the wire format, signs through pczt_sign_inner and
asserts both actions carry a signature. It fails on the previous signer.
@sqhell
sqhell force-pushed the fix/sign-change-paired-spends branch from f2fa154 to c9624ce Compare October 19, 2026 16:51

This branch has not been deployed

No deployments
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