Three node lines, one state hash

The vault upgrade adds state that every node must track identically: signer sets, vaults, Yellowback positions, attested prices. Each C++ node line (ycash-dd, the ycashd 4.5.0 reference line, and ycash6, the ycashd 6.20.0 line released as 6.22.0-beta2) folds that state into two hashes per block: vault_getinfo.statehash for the vault primitive and yed_getstatehash for the Yellowback module. Kogany has to produce the same bytes.

The encoder is separate from the database

Kogany stores state in Zakura's own database layout, which differs from ycashd's. So the canonical preimage encoder is written apart from storage, following the published serialization rules rather than either node's on-disk format. Storage can change; the hash can't.

Where Rust differs

  • Map order. A HashMap iterates in random order, while the C++ nodes iterate ordered maps. Kogany uses BTreeMap wherever order reaches the hash, and clippy refuses HashMap in the vault and Yellowback crates.
  • Overflow. Release builds wrap on integer overflow. Consensus arithmetic uses checked_* and 128-bit intermediates only, and the math test cases run in release builds as well as debug.
  • Concurrency. Zakura verifies the transactions in a block concurrently. Vault acts must be applied in order, so they run in contextual validation against a snapshot of the parent block's state.
  • Checkpoints. Zakura commits checkpointed blocks without contextual checks. Kogany computes vault deltas on every commit path, and a test asserts that no network's checkpoint list reaches the vault epoch. On the fast testnet the checkpoints end at block 510,253, before the Vault activation at 510,400.

The tests

  • Golden vectors. The vector files, generated once from the C++ lines, are replayed in Kogany's unit tests, and the Yellowback golden chain's pinned state hash must match.
  • Mixed-line suite. The unchanged Yellowback functional scripts run on ycash6 with a Kogany node following each one. At every sync point the harness compares tips and both state hashes, and the YED hash also against the Python reference model. In the last recorded run (2026-11-02), 51 of the 58 scripts passed twice in a row; six of the other seven build regtest chains that Kogany cannot follow by design.
  • Devnet rounds. On one devnet, ycash6 nodes mine while ycash-dd and Kogany nodes follow. At every 100th block a harness compares block hashes and both state hashes. Kogany's column ran five rounds (heights 300 to 700) with no disagreement. The ycash6 v6.22.0-beta2 qualification ran the ycash-dd column: identical state hashes.
  • Real chains. koganyd v1.8.0-ycash.beta2 follows the fast testnet through the Vault activation at 510,400 with ycashd's block hashes and the same vault_getinfo answer, and validates Ycash mainnet from the Canopy checkpoint (1,100,006) to 3,097,335 with ycashd's tip and value pools.

What beta2 found

The state hash covers vault and Yellowback state only. Two splits found in the beta2 run were in block validity, which the state hash can't see; both are fixed in beta2:

  • Block time bounds. Kogany beta1 carried Zcash's bounds (5,400 s past the median time, 7,200 s past the clock) instead of Ycash's (10,800 s and 14,400 s). It rejected fast-testnet block 510,256 and 51 mainnet blocks from height 974,995 on.
  • Canonical Jubjub encodings (ZIP-216). ycash6 and Kogany rejected non-canonical encodings in Sapling signatures and coinbase outputs; ycash-dd accepted them, so one such transaction could have split the lines. ycash-dd now rejects them at every height. No existing block on mainnet or the fast testnet is affected.

Kogany is not yet a qualified Ycash node line: that is the Yellowback lead architect's decision at the end of its plan. Until then, run koganyd on the Ycash testnets only.