XChain Platform Action - UNSTAKE
This action begins the unstaking cooldown for an active stake identified by its signing pubkey. Two flavors:
- v0 — capability unstake. Full-pubkey: returns all capability stake rows for that pubkey (original plus any v2 top-ups).
- v1 — contract-targeted unstake. Returns the single
(TARGET_CONTRACT_INDEX, SIGNING_PUBKEY, TICK)stake row owned by the broadcaster. Use this for stakes created via STAKE v3.
For the full design see claude/reports/specs/2026-05-24_capability-staking-model.md.
PARAMS
| Name | Type | Description |
|---|---|---|
VERSION |
String | Format Version (0 = capability, 1 = contract-targeted) |
SIGNING_PUBKEY |
String | Ed25519 public key of the stake to unstake |
TARGET_CONTRACT_INDEX |
Integer | v1 only — action_index of the stakeable contract |
TICK |
String | v1 only — token ticker of the stake row to release |
Formats
Version 0 — Capability unstake
VERSION|SIGNING_PUBKEY
Version 1 — Contract-targeted unstake
VERSION|SIGNING_PUBKEY|TARGET_CONTRACT_INDEX|TICK
Examples
UNSTAKE|0|abc123...def
Begin unstaking the capability stake bound to pubkey abc123...def
(returns all rows for that pubkey, v1 + any v2 top-ups)
UNSTAKE|1|abc123...def|500|MYTOKEN
Begin unstaking the (contract=500, tick=MYTOKEN) stake row for pubkey abc123...def
Rules
SIGNING_PUBKEYmust be a valid 64-character hex-encoded Ed25519 public key.- The active stake lookup is gated by the activation delay — only fully-active stakes can be unstaked.
- Begins the cooldown period; staked tokens are not immediately returned.
v0 (capability)
- BTC chain only.
- A capability stake must exist for
SIGNING_PUBKEY, and the broadcasting address must be that stake’s original source.
v1 (contract-targeted)
- Works on any chain (BTC, LTC, DOGE).
- A contract-targeted stake row must exist for
(TARGET_CONTRACT_INDEX, SIGNING_PUBKEY, TICK), owned by the broadcasting address. - Cooldown for v1 is determined by the target contract’s
COOLDOWN_BLOCKSsetting (set at DEPLOY time), not the globalSTAKING.COOLDOWN_BLOCKS.
Deactivation Delay (Removal from Validator Set)
- Validator removal does not take effect immediately — the validator continues to participate for 6 BTC blocks after the UNSTAKE confirms.
- Tracked via the
deactivation_blockcolumn on all active stake rows for the pubkey (set toblock_index + 6). - Active-stake queries filter by
(deactivation_block IS NULL OR deactivation_block > current_block). - Prevents short-range BTC reorgs from affecting the active validator set.
Cooldown Period (Token Return)
- Separate from the deactivation delay — tracked via the
cooldown_end_blockcolumn on theunstakestable. - Default cooldown: 1000 blocks (configurable via
STAKING.COOLDOWN_BLOCKS). - After cooldown elapses, the staked XCHAIN tokens are returned to the broadcasting address.
Notes
- Two distinct delays apply on UNSTAKE:
- 6 blocks — validator removal from the active set (BTC reorg safety).
- 1000 blocks — XCHAIN token return (security cooldown).
- The 6-block deactivation delay applies to capability unstaking, which is BTC-only. Contract-targeted UNSTAKE v1 runs on every chain and uses that chain’s calibrated activation delay (6 blocks on BTC, 24 on LTC, 60 on DOGE) for equivalent ~60-min reorg protection.
- The unstake amount is the SUM of all active stake rows for the pubkey (original stake + any top-ups via STAKE v2).
- Use
STAKE(v1) to re-stake after the cooldown period completes. - Use
COLLECTto gather any accrued rewards before or after unstaking.
Copyright © 2025–2026 Dankest, LLC
Based on XChain Platform by Dankest, LLC – https://dankest.llc
Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-or-later) with a commercial license available for proprietary use.
You may use, modify, and distribute this material under the terms of the License. See LICENSE and NOTICE for full terms. See the licensing overview.