# 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:** 3

<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 21, 2024, 8:51am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/41 "2024-03-21T08:51:24Z")

</div>

The bug is [fixed](https://github.com/dfinity/cycles-ledger/pull/123) and the cycles ledger is reinstalled with the [latest version](https://github.com/dfinity/cycles-ledger/releases/tag/cycles-ledger-v0.5.0). The canister is running again

---

<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:** [March 22, 2024, 7:00pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/42 "2024-03-22T19:00:06Z")

</div>

Maybe one more? ICRC3 specifies Nats for amount and fees and timestamps, but the current block 3 has Ints. @mariop

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/a/4/a41c234789ed1aca23afe2200ab79a1032dd8694.png)

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/7/a/7a52168a1eba6b8ca17c8ddc22af46f36bb7205c.png)

---

<div class="post-metadata">

**Author:** ![mariop](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/mariop/32/5114_2.png) [@mariop](https://forum.dfinity.org/u/mariop)\
**Post date:** [March 22, 2024, 7:26pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/43 "2024-03-22T19:26:32Z")

</div>

> [@skilesare](#):
>
> Maybe one more? ICRC3 specifies Nats for amount and fees and timestamps, but the current block 3 has Ints. @mariop

We are aware and we will patch it sometime soon. The issue is caused by the way the serializing library `ciborium` works with numbers, which results in our Ledgers using `int` for positive numbers instead of `nat`. The fix requires some work. In the meanwhile clients of the cycles-ledger will have to interpret `int`s as `nat`s. Note that out internal library is [calculating the hash of positive ints as hash of the leb128 representation](https://github.com/dfinity/ic/blob/c70bc267dfdc1143d8af70b32a4b51619aa71b80/packages/icrc-ledger-types/src/icrc/generic_value.rs#L76) which is also different from the ICRC-3 specification but has the benefit that the hash is already correct despite the type being different. The fix will just have to switch `int` for `nat`.

This kind of inconsistencies can happen when the standard and the implementation are developed in parallel. The reason why we decided to proceed anyway is that the issue affects only certain clients off-chain that need to verify the Ledger.

---

<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:** [March 22, 2024, 8:22pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/44 "2024-03-22T20:22:45Z")

</div>

Ugh…ok…so Will they stay Ints on this are or they going to get fixed to nats in the get\_block response? I have implemented rep indy hash in Typescript and will be calling hashes client side…do I need to do some custom code here?

In motoko I’m slebing all Ints…not just positive ones:

> <https://github.com/skilesare/RepIndyHash.mo/blob/f0bdba4cededeb7b1fad5d729debd7fafd7df9ae/src/lib.mo#L36>

Correct or incorrect? I’m assuming what you are saying is that the the rust code is doing it wrong for positive ints and that helps you fix it because they are supposed use leb anyway?

---

<div class="post-metadata">

**Author:** ![mariop](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/mariop/32/5114_2.png) [@mariop](https://forum.dfinity.org/u/mariop)\
**Post date:** [March 22, 2024, 8:29pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/45 "2024-03-22T20:29:35Z")

</div>

> Will they stay Ints on this are or they going to get fixed to nats in the get\_block response?

They will get fixed to nats. The cycles-ledger will be fully ICRC-3 compatible.

> do I need to do some custom code here?

No, just wait for the fix.

> I’m assuming what you are saying is that the the rust code is doing it wrong for positive ints and that helps you fix it because they are supposed use leb anyway?

Our library is doing it wrong which in this case works in out favor as there is no difference between `int` and `nat` for block hashing. A correct implementation should always use `sleb128` for `int`.

---

<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 25, 2024, 1:23pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/46 "2024-03-25T13:23:02Z")

</div>

The fix is deployed. Since the total supply was only 700M cycles we decided it’s worth reinstalling (one last time?) instead of maintaining even a few lines of backwards compatibility code for the rest of time

---

<div class="post-metadata">

**Author:** ![mariop](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/mariop/32/5114_2.png) [@mariop](https://forum.dfinity.org/u/mariop)\
**Post date:** [March 26, 2024, 3:45pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/47 "2024-03-26T15:45:05Z")

</div>

The latest release of the cycles-ledger fixes this issue. Now amounts are `Nat`.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/b/0/b0566e20b63ce361ab5c10173fee90b9772c7fbb.png)

---

<div class="post-metadata">

**Author:** ![cycle\_express](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cycle_express/32/24684_2.png) [@cycle\_express](https://forum.dfinity.org/u/cycle_express)\
**Post date:** [April 15, 2024, 7:43am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/48 "2024-04-15T07:43:15Z")

</div>

Command `dfx cycles --ic` seems to be working just fine. So is cycle ledger considered launched? Can people start using it without worrying funds disappearing?

---

<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:** [April 15, 2024, 8:30am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/49 "2024-04-15T08:30:01Z")

</div>

We consider it beta-launched. The dev team still holds control over the canister, so it is still possible for us to change the code without NNS approval, but we plan on handing over control soon ™

We have not deployed the index canister yet (still under development), so that part is not tested live yet, but we expect that things should go smoothly. I personally would be happy to store $XXX worth of cycles in there, but I have enough insider knowledge so that I trust the team.

---

<div class="post-metadata">

**Author:** ![saikatdas0790](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/saikatdas0790/32/17147_2.png) [@saikatdas0790](https://forum.dfinity.org/u/saikatdas0790)\
**Post date:** [May 10, 2024, 5:41am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/50 "2024-05-10T05:41:10Z")

</div>

Wait, so I shouldn’t be custodying $$$'s of cycles in there, yet?

---

<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:** [May 10, 2024, 8:04am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/52 "2024-05-10T08:04:37Z")

</div>

Depends on how much you trust me 😉 Seriously speaking: we (the cycles ledger team, 3 people total) still have control over the canister, so we could always rugpull you. But the code is now stable and we don’t have any more security relevant work planned. Next week we’ll discuss if we can finally hand the canister over to the NNS and remove ourselves as controllers.

---

<div class="post-metadata">

**Author:** ![saikatdas0790](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/saikatdas0790/32/17147_2.png) [@saikatdas0790](https://forum.dfinity.org/u/saikatdas0790)\
**Post date:** [May 10, 2024, 8:13am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/53 "2024-05-10T08:13:17Z")

</div>

Too late. All our cycles are with you now 🌚

P.S.

We found another cool hack that we’re using for a UI right now.

Previously we relied on the Cycles Wallet UI for our non-CLI users in case they needed to topup canisters. But that’s been a bit wonky for some time now. It looks like it’s not widely supported anymore without any updates.

So, instead, what we’re doing for a UI for cycles is use the [Candid UI here](https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app/?id=um5iw-rqaaa-aaaaq-qaaba-cai) and open the Cycles Ledger address and then use II to login and obtain a principal and then transfer cycles on the cycles ledger to that principal that can be checked with the `icrc1_balance_of` method.

And subsequently they can use the `withdraw` method to top up canisters with this UI. No need to wait for the NNS support to land.

@Severin  
Quick question, any reason why the Candid UI Internet Identity uses `identity.internetcomputer.org` instead of `identity.ic0.app`?

---

<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:** [May 13, 2024, 9:10am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/54 "2024-05-13T09:10:51Z")

</div>

> [@saikatdas0790](#):
>
> Quick question, any reason why the Candid UI Internet Identity uses `identity.internetcomputer.org` instead of `identity.ic0.app`?

See this for context:

> [@Internet identity and login](https://forum.dfinity.org/t/internet-identity-and-login/21137/2):
>
> Hi, Internet Identity is accessible on two domains ([identity.internetcomputer.org](http://identity.internetcomputer.org) and identity.ic0.app) due to an incident that occurred earlier this year (please refer to [Important Community Update on ic0.app domain being flagged by an anti-spam blocklist](https://forum.dfinity.org/t/important-community-update-on-ic0-app-domain-being-flagged-by-an-anti-spam-blocklist/18537)). The incident has been resolved, and canister domains have been migrated as mentioned in the follow-up communication ([New canisters will only be accessible through the icp0.io domain. Existing canisters will be accessible both through ic0.a…](https://forum.dfinity.org/t/follow-up-on-item-new-canisters-will-only-be-accessible-through-the-icp0-io-domain-existing-canisters-will-be-accessible-both-through-ic0-app-and-icp0-io/18889)

---

<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:** [May 22, 2024, 3:26pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/55 "2024-05-22T15:26:57Z")

</div>

👋 Wanted to check in on this to see how close we are to an NNS controlled cycles ledger.

Will the cycle ledger be NNS controlled before the index canister gets deployed, or visa-versa?

---

<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:** [May 23, 2024, 8:13am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/56 "2024-05-23T08:13:03Z")

</div>

We ran into some serious problems with verifiability. If there’s no 100% guaranteed way for people to verify the cycles ledger we won’t hand it over. We’ll have a plan ready early next week.

---

<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:** [May 29, 2024, 9:00am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/57 "2024-05-29T09:00:07Z")

</div>

TLDR: We will reinstall one last time. Please withdraw your cycles.

Long version:  
Hello everyone, bad news with verifiability.

**The problem:**  
The first few versions of the cycles ledger we deployed were not reproducible builds, meaning that it is not obvious that there are no hidden balances or approvals in the state. Obviously, we can’t hand the cycles ledger over to the NNS and expect people to trust it this way.

**Options considered:**  
The two options we have moving forward are 1) reinstalling the cycles ledger with verifiable code or 2) add extra endpoints to the cycles ledger and develop tooling that allows everyone to verify that the state is correct. Option 2 would take a good amount of development time but verification would remain complex: To trust the cycles ledger you wouldn’t only have to verify the cycles ledger code, but also the verification protocol and the tools used for that. We concluded that option 1 causes less pain.

**The way forward:**  
Since there is a significant amount of cycles in the cycles ledger (at the time of writing a bit over 51k TC), we execute the following migration plan:

- Today (May 29):
  - We have [disabled the deposit function](https://github.com/dfinity/cycles-ledger/pull/132/files) so that people don’t deposit more cycles.
  - I will reach out to @icme and @saikatdas0790 since they seem to be the two people most affected.

- Today until ~June 3: Please withdraw your cycles!
- ~June 3 (next Monday):
  - We [disable all endpoints that allow modifying the state](https://github.com/dfinity/cycles-ledger/pull/133/files) of the cycles ledger.
  - We make a snapshot of all balances.
  - We hand over control of the cycles ledger canister and index canister over to the NNS.
  - We submit a proposal to reinstall the cycles ledger.
  - We submit a proposal to reinstall the index canister in order to wipe its state so it doesn’t supply outdated information.

- Once the proposal is adopted and executed (probably ~3 days after submitting):
  - We refund the balances of everyone that lost their balance using the snapshot from June 3

---

<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:** [May 31, 2024, 9:53pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/58 "2024-05-31T21:53:43Z")

</div>

Thanks for the communication Severin.

We’ve alerted all CycleOps customers that are currently using the Cycle Ledger, and sent out this PSA to get the word out to developers.

> <https://twitter.com/CycleOps/status/1796657977015078986>

---

<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:** [June 4, 2024, 7:42am UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/59 "2024-06-04T07:42:16Z")

</div>

Status update:

- Everything is going as planned
- Thank you everyone for withdrawing so diligently! We went down from ~51k TC down to 90 TC in total supply
- We disabled all endpoints that allow modifying the state
- We made the NNS Root canister the sole controller of cycles ledger and cycles index canister
- We made a new state snapshot with all remaining balances
- We submitted proposal [130151](https://dashboard.internetcomputer.org/proposal/130151) to reinstall the cycles ledger
- We submitted proposal [130152](https://dashboard.internetcomputer.org/proposal/130152) to reinstall the cycles index

---

<div class="post-metadata">

**Author:** ![tiago89](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/tiago89/32/22332_2.png) [@tiago89](https://forum.dfinity.org/u/tiago89)\
**Post date:** [June 4, 2024, 3:15pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/60 "2024-06-04T15:15:59Z")

</div>

Hi @Vivienne,

Noticed Dfinity voted to refuse the 2 reinstall proposals. I did the build verification and was able to reproduce both the Index and the Ledger.

But the Arguments hash are not matching, in neither proposal. Maybe that was the reason Dfinity refused?

Can you share what was the reason and how that changes the original plan?

Thanks,  
Tiago

Printscreens of my results:

 ![Screenshot 2024-06-04 at 16.06.09](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/8/5/856618dd2bf0afe26bd8081a9a00ebd8f862d3c7.png)  
 ![Screenshot 2024-06-04 at 16.13.12](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/8/e/8ee1eddc4c9256234bea9d3b7811d97cd0c36639.png)

---

<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:** [June 4, 2024, 3:26pm UTC](https://forum.dfinity.org/t/improving-the-cycle-management-experience/19895/61 "2024-06-04T15:26:33Z")

</div>

Exactly, there is an issue with the arguments, so we had to create two new proposals:

- If proposal [130287](https://dashboard.internetcomputer.org/proposal/130287) is accepted, the cycles ledger will be reinstalled.
- If proposal [130288](https://dashboard.internetcomputer.org/proposal/130288) is accepted, the cycles index canister will be reinstalled.

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

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