Add configurable timestamp randomization for NIP-59 gift wraps

This commit is contained in:
Your Name
2025-10-27 12:57:25 -04:00
parent 9a3965243c
commit a8dc2ed046
6 changed files with 216 additions and 146 deletions

View File

@@ -97,6 +97,7 @@ cJSON* nostr_nip17_create_relay_list_event(const char** relay_urls,
* @param sender_private_key 32-byte sender private key
* @param gift_wraps_out Array to store resulting gift wrap events (caller must free)
* @param max_gift_wraps Maximum number of gift wraps to create
* @param max_delay_sec Maximum random timestamp delay in seconds (0 = no randomization)
* @return Number of gift wrap events created, or -1 on error
*/
int nostr_nip17_send_dm(cJSON* dm_event,
@@ -104,7 +105,8 @@ int nostr_nip17_send_dm(cJSON* dm_event,
int num_recipients,
const unsigned char* sender_private_key,
cJSON** gift_wraps_out,
int max_gift_wraps);
int max_gift_wraps,
long max_delay_sec);
/**
* NIP-17: Receive and decrypt a direct message