> For the complete documentation index, see [llms.txt](https://docs.xchandles.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xchandles.com/technical-manual/reward-distributors/other-reward-distributors/the-stake-action.md).

# The Stake Action

NFT/CAT: locked.

*Note*: The stake action code can be found [here](https://github.com/DIG-Network/reward-distributor-clsp/blob/main/rue-puzzles/actions/reward_distributor/staking/stake.rue) ([Chialisp](https://github.com/DIG-Network/reward-distributor-clsp/blob/main/puzzles/actions/reward_distributor/staking/stake.clsp)). The code for locking puzzles can be found [here](https://github.com/DIG-Network/reward-distributor-clsp/tree/main/rue-puzzles/actions/reward_distributor/staking/locking_puzzles) ([Chialisp](https://github.com/DIG-Network/reward-distributor-clsp/tree/main/puzzles/actions/reward_distributor/staking/locking_puzzles)).

This action adds an entry to the active entries of the reward distributor. The entry immediately starts earning rewards in the active epoch. A general locking puzzle asserts the appropriate asset with the appropriate amount has been deposited to the distributor - locked to the distributor's `p2_singleton` (`my_p2`), not a nonce wrapper around it - by using a settlement payments announcement. The settlement memo/hint is `tree_hash((custody_puzzle_hash, my_p2))`. Each locking puzzle also creates a deposit slot proving `(custody_puzzle_hash, shares, launcher_id or cat_amount)`.

In general, a locking puzzle returns the number of newly locked shares and a list of conditions, which will become part of the condition list returned by the action. The stake action also allows slot consolidation: if the user already has an entry slot, they can specify it so all their shares are represented by a single slot instead of multiple ones. This means that, at payout, accumulated rewards are paid out in a single coin.

There are three locking puzzles for the reward distributor, detailed below.

### NFTs From DID

This locking puzzle is used for collection NFT distributors. To prove the NFT belongs to a collection, a proof is used to calculate the launcher id starting with the minter DID inner puzzle hash (and going through all the intermediary coins). The NFT with the resulting launcher id is then checked to be sent to a singleton-controlled inner puzzle. With this locking puzzle, every locked NFT is worth exactly one share - in other words, no NFT in the collection is allocated more than any other NFT from the collection in a given second. The deposit slot records that one share and the NFT launcher id.

Because collections are usually part of the off-chain metadata instead of on-chain attributes, this locking puzzle actually proves NFTs have been minted by a particular DID. The puzzle assumes that the given DID only minted ONE collection - any NFT minted by the DID set at launch can be staked, which means the DID owner needs to be trusted not to maliciously mint many NFTs and stake all of them to collect future rewards. In general, while this category of NFT distributors is more trustless than managed reward distributors, it may still require trust. The next locking puzzle, for example, assumes the DataStore is operated as expected and not compromised. Lastly, the CAT reward distributor trusts the CAT's TAIL and its issuer (should they have the ability to increase the CAT supply).

### NFTs From DL

DL stands for DataLayer. Curated NFT reward distributors allow any NFT on a whitelist to be staked, with the weight of a given NFT also being specified on the said list. The list is stored in a Merkle tree inside a DataLayer store, with the trusted launcher id being set at distributor launch. The locking puzzle requires `nft_shares > 0` and writes that weight plus the NFT launcher id into the deposit slot. If the weight of the NFT in the list is changed by the store owner, the NFT may or may not be restaked via the [Refresh Action](/technical-manual/reward-distributors/other-reward-distributors/the-refresh-action.md).

### CAT

As the name suggests, the CAT locking puzzle allows a CAT with a certain asset id to be locked in exchange for a number of shares equal to its amount. The amount must be greater than 0. Both `shares` and `launcher_id_or_cat_amount` on the deposit slot are that amount.

*Written by* [*yakuhito*](https://x.com/yakuhito) *from* [*FireAcademy.io*](https://fireacademy.io/) *on Aug 28th, 2026.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xchandles.com/technical-manual/reward-distributors/other-reward-distributors/the-stake-action.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
