# HTLC settlements

Source: https://docs.settlemint.com/docs/user-guides/system-addons/xvp-settlement/actions/cancel/htlc-settlements
Learn how to cancel an HTLC settlement. Before arming, any participant can cancel.
After arming, all local participants must vote to cancel unanimously.




Cancelling an HTLC settlement returns all locked assets to their original senders.
The cancellation process depends on whether the settlement is armed (all approvals received).

## Cancellation rules [#cancellation-rules]

| Settlement state               | Who can cancel                    | How                     |
| ------------------------------ | --------------------------------- | ----------------------- |
| **Pending** (not all approved) | Any local participant             | Unilateral              |
| **Armed** (all approved)       | All local participants must agree | Voting (propose cancel) |
| **Secret revealed**            | Cannot cancel                     | -                       |
| **Executed**                   | Cannot cancel                     | -                       |
| **Expired**                    | N/A - use withdraw                | -                       |

***

## Before armed (pending state) [#before-armed-pending-state]

When not all parties have approved, any local participant can cancel unilaterally.

### Steps [#steps]

<Steps>
  <Step>
    ### Open the settlement [#open-the-settlement]

    Navigate to **Settlements** and find the HTLC settlement you want to cancel.
  </Step>

  <Step>
    ### Cancel the settlement [#cancel-the-settlement]

    Click **Cancel** on the settlement detail page.

    Review the confirmation and click **Confirm**.
  </Step>

  <Step>
    ### Verify cancellation [#verify-cancellation]

    The settlement status changes to **Cancelled** and all locked assets are returned.
  </Step>
</Steps>

***

## After armed (voting mechanism) [#after-armed-voting-mechanism]

Once an HTLC settlement enters the **Armed** state (all local senders have approved),
unilateral cancellation is no longer allowed. This protects parties who have already
committed assets on other chains.

Instead, cancellation requires **unanimous agreement** from all local participants
through a voting mechanism.

<Callout type="warn" title="All participants must vote">
  Every local participant (sender and recipient in local flows) must propose cancellation. The settlement is cancelled
  only when the final vote is received.
</Callout>

### How the voting mechanism works [#how-the-voting-mechanism-works]

1. Any local participant can propose cancellation
2. The settlement tracks how many participants have voted
3. Participants can withdraw their proposal before the final vote
4. When ALL local participants have voted, the settlement is automatically cancelled

### Steps to propose cancellation [#steps-to-propose-cancellation]

<Steps>
  <Step>
    ### Open the settlement [#open-the-settlement-1]

    Navigate to **Settlements** and find the armed HTLC settlement.
  </Step>

  <Step>
    ### Propose cancellation [#propose-cancellation]

    Click **Propose Cancel** on the settlement detail page.

    Confirm the transaction. Your vote is recorded on-chain.
  </Step>

  <Step>
    ### Wait for other participants [#wait-for-other-participants]

    The settlement shows the current vote count. Contact other participants
    and ask them to also propose cancellation.
  </Step>

  <Step>
    ### Final vote triggers cancellation [#final-vote-triggers-cancellation]

    When the last participant proposes cancellation, the settlement is
    automatically cancelled and all assets are returned.
  </Step>
</Steps>

### Withdrawing a cancel proposal [#withdrawing-a-cancel-proposal]

If you change your mind before the final vote, you can withdraw your proposal:

1. Open the armed settlement
2. Click **Withdraw Cancel Proposal**
3. Confirm the transaction

Your vote is removed and the settlement remains armed.

***

## What happens after cancellation [#what-happens-after-cancellation]

* All escrowed assets are returned to their original sender addresses
* The settlement permanently enters Cancelled state
* No further actions can be taken on this settlement

## Why armed settlements require unanimous voting [#why-armed-settlements-require-unanimous-voting]

The voting requirement exists because:

* Parties may have already committed assets on other chains
* Unilateral cancellation could leave counterparties stranded
* Unanimous agreement ensures all parties consent to unwinding the settlement

If you cannot reach unanimous agreement, wait for the cutoff date to pass and use
[Withdraw expired](/docs/user-guides/system-addons/xvp-settlement/actions/withdraw-expired).

## Troubleshooting [#troubleshooting]

| Issue                                      | Solution                                                              |
| ------------------------------------------ | --------------------------------------------------------------------- |
| Cancel button not visible                  | You must be a local participant (sender or recipient in a local flow) |
| "Propose Cancel" shown instead of "Cancel" | Settlement is armed - all local participants must vote to cancel      |
| Settlement not cancelling                  | Not all participants have voted yet - check the vote count            |
| Cannot propose cancel                      | Secret may have been revealed, making cancellation impossible         |
| Want to undo my cancel vote                | Click "Withdraw Cancel Proposal" before the final vote is cast        |

## Next steps [#next-steps]

<Cards>
  <Card title="HTLC walkthrough" href="/docs/user-guides/system-addons/xvp-settlement/htlc/walkthrough">
    Complete multi-party cross-chain settlement example.
  </Card>

  <Card title="Withdraw expired" href="/docs/user-guides/system-addons/xvp-settlement/actions/withdraw-expired">
    Recover assets from expired settlements.
  </Card>
</Cards>
