wip: Send dm on sigit sign/complete #230

Draft
enes wants to merge 3 commits from 92-send-completion-dm into staging
Member

Closes #92

The PR implements the initial private DM sending (nip17) as discussed in the issue #92, makes the changes to addRelay function by skipping duplicate relays while adding, and createWrap function by having a wrap's created_at date set randomly in the past (up to 2 days) per recommendations to avoid time-analysis attacks (https://github.com/nostr-protocol/nips/blob/master/59.md#other-considerations).

We send the dms on sigit:

  1. creation to the next signer (unless they are the creator) - /sign
  2. signing
    • if NOT last to creator that sigit was signed, and to the next signer (unless they are the creator) - /sign
    • if last to everyone (creator, signers, viewers) - /verify

Each dm does the following:

  1. fetch receiver relays
  2. fetch preferred dm relay list from all receiver relays (kind 10050)
  3. prepare event, seal and wrap with proof of work
  4. send the event to preferred dm relay list (or fallback to receiver relays if list empty)

Postponed:

  • Check the updated createWrap for side effects. The updated function now sets created_at randomly up to two days in the past. How will this affect the sorting we do in fetchEvents (when limit is set filter.limit)?

Blocked:

  • Issue with callbackPath navigation - handleRootRedirect when users are not logged in (#229)

Improvement possible:

  • Make sure to have a unique "sender" for the sigit so the messages (for creator) arrive in the same conversation
Closes #92 The PR implements the initial private DM sending (nip17) as discussed in the issue #92, makes the changes to `addRelay` function by skipping duplicate relays while adding, and `createWrap` function by having a wrap's `created_at` date set randomly in the past (up to 2 days) per recommendations to avoid time-analysis attacks (https://github.com/nostr-protocol/nips/blob/master/59.md#other-considerations). We send the dms on sigit: 1. **creation** to the next signer (unless they are the creator) - `/sign` 2. **signing** - **if NOT last** to creator that sigit was signed, and to the next signer (unless they are the creator) - `/sign` - **if last** to everyone (creator, signers, viewers) - `/verify` Each dm does the following: 1. fetch receiver relays 2. fetch preferred dm relay list from all receiver relays (kind 10050) 3. prepare event, seal and wrap with proof of work 4. send the event to preferred dm relay list (or fallback to receiver relays if list empty) Postponed: - [ ] Check the updated `createWrap` for side effects. The updated function now sets `created_at` randomly up to two days in the past. How will this affect the sorting we do in `fetchEvents` (when limit is set `filter.limit`)? Blocked: - [ ] Issue with `callbackPath` navigation - `handleRootRedirect` when users are not logged in (https://git.nostrdev.com/sigit/sigit.io/issues/229) Improvement possible: - [ ] Make sure to have a unique "sender" for the sigit so the messages (for creator) arrive in the same conversation
enes added 2 commits 2024-10-14 10:49:04 +00:00
fix: only send to next signer on create
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 32s
3b4bf9aa29
enes added 1 commit 2024-10-14 11:19:53 +00:00
refactor: show sent dm count, don't sent twice to creator
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
b04f4fb88d
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
This pull request has changes conflicting with the target branch.
  • src/pages/create/index.tsx
  • src/pages/sign/index.tsx

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 92-send-completion-dm:92-send-completion-dm
git checkout 92-send-completion-dm
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sigit/sigit.io#230
No description provided.