SNIP-09: The Heavy Note (PoW Encryption)

covers1667

⚡tephen

published

draft experimental

This SNIP defines kind:1667: a text note encrypted in such a way that the receiver MUST perform a specific amount of Proof-of-Work to decrypt and read it.

Motivation

Standard NIP-13 Proof-of-Work is used to prevent spam by forcing the sender to do work. SNIP-09 introduces a symmetric cost: forcing the receiver to do work to access the content.

This creates "Diggy Hole" dynamics:

  1. Anti-Spoiler / "Fog of War": Prevents accidental reading. The user must actively "mine" to reveal the text.
  2. Value Signaling: "I spent CPU cycles to bury this. It must be important."
  3. Temporal Pacing: A high difficulty forces the user to pause and wait, changing the rhythm of consumption from "scrolling" to "unearthing."

Event Structure

Kind

1667 — The Heavy Note.

Tags

  • difficulty (required): Integer. The number of leading zero bits required for the decryption key hash.
  • salt (required): A random hex string used to seed the mining process.
  • iv (required): The initialization vector for AES-256-GCM (hex encoded).

Content

The .content field is the AES-256-GCM ciphertext of the message, encoded in Base64.

The Mechanism (Symmetric Mining)

The decryption key is not stored. It must be discovered by both parties.

1. Encryption (Sender)

  1. Generate a random hex string salt and a random iv.
  2. Choose a difficulty (e.g., 20).
  3. Start a counter nonce at 0.
  4. Calculate Candidate = SHA256(salt + nonce). (Note: nonce is the string representation of the integer).
  5. Check if Candidate has at least difficulty leading zero bits.
    • No: Increment nonce and retry.
    • Yes: Candidate is now the Shared Key.
  6. Encrypt the plaintext message using AES-256-GCM with the Shared Key and iv.
  7. Publish the event with content = ciphertext, and tags for salt, difficulty, and iv. Discard the nonce.

2. Decryption (Receiver)

  1. Client sees kind:1667 and reads the salt and difficulty.
  2. Client UI displays "⛏️ Mining to Reveal..."
  3. Client starts nonce at 0 and repeats the hashing loop: SHA256(salt + nonce).
  4. When a hash matching the difficulty is found, that hash is the Shared Key.
  5. Client decrypts the .content using the key.

Difficulty Scale (The "Depth")

Difficulty Est. Dig Time (Modern CPU) Vibe
16 Instant (< 10ms) "Click to Reveal" (Spoiler Tag)
20 ~1 Second "Heavy Door" (Pause for effect)
24 ~15 Seconds "Digging" (Active effort required)
28 ~3-5 Minutes "Deep Shaft" (Commitment required)
32 ~1 Hour "Buried Treasure"

Example Event

{  
  "kind": 1667,  
  "tags": [  
    ["difficulty", "21"],  
    ["salt", "f4e29a1c"],  
    ["iv", "99887766554433221100aabb"]  
  ],  
  "content": "U2FsdGVkX1+u6...",   
}

Security Considerations

  • Not Quantum Secure: This is not meant for high-security secrets (like private keys). A specialized ASIC or GPU farm could crack a "20-minute" difficulty in seconds.
  • Ephemeral Protection: This protects data temporarily or adds a cost to access. It does not provide permanent confidentiality.
  • Relay Agnostic: Relays store the encrypted blob. They cannot read it unless they perform the work.

Discussion

Connect a key to comment.