1

This statement from Alchemy's tutorial has caught my attention (emphasis mine):

To reclaim Solana storage fees, developers and everyday Solana users can close accounts to receive their storage fees back. The simplest way to redeem Solana rent fees is using a consumer friendly tool like Sol Incinerator (https://sol-incinerator.com/) to close unused program accounts in your wallet.

First, I suppose that this applies only to non-rent-exempt (though please correct me if I'm wrong).

Then, I am curious how does this incentive model make sense at all? If I write a Program, I wouldn't want anyone to be able to close it except me.

2
  • I do not think you can close an account you do not have authority over. Commented Aug 31, 2023 at 8:22
  • Do you know where they mention this explicitly in the docs? I couldn't find it Commented Aug 31, 2023 at 18:42

4 Answers 4

1

The basic concept goes back to the ownership model of Solana accounts:

The runtime grants the program write access to the account if its id matches the owner. For the case of the System program, the runtime allows clients to transfer lamports and importantly assign account ownership, meaning changing the owner to a different program id. If an account is not owned by a program, the program is only permitted to read its data and credit the account.

So only your program can decide to move lamports out of its accounts to close them.

Many programs, however, give a way for users to close accounts that they "own", as understood by the program. For example, token accounts are all owned by the token program, but the token program recognizes another "owner", which is your wallet. It also grants permission of the other "owner" to close their token accounts.

More info at https://docs.solana.com/developing/programming-model/accounts#ownership-and-assignment-to-programs

2

You can also close rent-exempt accounts that you own.

also worth noting is

At the time of writing this, new Accounts and Programs are required to be initialized with enough LAMPORTS to become rent-exempt. The RPC endpoints have the ability to calculate this estimated rent exempt balance and is recommended to be used.

https://docs.solana.com/developing/intro/rent

2

Besides via the CLI, you can also use sites like https://solwipe.com to close your unused token accounts and get your rent (SOL) back.

1

Note: "unused program accounts in your wallet."

1
  • 1
    Haha, I missed that. Though I think the wording could have been clearer by saying "program accounts that you own". Commented Aug 31, 2023 at 11:23

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.