# How to stop others from adding cycles to my IC canister (except controllers and assigned users)?

**URL:** <https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908>\
**Category:** Developers\
**Tags:** Discussing\
**Created:** [February 26, 2024, 6:59pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908 "2024-02-26T18:59:51Z")\
**Posts on this page:** 10\
**Page:** 1

<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:** [February 26, 2024, 6:59pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/1 "2024-02-26T18:59:51Z")

</div>

In the docs of [IC management canister interface](https://internetcomputer.org/docs/current/references/ic-interface-spec#ic-deposit_cycles) it is mentioned that “There is no restriction on who can invoke this method”.

**I wonder if there is a way to restrict other callers that deposit cycles using IC Management Canister’s `deposit_cycles` method other than controllers and assigned principals.**

If anyone has a solution please let me know.  
Thanks!

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [February 26, 2024, 7:47pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/2 "2024-02-26T19:47:19Z")

</div>

~~A method needs to be implemented in a canister to actually be able to receive and accept cycles. Within this method implementation, you need to call the accept cycles cdk method to actually accept the cycles. Any form of logic can be implemented e.g. allowlist to conditionally accept the cycles.~~

Edit: See later posts

---

<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 26, 2024, 7:52pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/3 "2024-02-26T19:52:00Z")

</div>

I don’t think this keeps others from dumping cycles onto your canister via other cycle accounting methods.

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [February 26, 2024, 7:54pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/4 "2024-02-26T19:54:08Z")

</div>

How would you increase the cycle balance of another canister then? Maybe you could sent cycle tokens once we have a ledger for it. But I suppose these tokens wouldn’t be actual cycles on the canister unless consumed? (haven’t followed along in the other cycle ledger thread recently)

---

<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 26, 2024, 9:25pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/5 "2024-02-26T21:25:49Z")

</div>

Whatever process Dank uses for XTC burn sends the cycles to whatever canister you want:

dfx canister --network=ic --no-wallet call aanaa-xaaaa-aaaah-aaeiq-cai burn “(record { canister\_id= principal "some-canister’s-principal-id"; amount= (2000:nat64)})”

I think you can even send these to canisters that don’t have a wasm installed. I don’t think you can gate them.

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [February 26, 2024, 10:12pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/6 "2024-02-26T22:12:15Z")

</div>

Ah looks like you’re right, found this post that mentions it [Question about deposit\_cycles](https://forum.dfinity.org/t/question-about-deposit-cycles/12693)

> anyone can call deposit\_cycles. wallet\_receive does not exist to work around a limitation of deposit\_cycles, but rather because when it was created, deposit\_cycles did not exist

---

<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 27, 2024, 7:33am UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/7 "2024-02-27T07:33:02Z")

</div>

Correct. And to add: `wallet_receive` can still be useful because there is no `on_cycles_deposited` hook available. If you want to be notified of receiving cycles the depositor has to ping you somehow (or you check with timers)

---

<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:** [February 27, 2024, 5:13pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/8 "2024-02-27T17:13:38Z")

</div>

Thank you for your response. Unfortunately, there doesn’t seem to be a straightforward solution. Even if the depositor intentionally deposits without notifying me, setting up a timer to monitor the cycle balance would also incur additional costs. It would be ideal if there were canister settings that allowed us to customize who can deposit cycles, with the default option being that everyone can deposit.👍

If you have any other solutions related to this forum post, feel free to share them! 😊

---

<div class="post-metadata">

**Author:** ![levi](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/levi/32/22608_2.png) [@levi](https://forum.dfinity.org/u/levi)\
**Post date:** [February 27, 2024, 8:10pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/9 "2024-02-27T20:10:48Z")

</div>

Hi @ahdrahees, I want to make sure you know about the possibility like @Vivienne is saying, that a canister can accept cycles in a regular canister method using the `msg_cycles_accept`/`msg_cycles_available` system apis. Callers can put cycles into the call and the callee (you) can accept them within the call. This way the caller won’t have to notify you separately and you won’t have to set up timers to monitor the cycles balance.

A different option and possibility that you can use now, is leverage the open CYCLES-BANK by the [CTS](https://twitter.com/CTS_SYSTEM). The CYCLES-BANK - canister-id: [wwikr-gqaaa-aaaar-qacva-cai](https://dashboard.internetcomputer.org/canister/wwikr-gqaaa-aaaar-qacva-cai) - is an ICRC-1 ledger that holds cycles 1:1 and send cycles in or out of the ledger using the [`cycles_in`](https://dashboard.internetcomputer.org/canister/wwikr-gqaaa-aaaar-qacva-cai#cycles_in), [`cycles_out`](https://dashboard.internetcomputer.org/canister/wwikr-gqaaa-aaaar-qacva-cai#cycles_out), and [`mint_cycles`](https://dashboard.internetcomputer.org/canister/wwikr-gqaaa-aaaar-qacva-cai#mint_cycles) methods. The CYCLES-TRANSFER-STATION uses the CYCLES-BANK for the mint, transfer, and trade of the cycles at the CTS order-book market trading platform. If this option is a better fit for your use-case, let me know, I can help with the integration/implementation.

---

<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 27, 2024, 8:25pm UTC](https://forum.dfinity.org/t/how-to-stop-others-from-adding-cycles-to-my-ic-canister-except-controllers-and-assigned-users/27908/10 "2024-02-27T20:25:54Z")

</div>

I’m curious about your use case for not wanting cycles? Is it potentially messing up your accounting somewhere? If you don’t want them you can send them to me. 🙂

At one point we had someone build a ‘cycle dao’ where you could mint out tokens to users that sent you cycles to support your services. It might have some interesting code for you: [Completed: ICDevs.org - Bounty #17 - A DAO for Cycles - $10,000 - ht: cycle\_dao](https://forum.dfinity.org/t/completed-icdevs-org-bounty-17-a-dao-for-cycles-10-000-ht-cycle-dao/11427)
