From 8e2ff4976db3d7586d7b9c993a94cf9bea071a12 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 6 Jul 2026 00:08:34 -0700 Subject: Ark zaps PoC — a NIP-61-shaped zap protocol over arkoor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lightning zaps are welded to LNURL+bolt11; nutzaps (NIP-61) proved the alternative shape, and ark fits it better than Cashu because delivery already exists (the mailbox). Draft protocol, kinds provisional: kind 10037 (replaceable) announces the wallet's ark address+network; the zap itself is a plain instant arkoor send; kind 9737 is the sender-signed receipt tagging recipient, amount, comment, and the delivered vtxo id — so the receipt is checkable against the actual payment, unlike a bare attestation. UX: paste an npub into Send and hal offers the zap (needs both the ark and sync features; npub decoding is inline bech32 so ark-only builds stay lean). The nostr layer gains generic publishEvent/fetchEvents, exposed through the sync seam as wallet.nostrPublish/nostrFetch. Proven on regtest against a mini NIP-01 relay: announce, resolve, zap 1,000 sats with a comment, instant receipt+delivery, vtxo match. Co-Authored-By: Claude Fable 5 --- src/features/sync.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/features/sync.js') diff --git a/src/features/sync.js b/src/features/sync.js index f927aef..8349b5d 100644 --- a/src/features/sync.js +++ b/src/features/sync.js @@ -22,6 +22,22 @@ export function installSyncWallet(wallet) { return this.nostr && this.nostr.sk ? this.nostr.sendDM(recipientPkHex, text) : false; }, + // Generic event publish/fetch on the configured sync relays — the seam + // other features (ark zaps) use to speak their own kinds. No-ops when + // sync is disabled or the wallet is offline. + async nostrPublish(partial) { + const sync = getSyncConfig(); + if (this.offline || !sync.enabled || !this.nostr.sk) return null; + this.nostr.setRelays(sync.relays); + return this.nostr.publishEvent(partial); + }, + async nostrFetch(filter, maxWait) { + const sync = getSyncConfig(); + if (this.offline || !sync.enabled) return []; + this.nostr.setRelays(sync.relays); + return this.nostr.fetchEvents(filter, maxWait); + }, + // Pull the latest state from Nostr; apply it if it's newer than what we have. // Returns true if state was applied (so the caller can skip a full scan). async syncFromNostr() { -- cgit v1.2.3