Instruction errors (runtime)

ExternalAccountLamportSpend

Appears as instruction spent from the balance of an account it does not own

Instruction

ExternalAccountLamportSpend

“instruction spent from the balance of an account it does not own”

A program tried to debit lamports from an account it does not own.

Common causes

  • Writing **account.lamports.borrow_mut() -= x on an account owned by another program (for example a user's wallet).

How to fix it

  • Debit system-owned accounts via a System Program transfer CPI signed by the owner.

Decode another error

Try: