mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
The payment-hash dedup kept the LOWER amount and OR'd cryptoVerified across entries. Because a payer proof publishes its proof_preimage, once a BOLT12 zap is public anyone can replay its payment hash in a compressed (unverifiable) proof with a 1-msat amount; the merge would keep that amount AND inherit the verified flag, driving the counted total to ~zero and mislabeling a fabricated amount as verified. Per the NIP, dedup by invoice_payment_hash applies among *validated* proofs. Only a crypto-verified proof has a signature-bound amount, so a verified entry now always wins over an unverified duplicate; the lower-amount rule applies only between entries of the same verification status. Adds a two-order regression test for the replay-griefing case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SpgpWLKzgD7vS9Fs4CXTR3