diff options
| author | Adam Soltys <[email protected]> | 2026-06-28 09:22:45 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-28 09:22:45 -0700 |
| commit | d459e4aa196b356cfc24f2118cc1ef54eda7600e (patch) | |
| tree | 4cd0bd4bed365121417e7a57b2371c6295c86908 /src/format.js | |
| parent | 5e19371642b0d2edc7540f96f53a17c47cf51a15 (diff) | |
| download | coinosv3-d459e4aa196b356cfc24f2118cc1ef54eda7600e.tar.gz coinosv3-d459e4aa196b356cfc24f2118cc1ef54eda7600e.zip | |
Lock a gift to a nostr key: public link, claim code DM'd to the recipient
A gift can now be locked to a recipient's nostr npub. The shareable link
(/lg/<blob>) carries the amount + recipient in the clear (anyone can see what it
is and who it's for), but the claim payload is encrypted under a one-time code.
That code is delivered as an encrypted nostr DM (NIP-04) to the recipient — so
only they can read it. They paste the code to decrypt, then claim into a fresh
wallet exactly like a normal bearer gift.
- nostr.js: parseNostrPubkey/npubOf, encryptWithCode/decryptWithCode (random
32-byte code), fetchNostrProfile, NostrSync.sendDM (broad relays).
- wallet.js: lockGift → { blob, claimCode }, previewLockedGift, nostr identity +
sendNostrDM.
- app.js: gift form gains an optional 'Lock to npub' field that shows the
recipient's avatar + name (nostr kind-0 profile); create encrypts + DMs the
code (with sent/failed status + a copyable fallback); /lg/ links open a claim
view showing the gift + recipient where you paste the code; account settings
shows your own npub to share.
Verified: code lock/unlock round-trip, a real nostr DM published and read back
from relay.damus.io, and the UI loads + renders with no errors.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src/format.js')
0 files changed, 0 insertions, 0 deletions
