What are Cycles?

Cycles act as the computational resource to execute actions on the Internet Computer. In general, all canisters consume resources in the form of CPU cycles for execution, bandwidth for routing messages, and memory for persisted data. Canisters maintain an account balance to pay for the cost of communication, computation, and the storage consumed by their applications. The cost of computation is expressed in units of cycles.

Cycles reflect the real costs of operations, including resources such physical hardware, rack space, energy, storage devices, and bandwidth. In simple terms, a cycle unit represents the cost of executing a single WebAssembly instruction. Programs must be able to pay for complete execution (all or nothing), but the cost associated with cycles will make efficient programs cost-effective.

By setting limits on how many cycles a canister can consume, the platform can prevent malicious code from draining resources. The relative stability of operational costs also makes it easier to predict the cycles that are required to process a million messages, for example.

Cycles can be compared to “gas” for Ethereum and “credits” for AWS, but have much farther reaching uses with regard to data, compute, and execution. Their design also inherently accounts for technological pitfalls, such as rapidly rising costs of usage.