Migrate private messaging from NIP-04 to NIP-17 #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
NIP-04 (the original Nostr direct message scheme) leaks significant metadata:
Solution
Migrate to NIP-17 which combines:
Privacy benefits of NIP-17:
Implementation Approach
Backwards compatible with deprecation warning:
Related
Both codebases use private messaging and should be updated to ensure interoperability.
References
Done in PR #2 (merged), shipping in
v1.1.0-aio.2.Highlights:
nostr/nip44.py+nostr/nip59.py(44 unit tests, validated against the NIP-44 spec test vector)_handle_nip04_messagereplaced with_handle_gift_wrap; merchant↔customer DMs all flow throughwrap_message/unwrap_messaged3229cd(NIP-59's layered envelope is sender/recipient unambiguous by design)Companion changes:
nip59.wrapEvent()for orders_create_default_merchantnow delegates tonostrmarket.services.provision_merchant()End-to-end flow verified locally on regtest (full purchase: order → invoice → payment → status update, all gift-wrapped).
No NIP-04 fallback retained — clean break, per the discussion in the PR.