Improving the UX of rent with a sleeping+waking mechanism

Cool, another application for proofs of non-existence!

An idea that falls somewhere between fully live state and sleeping state is “napping” state, in which all of a contract’s code and storage is hashed into 32 bytes. To awaken the contract, you would just have to provide the contract’s code and storage, which gets verified against the hash and then reloaded back into the state. (This is somewhat similar to the UTXO model; maybe this idea has already been suggested somewhere. We implemented part of this for the Ivy-Solidity project at the IC3 bootcamp last summer.)

So you save on the Merkle proof of the full history, at the cost of having to continue to store 32 bytes of state for each contract.

This could perhaps be a probationary measure when a contract runs out of TTL before it gets put into cold sleep. Alternatively, contracts could be allowed to voluntarily put themselves into this state, to save on rent, or could automatically be put into this state after a week of inactivity.

I’m pretty sure this too could be implemented as a contract factory without base-layer support.

3 Likes