Storage Staking
When you deploy a smart contract to NEAR, you pay for the storage that this contract requires using a mechanism called storage staking.
In storage staking (sometimes called state staking), the account that owns a smart contract must stake (or lock) tokens according to the amount of data stored in that smart contract, effectively reducing the balance of the contract's account.
How does NEAR's design align incentives?​
Storage-staked tokens are unavailable for other uses, such as validation staking. This increases the yield that validators will receive. Learn more in the economics whitepaper.
When do tokens get staked?​
On each incoming transaction that adds data.
Let's walk through an example:
- You launch a guest book app, deploying your app's smart contract to the account
example.near
- Visitors to your app can add messages to the guest book. This means your users will, by default, pay a small gas fee to send their message to your contract.
- When such a call comes in, NEAR will check that
example.near
has a large enough balance that it can stake an amount to cover the new storage needs. If it does not, the transaction will fail.