简体   繁体   中英

Solana rent exempttion clarification

I want to understand Solana rent and it's relation to the CLI usage. I understand the basics, that you need 2 years worth of rent in order to be rent-exempt but I have several questions in order to reach a better understanding:

I have wallet keypair keypair.json

I run:

solana account keypair.json

Balance: 2.95953572 SOL 
Owner: 11111111111111111111111111111111
executable: false
Rent Epoch: 280 

Should I assume that rent is 280 lamports per. Epoch? Do I need to calculate this based on how many epochs in two year to figure out what sol is required for rent exempt? Isn't there an easier way simply find out rent-exempt requirements if I have the keypair file or even just the public key of an account? Usage of "solana rent" command is confusing since I have no idea of the "data length" of my account.

When running the following commands in order to create different types of accounts can I always assume that enough Sol is automatically put into the account for it to be rent-exempt?

spl-token create-account
spl-token create-multisig

When creating a nonce account i'm required to specify the amount to put into the nonce account? If I'm using this nonce account temporarily for a multisig process how much SOL should I put in there?

solana create-nonce-account nonce-keypair.json 1

If you want to know how rent is calculated you can use the solana rent CLI command.

For example, any account in the system that is not a data account (ie has no data requirement) will display the rent exempt minimal fee:

solana rent 0

Rent per byte-year: 0.00000348 SOL
Rent per epoch: 0.000002439 SOL
Rent-exempt minimum: 0.00089088 SOL

For program data accounts (ie any account that is created to be owned by a program to read/write state to) will be a higher cost because of the storage needs. Let's assume your program stores a PublicKey (32 bytes) in an account, then rent for that account is calculated:

solana rent 32

Rent per byte-year: 0.00000348 SOL
Rent per epoch: 0.000003048 SOL
Rent-exempt minimum: 0.0011136 SOL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM