Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Cancel Transaction #16525

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft

feat: Cancel Transaction #16525

wants to merge 5 commits into from

Conversation

peter-sanderson
Copy link
Contributor

@peter-sanderson peter-sanderson commented Jan 22, 2025

🚧 🚧 🚧 Still WIP 🚧 🚧 🚧

❗ Depends on #16569 πŸ‘ˆ Merge this first!

Description

This PR Implements a Cancel Transaction flow by sending a RBF transaction what spends the (users) inputs back to thne users own address

Related Issue

Resolve #6810

Screenshots:

image
image

// override Account data, similar to RBF
const cancelAccount: ConnectCallParams['account'] = {
...account,
utxo: getMineInputsFromTransaction({ tx, account }),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically we may only double-spend any of the inputs of the original transaction. That may reduce the trace on-chain.

However, the Electrum wallet also spends all mine inputs so maybe we shall keep it same.

Copy link

github-actions bot commented Jan 22, 2025

πŸš€ Expo preview is ready!

  • Project β†’ trezor-suite-preview
  • Platforms β†’ android, ios
  • Scheme β†’ trezorsuitelite
  • Runtime Version β†’ 23
  • More info

Learn more about 𝝠 Expo Github Action

outputs: [
{
type: 'send-max',
address: account.addresses?.unused[0].address, // Todo: is this correct way?
Copy link
Contributor Author

@peter-sanderson peter-sanderson Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Electrum tries to use original change output if present in the original transaction:

 out_address = (self.get_single_change_address_for_new_transaction(old_change_addrs)
                       or self.get_receiving_address())

TR_CANCEL_TX_NOTICE: {
id: 'TR_CANCEL_TX_NOTICE',
defaultMessage:
'Once the transaction is canceled successfully, your funds (minus the transaction fee) will be returned to your wallet.',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the transaction is canceled successfully, your funds (minus the transaction fee) will be returned to your wallet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(design update)

# Conflicts:
#	packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AffectedTransactions/AffectedTransactionItem.tsx
#	packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AffectedTransactions/AffectedTransactions.tsx
#	packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/ChangeFee.tsx
#	packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/ChangeFee/DecreasedOutputs.tsx
#	packages/urls/src/urls.ts
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.

Feature: Cancel Transaction via RBF
1 participant