4

I was under the impression that accounts owned by users owned a set of token accounts which each represent one distinct token that they own - meaning token accounts would only be owned by a user. For example, this token account, pointed to by the address 53kn18WWvsx82NiztUXMQGGSuRBujTtLqzszRYK2TgGb, lists the owner as expected:

{
  mint: 'GvLFXp5DqowBtF4nUjXmqx6upH2bjncf2ESndH6ZF1sA',
  owner: '7rhxnLV8C77o6d8oz26AgK8x8m5ePsdeRawjqvojbjnQ',
  amount: '10',
  delegate: null,
  delegatedAmount: '0',
  isInitialized: true,
  isFrozen: false,
  isNative: false,
  rentExemptReserve: null,
  closeAuthority: null
}

However, I have found several anomalies where the token account owns itself. For instance, H6Vb6qdn4pfg1tmqXhVK8WQocsfeUWRhTNZFMjeypsRE, lists itself as its owner:

{
  mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
  owner: 'H6Vb6qdn4pfg1tmqXhVK8WQocsfeUWRhTNZFMjeypsRE',
  amount: '165744535531',
  delegate: null,
  delegatedAmount: '0',
  isInitialized: true,
  isFrozen: false,
  isNative: false,
  rentExemptReserve: null,
  closeAuthority: null
}

Solscan also supported my observation: solscan showing the owner being the same address as the token account

Other example token accounts that own themselves are 7KFK8aQdrqyxe7V1iuMsP6wRopmqnsDCwAGHwVWE7Tec, 9o3amSjWDCvKSycLwtZs8vCUkSnim6kjPK5FBXY545eN, and J6vHZDKghn3dbTG7pcBLzHMnXFoqUEiHVaFfZxojMjXs.

Why can some token accounts own themselves?

2 Answers 2

6

The owner of a token account is any pubkey. If it's possible to provide signatures for that pubkey, then it's a perfectly valid owner for the token account.

The token program explicitly allows for self-owned accounts, since some people may want to handle multiple keypairs. So you could have separate keypairs owning separate accounts. It can be complicated to manage multiple keypairs and confusing if accounts are self-owned, but it's not incorrect.

You can see where some of this behavior is tested at https://github.com/solana-labs/solana-program-library/blob/559e2ec8634a7206422ab9660b8695f6b970dab1/token/program/src/processor.rs#L1471

0

Jon C's answer is correct.

A similar phenomenon also often occurs by accident:

  1. Create associated token account (ATA)
  2. Close ATA
  3. Someone attempts to send tokens to the ATA, specifying it as the recipient
  4. Since the ATA was already closed, it is seen as an empty account owned by the System Program, rather than a PDA of the Associated Token Account program. This means a new ATA gets created with the original ATA listed as its owner (oops!). Since ATAs are PDAs, there is no corresponding private key and thus no way to control either account. Except:

This scenario is so common that developers have added the recover_nested instruction to the Association Token Account program to recover from this exact scenario.

In this case, the token account isn't owned by itself, if we're being pedantic. Rather, what was a token account suddenly became the owner of another token account.

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