From ba98f8c2326d64438546c82ef16aac74923b2ec1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Jul 2026 21:43:00 +0000 Subject: [PATCH] fix: never mine the inner kind-7 of gift-wrapped reactions Reactions to NIP-17 groups and unsealed rumors are gift-wrapped: the inner reaction only travels as ciphertext, so relays can never PoW-filter it and mining it was pure battery waste. Account.reactTo now detects private targets up front and routes them straight to the plain signer, skipping the mining queue. DM/private-note/file wraps were already correct (only the kind-1059 envelope is mined, never the seal or rumor). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01ADb3dez9jPk6QqyQ1rTx4V --- .../main/java/com/vitorpamplona/amethyst/model/Account.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 3c79ccb9e4..86c45117a9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -898,7 +898,12 @@ class Account( note: Note, reaction: String, ) { - val powDifficulty = powDifficultyFor(ReactionEvent.KIND) + // Reactions to NIP-17 groups and unsealed rumors are gift-wrapped: the + // inner kind-7 only ever travels as ciphertext, so mining it is pure + // waste — those targets skip the queue and sign with the plain signer. + val isPrivateTarget = note.event is NIP17Group || note.isPrivateRumor() + + val powDifficulty = if (isPrivateTarget) null else powDifficultyFor(ReactionEvent.KIND) if (powDifficulty != null && mineInBackground(ReactionEvent.KIND, powDifficulty) { isActive -> ReactionAction.reactTo(