From 37a08446e028a43791ab53c0c95cf6b92a1cccf7 Mon Sep 17 00:00:00 2001 From: brqgoo <100725376+brqgoo@users.noreply.github.com> Date: Mon, 16 Jan 2023 17:26:17 +0300 Subject: [PATCH] Update 04.md --- 04.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/04.md b/04.md index 5e92dfa..fee5638 100644 --- a/04.md +++ b/04.md @@ -30,13 +30,11 @@ The sender non-interactively pays the recipient based on their dedicated Nostr p When a sender wants to pay the recipient, the sender initiates a swap-in payment through a specialized submarine service provided by TBD wallet SSP. Here's how it's done step-by-step: ### 1. The sender first generates a preimage and a tweaked destination: +* Where the recipient npub is `R = r*G` , and the sender npub is `S = s*G`. +* The sender generates a 32-byte random element `rand`, and calculates a tweaked pubkey for the recipient: `R' = hash(s*R, rand)*G + R`. +* The sender generates a shared preimage secret for the recipient : `P = hash(rand)*G + R` +* The sender `S` then sends a NIP-04 encrypted DM to the recipient containing rand and payment value. +* The recipient `R` can locally construct his tweaked pubkey `R'` and preimage `P` from the rand value, and the sender's npub `S`. -Where the recipient npub is `R = r*G` , and the sender npub is `S = s*G` ; - -The sender generates a 32-byte random element `rand`, and calculates a tweaked pubkey for the recipient: `R' = hash(s*R, rand)*G + R` - -And a shared preimage secret for the recipient : `P = hash(rand)*G + R` - -The sender `S` then sends a NIP-04 encrypted DM to the recipient containing rand and payment value. The recipient `R` can locally construct his tweaked pubkey `R'` and preimage `P` from the rand value, and the sender's npub `S`. Although it seems similar to keysend due to the sender generating the preimage, the proof of payment here is not the revealed preimage but the on-chain transaction (swap factory) itself.