Skip to content

Conversation

@binarybaron
Copy link

@binarybaron binarybaron commented Nov 4, 2025

image

Note

Introduces partial refund by splitting cancel spend into refund + amnesty outputs with a new amnesty-spend transaction, and updates the UI alert to handle null swaps safely.

  • Protocol/Core (Rust):
    • Partial Refund Flow:
      • TxCancel::build_refund_with_amnesty_transaction creates a refund to user plus an amnesty output (shared descriptor A,B).
      • TxRefund::new(...) updated to take A,B and amnesty_amount, store amnesty descriptor, and compute sighash; adds helpers amnesty_amount(), amnesty_outpoint(), build_amnesty_spend_transaction().
      • New TxRefundAmnesty type to spend the amnesty output: constructs tx, computes digest, adds signatures, exposes weight and watch script.
    • Exports: Re-exports TxRefundAmnesty; adds refund_amnesty module.
  • GUI:
    • SwapStatusAlert accepts swap: GetSwapInfoResponseExt | null, derives swapId safely, and short-circuits on null; StateAlert also guards null.
    • Minor JSX cleanup (compact props, key usage with swapId).

Written by Cursor Bugbot for commit 266e3a1. This will update automatically on new commits. Configure here.

@binarybaron binarybaron marked this pull request as draft November 4, 2025 19:12
@binarybaron
Copy link
Author

binarybaron commented Nov 4, 2025

This issue has been assigned a bounty (💰)

Current bounty:

Exceptions for this specific bounties

Due to the nature of this issue (cryptographic/protocol complexity rather than implementation complexity) the bounty will also be used to fund audits.

Bounty donation address

If you want to incentivize work on this issue, you can help increase the bounty by donating to the address below.

87UHJU9GA3qHn4sX4ZZndEERmqEXx94kuS3QFZ1XGVNg28YcWX2H9AqBh5G6Uc4cfmKRbTDQ3HgsoVKW1RuPHtzLSUEHrmN

Fine print

We use bounties to incentivize development and reward contributors. All issues available for a bounty have the Bounty 💰 label.

To receive the bounty of this issue, you agree to these conditions:

  • Bounties will be set and awarded at discretion of @binarybaron
  • An issue is considered resolved when the patch(es) proposed by the contributor is/are merged in the appropriate repository according to terms of the issue.
  • The first person who resolves an issue in its entirety will receive the entire amount of the bounty.
  • If the issue is resolved collaboratively by more than one person, the reward will be distributed among the contributors
  • Donating to the bounty does not guarantee that this issue will be completed and refunds are generally not issued. If they are then they are granted at the discretion of @binarybaron

@pokefan77
Copy link

Can you elaborate when partial refund will be done instead of full refund and punish?

It seems like Bob needs Alice to get 10% of his money back in case of partial refund.
Why 10% of Bobs money is at risk in case Alice doesnt coorporate, which happened before with some makers!

@Einliterflasche
Copy link

Yes. This update will essentially move some trust requirement from the maker (that the taker is not a spammer) to the taker (that the maker will refund).

However, this can be addressed as follows:

  • a decentralized reputation system. Takers who didn't get the refund can publish a proof, thereby discouraging other takers from swapping with this maker
  • takers might choose to only start swaps for which the maker has already provided the full refund address. Thus not requiring the maker to fully refund
  • the maker does not gain anything from withholding the refund, thereby he is not incentivized to do so

Everyone would be better off if this wasn't necessary, but it is. That's the sad truth.

@pokefan77
Copy link

I am not sure if i and others understand your words "takers might choose to only start swaps for which the maker has already provided the full refund address. Thus not requiring the maker to fully refund" can you rephrase it please? sorry

"the maker does not gain anything from withholding the refund, thereby he is not incentivized to do so"
your phrasing is totally misleading, confirming your narrative. My question was why Bobs 10% are at risk, and neutrally said the truth is: "the maker does not gain anything from releasing the refund, thereby he is not incentivized to do so"
Its the same situation as btc punished. the truth is that there is even ongoing discussion on matrix because somebody lost his big amount of money because the maker did not help him, because he has 0 incentive to do so.

Can you elaborate when partial refund will be done instead of full refund and punish?

@jstark2a
Copy link

jstark2a commented Nov 7, 2025

I am not sure if i and others understand your words "takers might choose to only start swaps for which the maker has already provided the full refund address. Thus not requiring the maker to fully refund" can you rephrase it please? sorry

I am also trying to understand but here is how I interpreted it: Makers will have the choice to offer full refunds or partial refunds. The taker will know the maker's refund policy before they begin a swap. The full refund policy is straightforward: If the taker cancels, they get the full refund. For the partial refund policy, if the taker cancels, they are not guaranteed to receive 100% of their money back. The purpose of this is to disincentivize malicious takers from abandoning swaps because they know there is no penalty for doing so. If you as a taker do not like the idea of a partial refund, you as a free market participant, can refuse to do business with that maker. Because partial refunds mean less risk to the maker, this will allow them to offer lower rates.

somebody lost his big amount of money because the maker did not help him, because he has 0 incentive to do so.

He lost his money due to negligence (or at least failure to understand the refund process). As the docs state "With most makers, you can still redeem the Monero even after being punished. This is, however, purely voluntary and we advise against relying on this."

@pokefan77
Copy link

That would mean either makers are ok with full refund = they automatically give it, or they are not ok with full refund, meaning they will also not help giving it. Its just 10% scam. Its not even remotely justified as fees of all makers are currently around 2%, why should a taker loose 10%?

@jstark2a
Copy link

jstark2a commented Nov 7, 2025

That would mean either makers are ok with full refund = they automatically give it, or they are not ok with full refund, meaning they will also not help giving it. Its just 10% scam. Its not even remotely justified as fees of all makers are currently around 2%, why should a taker loose 10%?

It's not a scam if you know what you are agreeing to. The taker also doesn't lose anything if they simply complete the swap like they agreed to. Makers are not obligated to hand out free 12 hour XMR call options.

Adding a partial refund support will actually help honest takers. If there is not penalty, a maker can lock up the liquidity of other makers that offer lower rates than them. Then they can jack up their rate because their competition is gone. This is effectively a Denial of Service attack against makers.

@pokefan77
Copy link

If thats the worry the penality fee should at maximum be the fee that they ask from the user for a completed trade, not a flat 10%

@Franz-Hermann-GT
Copy link

If thats the worry the penality fee should at maximum be the fee that they ask from the user for a completed trade, not a flat 10%

The XMR price movement also needs to be taken into account here — it can easily move 5–8% during those 12 hours.
In most cases, takers cancel the swap when the XMR price drops during that period. As mentioned earlier, this effectively works like a free call option.

@binarybaron
Copy link
Author

It is not a flat 10%. The 10% is purely for demonstrational purposes. The percentage can be dynamically configured by the maker.

@binarybaron
Copy link
Author

This issue has been assigned a bounty (💰)

Current bounty:

Exceptions for this specific bounties

Due to the nature of this issue (cryptographic/protocol complexity rather than implementation complexity) the bounty will also be used to fund audits.

Bounty donation address

If you want to incentivize work on this issue, you can help increase the bounty by donating to the address below.


87UHJU9GA3qHn4sX4ZZndEERmqEXx94kuS3QFZ1XGVNg28YcWX2H9AqBh5G6Uc4cfmKRbTDQ3HgsoVKW1RuPHtzLSUEHrmN

Fine print

We use bounties to incentivize development and reward contributors. All issues available for a bounty have the Bounty 💰 label.

To receive the bounty of this issue, you agree to these conditions:

  • Bounties will be set and awarded at discretion of @binarybaron

  • An issue is considered resolved when the patch(es) proposed by the contributor is/are merged in the appropriate repository according to terms of the issue.

  • The first person who resolves an issue in its entirety will receive the entire amount of the bounty.

  • If the issue is resolved collaboratively by more than one person, the reward will be distributed among the contributors

  • Donating to the bounty does not guarantee that this issue will be completed and refunds are generally not issued. If they are then they are granted at the discretion of @binarybaron

I wanted to specify this in a bit more in detail as they seems to be some confusion around the bounty on this issue.

In general donations to specific issues will NEVER go directly to neither me nor @Einliterflasche. Issue specific bounties are for funding work of outside contributors.

Donations to this issue will not necessarily result in me implementing this in a faster manner.

Donations will be used to potentially fund an outside contributor to give this a review to assess the security of this on the protocol level. As the funds collected here are unlikely to be enough to fund a full audit (something like TrailOfBits would do) this is going to be "light review" most likely with no attribution to the reviewer.

We are in talks with someone who is well trusted in the Monero community and is more than enough qualified.

If we don't find a reviewer, the funds will be used for other bounties.

@pokefan77
Copy link

Shouldnt a protocol change be fully audited?

@binarybaron
Copy link
Author

binarybaron commented Nov 8, 2025

Shouldnt a protocol change be fully audited?

No, not at all protocol changes necessarily require an audit. We are not introducing any new novel cryptography here.

I understand the concern here though. This will obviously be well tested.

@binarybaron binarybaron changed the title protocol: Partial refund protocol: Spam deterrence Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants