Skip to content

Verify dest transaction sender matches miner's posted address#6

Open
LandynDev wants to merge 1 commit intotestfrom
fix/verify-dest-sender
Open

Verify dest transaction sender matches miner's posted address#6
LandynDev wants to merge 1 commit intotestfrom
fix/verify-dest-sender

Conversation

@LandynDev
Copy link
Copy Markdown
Collaborator

@LandynDev LandynDev commented Apr 1, 2026

Verify dest transaction sender matches miner's posted address

Summary

  • Security fix: The dest-side swap verification only checked that the correct amount reached the user's address by tx hash — it did not verify the transaction came FROM the miner's posted address. A miner could watch for any third-party tx to the user's dest address of the correct amount and claim that tx hash as their fulfillment without actually sending funds.
  • Contract: Added miner_dest_address field to SwapData
  • Validator: chain_verification.py now validates tx_info.sender against swap.miner_dest_address on the dest leg, rejecting mismatches

Test plan

  • cargo contract build compiles with new field
  • ruff check allways/ neurons/ passes
  • Restart dev environment and run E2E suite 02 (swap lifecycle)
  • Verify validator logs show sender validation on dest-side confirmation

A miner could claim a third-party tx to the user's dest address as their
own fulfillment. Store miner_dest_address on the swap struct at initiation
and validate tx_info.sender against it during dest-side verification.
@plind-dm
Copy link
Copy Markdown

plind-dm commented Apr 2, 2026

What is it for? Specifically for which issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants