Claim free cycles to kick off your project on the Internet Computer

DFINITY
The Internet Computer Review
7 min readOct 5, 2023

Cycles are used to pay for dapp hosting resources on the Internet Computer. All new developers are entitled to 20 trillion of them for free. This guide, will walk through what they are and how to get a coupon that can be redeemed for cycles.

On the Internet Computer, developers can create decentralized applications using smart contracts in the form of canisters. A canister is a smart contract that has been compiled into a Wasm module, then deployed on the Internet Computer.

When a canister is deployed on the Internet Computer mainnet, the canister utilizes resources such as memory, storage, and compute power. These resources are provided by the subnet that the canister has been deployed to. On other chains such as Ethereum, the transaction’s gas cost is paid by the end-user when they interact with and use the dApp. For dApps like social media or networking platforms, that means that something as simple as following another user or liking their post requires a gas fee be paid. This can make it expensive for end users and lead to the deterrent of user adoption.

On the Internet Computer, developers pay for the gas fees to cover the resources used by the canister running their dApp. This Gas Reverse Model not only removes the expensive barrier to entry, it also gives developers the flexibility to implement their own tokenomics models aimed at mass adoption. To pay for using these resources, cycles are used.

What Are Cycles?

A cycle is a form of currency only used to pay for a canister’s resources. They can be obtained by burning ICP tokens for cycles, or through ICP developer grants and bounty rewards. One ICP token can be burned in exchange for 2.45 trillion cycles. ICP tokens can be burned in exchange for cycles through the IC NNS, or through platforms such as ICPSwap and Sonic.

Cycles have a fixed price in XDR, which is a supplementary foreign exchange asset that is defined and maintained by the International Monetary Fund. One trillion cycles will always equal one XDR, regardless of the current price of ICP, making the cost of computation and storage predictable and stable, allowing developers to budget appropriately.

For example, to deploy a canister on the IC mainnet on a 13-node subnet would cost 100,000,000 cycles, or $0.130886 USD, and 261,538,461 cycles or $0.342317 USD for a 13-node and 34-node subnet, respectively. For transactions, the cost is even cheaper. An update call costs 590,000 cycles, or $0.0000007722274 USD, and 1,543,076 cycles or $0.0000020196705 USD for a 13-node and 34-node subnet, respectively. For local development, take the 13-node subnet cost and divide it by 13. For example, creating a canister locally would cost 7,692,307 cycles.

Overally, the total cost per instruction on the Internet Computer is $0.000000000000536 USD, which is 44,760,000x less expensive than Ethereum, which costs $0.00024 USD per instruction.

For developers who are new to the Internet Computer, a free cycles coupon for 20 trillion cycles can be obtained. Later in this blog post, we’ll walk through how to obtain this coupon.

These free 20T cycles can be used for (on a 13-node subnet):

  • Creating 20 canisters deployed on the mainnet, or
  • Sending 3,389,830 update calls, or
  • Storing 1 GiB of data for 182.26 days.

To learn more about gas and cycles cost, please refer to the documentation here.

Cycles Wallets

Developers can manage their cycles through a special canister called a cycles wallet. Since a user’s principal cannot hold cycles directly, only canisters can, the cycles wallet canister is used to hold cycles. Then when a canister needs to use the cycles stored in the wallet, the principal of the cycles wallet is used, rather than your user principal. Recall that a principal is an entity that can be authenticated by the IC.

When you call a canister method, it may require cycles to be attached to the call for the call to be executed. If the caister itself doesn’t have enough cycles, or if it is a new canister being created, then you will need to proxy the call through the cycles wallet to attach the required cycles. To assure that the canister has enough cycles, you need to deposit cycles into the canister’s cycles balance. This process is known as ‘topping up’ the canister.

When a project is created with the command dfx new, the IC SDK will automatically create a default cycles wallet as part of the new project template. Local operations performed using cycles are done in the background. In a production environment involving canisters deployed on the mainnet, canisters will need to have cycles explicitly registered and transferred into them. Production canisters will also require principals to be configured to act as custodians, which are principals that have permission to send and receive cycles for the canister.

To obtain cycles from the free cycles coupon, first you need a cycles wallet and a developer identity.

Creating a Developer Identity

First, assure that you have downloaded and installed the IC SDK, which includes dfx, a command-line tool that is used for deploying and interacting with IC canisters via the command-line.

Let’s create a new identity principal with dfx, which we’ll use to obtain cycles and deploy a cycles wallet.

First, assure that `dfx` is running; if not, use the following command to start it:

dfx start --background

Next we will create a new developer identity with the command:

dfx identity new  CyclesFaucet

This command will return a seed phrase, which will be required to recover your identity if you ever need to. This seed phrase should be backed up, so that any cycles associated with your identity are not lost.

Then, you can set this identity as the one to be used by dfx in the current terminal session with the command:

dfx identity use CyclesFaucet

You can get the principal ID of this identity with the command:

dfx identity get-principal 

The principal will resemble the following format:

tsqwz-udeik-5migd-ehrev-pvoqv-szx2g-akh5s-fkyqc-zy6q7-snav6-uqe

Getting a Free Cycles Coupon

If you’re a new developer on the IC, you can request a free cycles coupon that can be redeemed for 20T free cycles to get you started. Let’s take a look at how to get one.

First, navigate to the website: https://faucet.dfinity.org

To obtain a coupon code to use the cycles faucet, you need to put in a written request for the coupon via the DFINITY dev official Discord server.

Click on the REQUEST CYCLES button on the faucet web page to join the Discord server.

Once inside the Discord server, navigate into the #cycles-faucet channel.

In this channel, execute the following slash command:

/request 

This command will make a call to the IC Cycles Faucet Bot.

Please ensure that your Discord settings are set to allow direct messages from other users. If you do not have this setting enabled, you will not receive a direct message from the faucet bot.

Once the survey has been completed, our team will review your submission. If accepted, the faucet bot will send you a private message with a coupon code.

Then, head back to the https://faucet.dfinity.org webpage. Click NEXT STEP to continue.

Now that you have a coupon code, enter your coupon code within the faucet UI.

Click NEXT STEP to continue, then return to your terminal window. If you closed the window in the process, run the following commands to start dfx and use your previously created identity:

dfx start --background
dfx identity use CyclesFaucet

Then, redeem your coupon with the command:

dfx wallet --network ic balance

This should return an output showing 20T cycles in your wallet. To get the canister identifier of your new cycles wallet, run the command:

dfx identity --network ic get-wallet

The output of this command should resemble the following:

gastn-uqaaa-aaaae-aaafq-cai

Now you have 20T free cycles to use for dApp deployment!

Remember that cycles are valuable, and required for deploying canisters on the mainnet! Make sure that you backup your identity file in case your computer data is lost. You can find your identity file at the path `~/.config/dfx/identity/<identity_name>/identity.pem`.

Summary

In this blog post, we took a look at how cycles are used to pay for resources used by canisters on the Internet Computer mainnet network, and that cycles are stored in canisters called cycles wallets. Then we explored how to get a free cycles coupon using the DFINITY Cycles Faucet that can be redeemed for 20T cycles.

Start building:

Follow the tech developments of Internet Computer: @DFINITYDev

Join the developer community: forum.dfinity.org

--

--

DFINITY
The Internet Computer Review

The Internet Computer is a revolutionary blockchain that hosts unlimited data and computation on-chain. Build scalable Web3 dapps, DeFi, games, and more.