# set-childkey-take (/docs/tx/set-childkey-take)

The childkey take is the fraction of emissions a child hotkey keeps from
the stake weight its parents delegate to it, before passing the remainder
through. It is set per subnet, unlike the global delegate take. Signed by
the coldkey that owns the child hotkey. The chain enforces both its
minimum and maximum childkey take bounds, and rate-limits only increases
— decreases apply immediately, so lowering the take is always available.

| Signer    | Origin                                 | Pallet          | Wraps                                                                                             |
| --------- | -------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------- |
| `coldkey` | signed account (pallet role may apply) | SubtensorModule | [`SubtensorModule.set_childkey_take`](/code/pallets/subtensor/src/macros/dispatches.rs#L925-L937) |

## Parameters [#parameters]

| Parameter     | Type                        | Required | Description                                                                                                                               |
| ------------- | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `netuid`      | integer                     | yes      | Subnet the childkey take applies to.                                                                                                      |
| `take`        | integer \| number \| string | yes      | New take: a 0..1 fraction (e.g. 0.18 for 18 percent) or the raw u16 proportion (0..65535). The chain enforces its configured take bounds. |
| `hotkey_ss58` | string                      | no       | Hotkey the operation applies to.                                                                                                          |

Address parameters (`--hotkey`, `--coldkey`, `--dest`, ...) accept a raw ss58
address, an address-book or proxy-book name, or a local wallet/hotkey name.

## CLI [#cli]

Preview with `--dry-run` (shows fee, effects, and policy result without
submitting), then submit:

```bash
btcli tx set-childkey-take \
  --netuid <int> \
  --take <value> --dry-run
btcli tx set-childkey-take \
  --netuid <int> \
  --take <value> -w my_coldkey
```

## Python [#python]

```python
import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.SetChildkeyTake(netuid=1, take="...")

sub = bt.Subtensor()
plan = sub.plan(intent, wallet)   # fee, effects, policy — no submission
result = sub.execute(intent, wallet)
if not result.success:
    print(result.error.code, result.error.remediation)
```

(`bt.Subtensor` is also the async client — `async with bt.Subtensor() as client:`
— see [The client](/docs/concepts/client).) Or build the intent by op name, as
an agent would:

```python
result = sub.execute_tool("set_childkey_take", {...}, wallet)
```

## On-chain implementation [#on-chain-implementation]

`SubtensorModule.set_childkey_take` — [`pallets/subtensor/src/macros/dispatches.rs#L927`](/code/pallets/subtensor/src/macros/dispatches.rs#L925-L937):

```rust
#[pallet::call_index(75)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::set_childkey_take())]
pub fn set_childkey_take(
    origin: OriginFor<T>,
    hotkey: T::AccountId,
    netuid: NetUid,
    take: PerU16,
) -> DispatchResult {
    let coldkey = ensure_signed(origin)?;

    // Call the utility function to set the childkey take
    Self::do_set_childkey_take(coldkey, hotkey, netuid, take)
}
```

Delegates to [`do_set_childkey_take`](/code/pallets/subtensor/src/staking/set_children.rs#L707).

Every file is browsable under [/code](/code) exactly as built into the runtime, or as plain text under `/code/raw/<path>` (index: [`/code/index.json`](/code/index.json)).
