Storage fees ( with upcoming changes with 100x increase [0] ) is a concern in developer community, in this post I would like to propose some solutions, which I was thinking on and off for 2-3 years. I believe these can make Flow much better blockchain and provide better user experience.
Although I am trying to target wider audience some parts can be little too advanced (sorry in advance, my targeting is usually worse than a stormtrooper’s)
Now the main concerns are:
- Existing users and their accounts will be unable run transactions after the change.
- Second concern, putting fees for storage (sending some small of flow ) after user action on the app ( usually manages as refill methods ) are prone to error.
- Things get more complicated with Hybrid Custody and people having more than one account.
In this sense, discussion with developers, main improvement can be achieved by removing storage fees from account balance ( so your account balance will be always available balance ) and making a simple logic like: "writer/creator pays for the storage fee / destroyer (deleter) of the resource redeems the storage fee ) I suggested similar solutions before ( [1], [2] )
[ Ideally we could use payer
as ( writer / destroyer ) One question raised here [Q1], to brainstorm on, wallets paying for transaction fees and how to handle them. ]
Now if we expand this a bit, to search for an alternative, we can use some pseudo resource like StorageWrapper(owner, uuid, FlowToken.Vault)
so each item stored can have some kind of fee vault builtin, while locking fees for the item inside.
If we take it one step further, we can only put structs in this resource, and define a fee vault for every resource. So every resource will have a fee vault. Then we can play a bit with ownership ( keeping last owner maybe ) and instead of payer we can make last owner to redeem the fees.
( Totally off topic but while we are at this maybe even we can separate ownership and storage addressing, resources can live at their own namespace, so moving a resource will be just updating its owner and setting a link at current owner to that resource. Which would allow us things like query a resource by udid etc. I think we have a very advanced resource based language Cadence, and it deserves a resource based storage on blockchain side too. )
[0] FLIP 66 - Revisiting Flow storage minimum account balance
[1] https://github.com/onflow/flow/issues/791
[2] https://github.com/onflow/flow/issues/460