What is NET, CPU and RAM on the WAX Blockchain?

WAX io
WAX.io
Published in
6 min readAug 6, 2019

ℹ️ UPDATE: There’s a newer version of this blog post! Click here to learn more.

— — —
Over the last few weeks since the WAX Blockchain mainnet and protocol token launched, we’ve been thrilled to see the level of participation in staking and voting among WAX Token holders who have swapped their tokens. As we’ve mentioned, staking and voting is crucial for DPoS blockchains such as WAX because the more involved the community, the better the blockchain will operate for everyone. Now we’d like to explain exactly what the NET (Network), CPU, and RAM is that the community is staking.

In the WAX ecosystem, the following resources get consumed by dApps:

NET — throughput capacity of the WAX network, measured in bytes

CPU — processing time of an action, measured in microseconds

RAM — stores data of dApps in the blockchain

In this ecosystem, bandwidth, which consists of NET and CPU, is flexible because WAX Token holders can have more bandwidth allocated than the ratio they have staked vs. the total stake pool. Your minimum resource allocation is the fraction: ‘your stake’ divided by ‘total stake.’ With bandwidth, you consume it at a point in time, and then it regenerates for future usage.

Since RAM is limited and necessary to hold a dApp’s state, which must persist over time, RAM must be allocated. Therefore, RAM is not based on staking; rather, you purchase and sell RAM. Realize that you can sell deallocated RAM at any time back to the blockchain’s native RAM market, or allocate it for usage at any future point in time.

In this post, we’ll go over these resources and why they are essential in the WAX ecosystem.

What is NET, CPU, and RAM on the WAX Blockchain?

Let’s imagine that the blockchain was an airport network. A blockchain network operates as an airport network, meaning there is no single master airport within the network; instead, every airport is an equal peer. Airport networks can be grouped as either cities, regions, or countries, but to simplify our analogy, we’ll use country. Within a country, you have many airports that are connected or linked together. These links between the airports represent the flights connecting those locations. So, in simpler terms, think of the airports as the nodes in the blockchain network; the blockchain connects the nodes in a decentralized network.

Now, let’s dive a little deeper into our analogy and break the resources dApps consume in the WAX ecosystem:

NET would be the number of seats available on each airplane, leaving and entering the airport. NET is a way to make sure you have somewhere to sit. Your seat is reserved, and it’s yours if you need. However, if not a lot of other people are on the airplane, you could lay across a bunch of seats because they’re available since no one else is using them. Any unused seats on the airplane are free to use until the people that paid for them need them.

CPU represents the airline ticket, but in the WAX Blockchain this ticket can be used at any airline. CPU works with NET as far as allocation goes. NET makes sure you have a seat while CPU is the ticket. As with a plane ticket, you can only use CPU at certain times and, with the WAX Blockchain, those certain times depend on how busy the WAX Blockchain is.

RAM represents the costs and infrastructure to operate the airline. This includes the paperwork, workers, and bureaucracy to get you signed up at the airport to be a valid customer, allowing airlines to operate.

You see where we’re going with this. Now that you have an idea of the resources, at a high-level, let’s dive deeper into each resource.

Bandwidth: NET and CPU

WAX runs on two forms of bandwidth: NET and CPU. Both get measured as your average consumption in bytes over the last three days. Let’s take a look at the following table to break down what these resources do in the WAX ecosystem:

NET:

  • Refers to the throughput capacity of the WAX Blockchain-that is, the bandwidth you can use during a specified time.
  • Refers to the processing time of an action, measured in microseconds.

CPU:

  • WAX has a system that allocates CPU to blockchain participants who stake tokens for CPU resources. This system prevents spam transactions, denial of service attacks, and overloading of the network.
  • The CPU time allocated is calculated based on how busy the network is. For example, if the blockchain is busy and running over 500 transactions per second, customers with a low amount of WAX staked have low CPU time. On the flip side, if the network is not busy, users can have 100 times higher CPU time.
  • Temporarily consumed every time you send an action or transaction.

Anyone that holds WAX Tokens and stakes them is entitled to a corresponding amount of bandwidth (NET and CPU). dApp developers can stake their tokens to reserve bandwidth. You must stake your tokens to have access to the blockchain. The more WAX Tokens you stake for bandwidth, the more bandwidth you get to use. You can unstake at any time to reclaim your WAX Tokens.

How does bandwidth allocation work?

When you stake a WAX Token, it gets locked down towards CPU, and your prorated CPU bandwidth gets allocated. It is up to you to choose those prorated portions. If you unstake that WAX Token, you lose your access to that allocated portion of the bandwidth. However, there is a 72-hour waiting period when WAX Tokens are unstaked, and after the 72 hours expire, you regain control of those WAX Tokens.

If you make a WAX Token transfer, that transaction would require some amount of the NET and CPU capacity. This action would take some time to complete so this amount of transaction time would come off of your allocation and then regenerate over time.

RAM

To have high transaction throughput, you need persistent storage to be in RAM. In any blockchain ecosystem, RAM provides a permanent means of storing data in the blockchain. For example, private and public keys, as well as WAX Token balances, can be stored in RAM and accessed quickly. RAM is a limited resource in the ecosystem because it is upward limited to the amount of RAM manageable by the most underpowered WAX Guild.

The WAX Blockchain has a marketplace that keeps a supply of RAM available for purchase, as such, supply and demand drive the price of RAM. For example, if more people are buying RAM than those selling, the price goes higher. On the flip side, well, you see where we’re going.

Here are things you want to consider with RAM:

- RAM is needed to sign up for a new WAX Account and add information to the account, such as ownership of other WAX Tokens. WAX provides 3KB of RAM for free for every user account. Also, customers who sign up for a WAX Account are automatically assigned a WAX Blockchain account.

- dApps use RAM to store state information of their applications, such as the balance for each user, so it is available when needed. Depending on how you implement your dApp, it may pay for its own RAM, or charge the dApp user or even another user that signs off on a user’s dApp interactions. This allows for many different billing schemes available to dApp developers.

- RAM allocation can be purchased and sold to meet the needs of the dApp developer.

Final thoughts

To recap, dApp developers and customers need NET, CPU, and RAM to perform actions on the WAX Blockchain. Each WAX Token staked corresponds with a certain amount of NET, CPU, and RAM. While NET and CPU are staked for, RAM is bought and sold through the RAM market due to its limited supply.

Note: WAX will deploy EOS version 1.8 which will have an impact on these resources.

— -

Let us know what you think by joining the WAX community:

Twitter

Telegram

Reddit

Originally published at https://wax.io.

--

--

WAX io
WAX.io

WAX is the safest and most convenient way to create, buy, sell and trade virtual items.