1

I'm currently wrapping my head around what is necessary to be (kind of) certain that a Stellar payment will succeed.

A stellar payment has a source, a destination, an asset, and an amount.

What could go wrong? I'm aware of those:

  • Source account does not have enough of the specified asset. This can be checked by getting the balance of the specified account. The selling_liabilities are already subtracted from this amount (are they?)
  • Destination account does not exist
  • Destination account has specified a limit which is too low. limit >= balance + payment.amount must hold. What happens if no limit is set? I've seen omitempty.
  • Destination account has is_authorized set to False. Can this even happen if the account holds the given asset? What does it mean if the attribute is_authorized is empty?
  • Does is_authorized of the source account matter?
  • Are there other aspects that can affect the payment operation?

Is is_authorized_to_maintain_liabilities completely irrelevant for payment operations?

For this question, I'm only interested in the payment operation. The payment operation is part of a transaction that can fail for several other reasons, e.g. issues with the sequence number or with the signature. That is not part of my question.

2

Source account does not have enough of the specified asset. This can be checked by getting the balance of the specified account. The selling_liabilities are already subtracted from this amount (are they?)

The balance of an account as returned by the Horizon API doesn't factor in any buying or selling liabilities that an account has. Its the total amount of that asset that is in the account including any liabilities.

Destination account has specified a limit which is too low. limit >= balance + payment.amount must hold. What happens if no limit is set? I've seen omitempty.

If no limit is set while creating the trust line, a default limit which equals max int64 is used.

Destination account has is_authorized set to False. Can this even happen if the account holds the given asset? What does it mean if the attribute is_authorized is empty?

Yes an account can hold your asset while still being inactive. Assume you had an asset that requires authorization (you manually allow each trustline). After a while you find that 1 account is involved in fraud so you unauthorize it's trust line. All balances that the account had prior to this would still remain in the account, the account just wouldn't be able to transact it.

Does is_authorized of the source account matter?

Yes if an account's trustline to an asset is not authorized, the account will not be able to initiate a payment transaction.

Is is_authorized_to_maintain_liabilities completely irrelevant for payment operations?

For payment operations, is_authorized_to_maintain_liabilities acts similar to is_authorized. An account that is only authorized to maintain liabilities can not receive or transfer an asset.

You could play around in the Stellar Laboratory and check the Asset Access Control Docs to get a clearer picture of the effects of each of the authorization flags.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.