# Improving the Cycle Management Experience

**URL:** <https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895>\
**Category:** Command Line Tools\
**Tags:** community-consideration\
**Created:** [May 11, 2023, 8:52am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895 "2023-05-11T08:52:26Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![icme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icme/32/4327_2.png) [@icme](https://forum.dfinity.org/u/icme)\
**Post date:** [January 26, 2024, 6:46pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/21 "2024-01-26T18:46:31Z")

</div>

One additional question - @peterparker will users be able to manage their cycles balances through the NNS app once the cycles ledger is released?

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [January 26, 2024, 9:44pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/22 "2024-01-26T21:44:30Z")

</div>

I can unfortunately not answer your question, @icme. I only participated in this thread as a user. I have no idea what the status, outcome, and roadmap of the cycles ledger are, nor where it will be used.

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [January 27, 2024, 12:57pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/23 "2024-01-27T12:57:11Z")

</div>

@THLO , @Vivienne

Can you address the question above about NNS access to cycle ledger?

Also:

1. Does the existing get\_blocks exist in the ledger so that a rosetta could at least work in read-only mode?
2. What is the clean-up threshold at which time old approvals begin to be cleaned up by the ledger?
3. Is the current beta of the cycle ledger set up to be pullable by dfx yet(or installed as part of the local nns deployment commands)?

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [January 29, 2024, 10:57am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/24 "2024-01-29T10:57:51Z")

</div>

Thanks, @icme, for the detailed explanation! We’ll discuss your proposal in the team.

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [January 29, 2024, 12:16pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/25 "2024-01-29T12:16:49Z")

</div>

> [@skilesare](#):
>
> Can you address the question above about NNS access to cycle ledger?

I think there is currently no effort to add support in the NNS dapp; however, that’s certainly a reasonable request.  
Obviously, we currently focus on getting the cycles ledger released. I suggest posting your request on the [feedback board](https://dx.internetcomputer.org/) to get it prioritized! 🙂

Regarding your other questions:

1. The cycles ledger will be [ICRC-3](https://github.com/dfinity/ICRC-1/pull/128/files) compliant. As you can see [here](https://github.com/dfinity/cycles-ledger/blob/7b6e6a22988403c10bcb4b45b077087bc139a064/cycles-ledger/cycles-ledger.did#L251), there is a function called `icrc3_get_transactions`, which was the proposed name at some point. The function will be renamed to `icrc3_get_blocks` before the release.
2. Approvals where `expires_at = None` do not expire, i.e., approvals are only pruned when they actually expire.
3. That’s a good question! The cycles ledger should be pullable but that’s not the case yet. We’ll add that item to the list of outstanding tasks.

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [January 30, 2024, 6:37pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/26 "2024-01-30T18:37:13Z")

</div>

> [@THLO](#):
>
> Approvals where `expires_at = None` do not expire, i.e., approvals are only pruned when they actually expire.

While this is great news, I’m curious as to the mechanism you are using as even the ICP ledger clears out accounts if the collection gets too large. Have you guys cracked this or is it more of a function of with the larger stable memory size you don’t anticipate a problem emerging before you’d be able to deal with it(if it ever gets to that).

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [January 30, 2024, 7:06pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/27 "2024-01-30T19:06:28Z")

</div>

@THLO Maybe a bit of a dumb question here, but in the depositor, is the ledger\_id the ICP ledger or the cycles ledger?

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [January 31, 2024, 8:15am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/28 "2024-01-31T08:15:29Z")

</div>

> [@skilesare](#):
>
> Have you guys cracked this or is it more of a function of with the larger stable memory size

It is the latter. Given that the cycles ledger can now use 400 GiB of stable memory, and likely more in the future, we believe that the state size will not become a concern any time soon.  
Obviously, we will closely monitor the growth of the state so that we could react if our assumption turned out to be wrong.

> in the depositor, is the ledger\_id the ICP ledger or the cycles ledger?

It is the cycles ledger. As you can see [here](https://github.com/dfinity/cycles-ledger/blob/fc5a0138fee0afb6111a8948c04cc75be47aefb4/depositor/src/main.rs#L33), the depositor uses this canister ID to call the `deposit` function on the cycles ledger.

---

<div class="post-metadata">

**Author:** ![dfx-json](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dfx-json/32/4784_2.png) [@dfx-json](https://forum.dfinity.org/u/dfx-json)\
**Post date:** [February 20, 2024, 8:45pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/29 "2024-02-20T20:45:12Z")

</div>

Hey @icme - this is a good suggestion. For the initial release, we are doing everything we can to keep the Cycles Ledger simple. However, this would be a good addition to the feedback board. Care to add it? [https://dx.internetcomputer.org](https://dx.internetcomputer.org)

TY!

---

<div class="post-metadata">

**Author:** ![Samer](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/samer/32/8943_2.png) [@Samer](https://forum.dfinity.org/u/Samer)\
**Post date:** [February 21, 2024, 10:26pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/30 "2024-02-21T22:26:09Z")

</div>

If my understanding is correct then:

This would allow a user who obtained a principal through auth with II in a browser frontend, to create a canister by sending a call to the cycles ledger. (From the same frontend)

The principal should hold cycles obviously.

And this was not possible before, because the same principal would not be able to call `create_canister` in the management canister, since that is only possible from another canister, correct?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [February 22, 2024, 9:28am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/31 "2024-02-22T09:28:12Z")

</div>

Yes, that’s correct.

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [February 22, 2024, 8:46pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/32 "2024-02-22T20:46:54Z")

</div>

After some integration work, I think a transfer\_from\_and\_send(Account, Amount, CanisterID) function would be great that would combine the icrc2 transfer from with the custom send.

I guess going the other way, deposit\_and\_transfer would be cool too.

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [February 23, 2024, 8:17am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/33 "2024-02-23T08:17:23Z")

</div>

> [@skilesare](#):
>
> I think a transfer\_from\_and\_send(Account, Amount, CanisterID) function would be great that would combine the icrc2 transfer from with the custom send.

I think that’s an interesting idea. Thanks for the suggestion!  
Note that the custom `send` function has been renamed to [withdraw](https://github.com/dfinity/cycles-ledger/blob/2e8f850afaf5890c108360b63f50377923242050/cycles-ledger/cycles-ledger.did#L252).

What would `deposit_and_transfer` do? Note that the `deposit` function allows the user to specify any destination account directly.

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [February 23, 2024, 1:23pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/34 "2024-02-23T13:23:52Z")

</div>

> [@THLO](#):
>
> `deposit_and_transfer`

Good point!

Thanks for the updated did!

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [February 25, 2024, 2:44pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/35 "2024-02-25T14:44:06Z")

</div>

(Nevermind…figured it out)

---

<div class="post-metadata">

**Author:** ![ahdrahees](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ahdrahees/32/24690_2.png) [@ahdrahees](https://forum.dfinity.org/u/ahdrahees)\
**Post date:** [March 6, 2024, 2:46pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/36 "2024-03-06T14:46:10Z")

</div>

is there any timeline for cycles ledger to be live on mainnet?

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [March 6, 2024, 6:10pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/37 "2024-03-06T18:10:52Z")

</div>

As I wrote in January, the goal is to release the cycles ledger in Q1 2024, so there isn’t much time left. 🙂

There are still some changes required but I hope that I can provide a more precise release date soon.

I can provide some additional information already now: We will release the cycles ledger first, followed by an update to `dfx` with the new `dfx cycles` command.  
The `index` canister will follow a bit later, depending on available resources, but hopefully not more than a few weeks later. Once everything is up and running as expected, we will _hand over control to the NNS_. Before this happens, the cycles ledger is considered to be in _beta stage_ and should be used for _testing only_ (i.e., transferring small amounts of cycles).

---

<div class="post-metadata">

**Author:** ![THLO](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/thlo/32/2349_2.png) [@THLO](https://forum.dfinity.org/u/THLO)\
**Post date:** [March 18, 2024, 3:17pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/38 "2024-03-18T15:17:49Z")

</div>

Good news! The cycles ledger is now almost ready to be deployed (we only need to merge changes to the ICRC metadata).

We are planning to launch the cycles ledger on Wednesday, **March 20, 2024**.

As mentioned before, the launch will start the testing phase in production. Everybody is encouraged to try it out and report any feedback here!

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [March 20, 2024, 4:05pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/39 "2024-03-20T16:05:05Z")

</div>

We just installed the cycles ledger to `um5iw-rqaaa-aaaaq-qaaba-cai`. You can find the wasm [here](https://github.com/dfinity/cycles-ledger/releases/tag/cycles-ledger-v0.4.0). We will test it thoroughly over the next few weeks and invite you to do the same. Please let us know if you run into any unexpected behavior!

Important: This is still a beta. Please don’t store any significant cycle amounts. While we don’t plan to break anything, things can still go wrong. Also, we are still controllers of the canister, so we can rug you at any time 😈

The next dfx release will contain an opt-in way to use the cycles ledger by default. I’ll update you how to use it once it’s released.

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [March 20, 2024, 5:22pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/40 "2024-03-20T17:22:15Z")

</div>

Well that was quick… @mariop found a bug already with block encoding and we’ll have to reinstall the canister. I stopped the canister for now so nobody can deposit cycles anymore that they won’t be able to withdraw

On a positive note: nobody except myself has deposited cycles so far, so nobody gets rugged 🎉

[Previous page](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895.md?page=1)

[Next page](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895.md?page=3)
