syncFromBlockchain

suspend fun syncFromBlockchain(address: String, zswapSeed: ByteArray): Boolean

Sync shielded (zswap) state from blockchain (#279/#1 — checkpoint + delta).

Previously this re-streamed and re-replayed EVERY zswap event from genesis on every refresh ("Phase 2" TODO). Now it resumes from a saved checkpoint: probe the chain's zswap tip (maxId) and route via shieldedSyncPlan

  • AT_TIP (tip == cursor): nothing new — keep the persisted state, skip the network.

  • DELTA (tip cursor): replay only events after the cursor ON TOP of the restored checkpoint (proven byte-identical to a genesis replay by ZswapCheckpointResumeTest).

  • FULL (no checkpoint / reorg / probe timeout): replay from genesis, as before. The checkpoint (state + cursor) is written atomically; a half-written pair reads as absent (forces a clean full sync), mirroring the dust side's NonLinearInsertion safety net.

Return

true if sync succeeded and coins were found

Parameters

address

Wallet address (for DataStore key)

zswapSeed

32-byte zswap seed (derived at m/44'/2400'/0'/3/0)