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.
    – Jimii
    Aug 31, 2023 at 8:22
  • Do you know where they mention this explicitly in the docs? I couldn't find it Aug 31, 2023 at 18:42

3 Answers 3

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

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". Aug 31, 2023 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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