aboutsummaryrefslogtreecommitdiffstats
path: root/src/format.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-07-06 06:19:06 -0700
committerAdam Soltys <[email protected]>2026-07-06 06:19:06 -0700
commit1043ca529e859b41f27d80c51b80ac897773a5df (patch)
tree0b50b41b6490a52d83f65f572dd8e8a321bb045d /src/format.js
parent1139c6beafb1199c149bd1f51a46d817e1d46173 (diff)
downloadcoinosv3-1043ca529e859b41f27d80c51b80ac897773a5df.tar.gz
coinosv3-1043ca529e859b41f27d80c51b80ac897773a5df.zip
Sync ark funds across devices
Ark vtxos lived only in per-device storage, so a second device with the same seed saw the right on-chain balance (that rides the snapshot) but none of its ark funds — board/change vtxos exist only where created. Ark state now rides the encrypted nostr snapshot as a merge-safe cache extension: additive union (bring in vtxos a device is missing) with each device's own server reconcile() as the authority for spent-ness, so a stale or wrong 'spent' on one device can never propagate and poison the others. A connect-time reconcile catches coins spent elsewhere while a device was away, and a live subscription to our own replaceable event merges another device's new coins within seconds. New seam: registerCacheExtension({mergeAlways:true}) extensions get fed snapshots that aren't newer than local state too (last-writer-wins is right for rescannable chain data, wrong for merge-style vtxo state), and nostr.subscribeStates for the live path. Verified two same-seed devices over a mini relay: B sees A's boarded balance with zero mailbox activity, spends a synced vtxo, A converges to a stable balance with the spent vtxo correctly marked. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/format.js')
0 files changed, 0 insertions, 0 deletions