How does RAM work in EOS?

RAM is a network resource in the EOS mainnet network along with CPU and Bandwidth. RAM is needed to store data in the EOS blockchain. For example, 128 bytes of RAM is required for holding a token balance. So, if someone has TRYBE and IQ tokens in his account, he will need about 128 * 2 = 256 bytes of RAM for keeping those tokens in his account. The amount of his balance, that is, whether he has 10 IQ tokens or 1000 IQ tokens doesn't change RAM requirements in this case.

RAM is not allocated the way CPU and Bandwidth is allocated. CPU and Bandwidth is given to users when they stake their tokens but RAM needs to be purchased from the system in exchange for EOS. To know more about how CPU is allocated, read my post about how CPU works in EOS ecosystem.

The EOS network has a system in place which keeps a supply of RAM available for purchase. EOS users and developers can buy RAM from this system at a price set based on the Bancor relay. This price is set based on supply and demand. If more people are buying RAM than those selling RAM, the price goes higher. If there are more RAM sellers than buyers, the price of RAM goes down.

At the time of writing this post, a single EOS account would use only 576 bytes of RAM upon creation. But it would need some extra RAM for some vital functions such as account recovery. Currently, new accounts should have at least 3 kilobytes of RAM. Trying to create accounts with less than 3 kilobytes might fail.

RAM is needed for storing important data of DApps. So, developers needs to buy lots of RAM to keep their DApps running. This makes RAM a very precious resource and that is why it has attracted many speculators after the EOS mainnet launch.

To discourage speculative RAM trades, the RAM market managed by the system has a 1% fee. The EOS collected in these fees are taken out of circulation and stays locked. What will happen to them is still undecided. It will be most likely decided after a community referendum. If majority of the community decides to burn the fees, they will be burned and permanently taken out of circulation.