Skip to content

Feat/zcash chain runtime - #149

Merged
ByteZhang1024 merged 98 commits into
mainfrom
feat/zcash-chain-runtime
Oct 29, 2026
Merged

ByteZhang1024 merged 98 commits into
mainfrom
feat/zcash-chain-runtime

Conversation

@ByteZhang1024

Copy link
Copy Markdown
Contributor

No description provided.

… key export

- pcztCombine merges a hardware-signed redacted PCZT into the local copy
- importAccountUfvk takes seed fingerprint + account index and imports as
  AccountPurpose::Spending so change outputs carry zip32 derivation
- keys crate exports transparentAccountPubKeyFromUfvk for hardware accounts
`pcztCombine` was a bare Combiner. The Transaction Extractor that follows it
recomputes the sighash from the COMBINED transaction, so it answers "is this
transaction self-consistent", never "is this what the user approved". Combining
now compares the shielded sighash and every transparent input sighash before
and after, rejects a copy that already carries a scriptSig -- the one field a
counterparty can fill that no sighash covers -- and fails before the expensive
proof rather than after it.

Four tests, including one that pins the upstream property the old code silently
depended on: our PCZTs are io-finalized, so tx_modifiable is 0 and the Combiner
refuses to grow them. If a future bump relaxes that, the sighash comparison is
what still covers us.

The stateful shielding path is removed: pcztShield, pcztShieldQuote and their
proposal helpers, plus three dead branches hidden inside live functions
(release_reservation's second reservation table, forget_reservation, and
clear_locked_outputs' second retain). Shielding has gone through the stateless
keys runtime since the 2026-09-14 alignment; nothing had called these since.
README keeps the testnet acceptance record and notes the API is gone rather
than moving the tick to a path that has not been verified on chain.
…ore signing

- add review.rs: verify recipients, amount, fee and change of a signable
  transaction against the approved request before signing
- mark a reservation signed atomically before the host obtains a signature;
  signed reservations no longer expire with the unsigned TTL
- reuse one RingCT output distribution per prepare
…gh the host

- add keys review.rs: check every spend and output of a PCZT against the
  approved request before signing with the seed
- add circuit_keys.rs and pick the Orchard circuit by the transaction's branch
- vendor tonic-web-wasm-client with a host fetch handler patch
- harden transparent send and shielding request validation
- treat only consensus-invalid or expired node replies as a rejection;
  any other broadcast error is an unknown outcome that stays pending and
  is rebroadcast, so the host never invites a resend that could pay twice
- run the durability barrier after a rejection too, since its state is
  written
- drop the Sapling receiver from every unified address policy; this
  runtime cannot spend Sapling notes
- check that the birthday tree state is for the requested block and network
- refuse to build under a reservation id that already has a stored
  transaction
- correct submit, spend source and lock documentation
…and network

- record a send as pending, with its inputs marked spent, before
  broadcasting; undo only a fresh record after an explicit rejection, so
  an interrupted broadcast can never push the next send onto other inputs
- keep the wallet's own sends pending on a reorg rewind instead of
  deleting them and releasing their inputs
- expire signed reservations that never reached broadcast after a day
- cap the fee rate per priority (5x current mainnet values; the old flat
  cap refused the highest priority) and require the protocol quantization
  mask of 10,000
- identify the node's network by its genesis hash on connect and refuse
  wallet operations against a node on another network
- describe store-before-broadcast, rejection and unknown outcomes,
  receiver policies, fee and network checks as implemented
- update the Zcash API list to the actual exports
- remove stale experiment logs, local paths and process notes
- require an explicit node for Monero live tests and scripts
Comments, test messages, log-only error details, script output and
package descriptions are now concise English. Code is unchanged apart
from dropping an unused `mut` in a test; misplaced doc comments are moved
back onto their items and a stale fragment on NETWORK_ERROR is removed.
Unicode test fixtures keep their non-ASCII text.
Drop the import record, decision log, glossary context files and the
Monero hardware-signing research note; README, RELEASING and the
transparent tx API remain. Host contracts that lived only in the Monero
context file (node network check, unknown broadcast outcome) move into
its README. Remove references to the dropped files.
… runtime docs

Also move the one-off scan measurement script out of the repo and update the
Monero wasm smoke test for review-bound signing.
List every export, add the hardware transparent signing path, the storage restart
signal and FINALIZE_OUTCOME_UNKNOWN handling, and state the Monero send order and
host contract.
- pin Monero to Rust 1.93.0 and wasm-bindgen 0.2.127, matching Zcash
- find Homebrew clang and llvm-ar on Apple Silicon and Intel; route the
  node smoke build through build-wasm.sh
- install Binaryen 133 with a checksum in CI instead of Ubuntu's 108
- install OpenSSL headers for Monero's native tests
- manual runs publish X.Y.Z-alpha.N from any branch and refuse other versions
- a Cargo.toml version change merged to main publishes rc/latest, skipping
  alpha versions and versions already on npm
- build workflows run on runtime code changes only, so the workflow files
  can land on main before the runtimes
@ByteZhang1024
ByteZhang1024 deployed to runtime-npm-publish October 27, 2026 17:42 — with GitHub Actions Active
@ByteZhang1024
ByteZhang1024 deployed to runtime-npm-publish October 27, 2026 21:22 — with GitHub Actions Active
@ByteZhang1024
ByteZhang1024 deployed to runtime-npm-publish October 28, 2026 07:23 — with GitHub Actions Active
@ByteZhang1024
ByteZhang1024 deployed to runtime-npm-publish October 28, 2026 08:21 — with GitHub Actions Active
@originalix

Copy link
Copy Markdown
Contributor

Automated review needs attention

Review of commit 16a3748b176a finished, but some comments could not be published automatically.

Publication requires a retry or human review. This is not an automated approval.

@ByteZhang1024
ByteZhang1024 deployed to runtime-npm-publish October 28, 2026 14:02 — with GitHub Actions Active

@originalix originalix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第三轮复审 16a3748:2 条新的 P2,均已在当前 head 上核对过。

@ByteZhang1024
ByteZhang1024 force-pushed the feat/zcash-chain-runtime branch from 16a3748 to daf733d Compare October 29, 2026 04:11
@ByteZhang1024
ByteZhang1024 merged commit e08b93d into main Oct 29, 2026
16 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.

4 participants