-
Notifications
You must be signed in to change notification settings - Fork 363
Merging account with trustlines #324
Copy link
Copy link
Open
Labels
CAPRepresents an issue that requires a CAP.Represents an issue that requires a CAP.help wantedOpen especially for those who want to write a CAP/SEP!Open especially for those who want to write a CAP/SEP!needs draftThis an issue that has no corresponding draft, and as such has not entered the CAP/SEP process.This an issue that has no corresponding draft, and as such has not entered the CAP/SEP process.
Metadata
Metadata
Assignees
Labels
CAPRepresents an issue that requires a CAP.Represents an issue that requires a CAP.help wantedOpen especially for those who want to write a CAP/SEP!Open especially for those who want to write a CAP/SEP!needs draftThis an issue that has no corresponding draft, and as such has not entered the CAP/SEP process.This an issue that has no corresponding draft, and as such has not entered the CAP/SEP process.
In order to merge an account that has a trustline first the following operations need to be executed:
Certain smart contract schemes (such as payment channels) involve refund transactions for escrow accounts that are created and signed well before they are submitted on chain. If such a scheme deals with an assets different from the native asset, then these refund transactions need to contain the following operations (as stated above):
The refund transaction will fail if the payment operation does not contain the correct balance of the trusted asset at the time the transaction is submitted. Since the refund transaction is created and signed a long time before, this would allow an attacker to invalidate the transaction by sending a single stroop of the trusted asset to the escrow account before the refund transaction is submitted.
A workaround would be to always set the trust limit of the asset to the current balance on the account. However, this has some downsides – e.g., topping up a payment channel would not be possible.
We propose any of the following solutions: