> For the complete documentation index, see [llms.txt](https://docs.catalog.cat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.catalog.cat/technical-manual/puzzles.md).

# Puzzles

CATalog puzzle inventory in slot-machine

Canonical CATalog puzzle sources live in [slot-machine](https://github.com/Yakuhito/slot-machine). Rue sources compile to Chialisp under `puzzles/` via `./build.sh`. Compiled bytecode is embedded in [chia-wallet-sdk](https://github.com/xch-dev/chia-wallet-sdk) for drivers.

*Note*: This page has been mostly AI-generated.

## Singleton / Action Layer

| Puzzle            | Rue                                                                                                                                          | CLSP                                                                                                                                       | Purpose                                                                                                  |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| Action layer      | [action.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/singleton/action.rue)                                          | [action.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/singleton/action.clsp)                                          | Standardized way to easily allow state to be kept/tracked, as well as running multiple actions per spend |
| Finalizer         | [finalizer.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/singleton/finalizer.rue)                                    | [finalizer.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/singleton/finalizer.clsp)                                    | Recreate singleton with new state (standard/most basic finalizer)                                        |
| Reserve finalizer | [reserve\_finalizer.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/singleton/reserve_finalizer.rue)                   | [reserve\_finalizer.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/singleton/reserve_finalizer.clsp)                   | Finalizer + reserve management (`-42` prefix)                                                            |
| Slot              | [singleton/slot.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/singleton/slot.rue)                                    | [singleton/slot.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/singleton/slot.clsp)                                    | One-time-read slot coin                                                                                  |
| Slot helpers      | [slot.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/slot.rue)                                                        | n/a                                                                                                                                        | `spend_slot`, `create_slot` utilities                                                                    |
| Precommit         | [precommit.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/singleton/precommit.rue)                                    | [precommit.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/singleton/precommit.clsp)                                    | Commit-reveal payment coin                                                                               |
| State scheduler   | [state\_scheduler.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/singleton/state_scheduler.rue)                       | [state\_scheduler.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/singleton/state_scheduler.clsp)                       | Price singleton inner puzzle during launch (changes price according to a pre-set schedule)               |
| P2 by singleton   | [p2\_delegated\_by\_singleton.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/singleton/p2_delegated_by_singleton.rue) | [p2\_delegated\_by\_singleton.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/singleton/p2_delegated_by_singleton.clsp) | A 'custody puzzle' (p2) for a singleton                                                                  |

## CAT Makers

| Puzzle              | Rue                                                                                                                                   | CLSP                                                                                                                                | Purpose                                    |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| Default CAT maker   | [default\_cat\_maker.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/default_puzzles/default_cat_maker.rue)     | [default\_cat\_maker.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/default_puzzles/default_cat_maker.clsp)     | CAT maker for standard/vanilla CATs        |
| Revocable CAT maker | [revocable\_cat\_maker.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/default_puzzles/revocable_cat_maker.rue) | [revocable\_cat\_maker.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/default_puzzles/revocable_cat_maker.clsp) | CAT maker for CATs with a revocation layer |

## CATalog Actions

| Puzzle          | Rue                                                                                                                         | CLSP                                                                                                                      | Purpose                                          |
| --------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| Register        | [register.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/actions/catalog/register.rue)               | [register.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/actions/catalog/register.clsp)               | Insert TAIL into sorted list, mint NFT           |
| Refund          | [refund.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/actions/catalog/refund.rue)                   | [refund.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/actions/catalog/refund.clsp)                   | Return funds from (some) invalid precommit coins |
| Shared types    | [shared.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/actions/catalog/shared.rue)                   | n/a                                                                                                                       | `CatalogState`, `CatalogStateTruth`              |
| Delegated state | [delegated\_state.rue](https://github.com/Yakuhito/slot-machine/blob/master/rue-puzzles/actions/shared/delegated_state.rue) | [delegated\_state.clsp](https://github.com/Yakuhito/slot-machine/blob/master/puzzles/actions/shared/delegated_state.clsp) | Apply price singleton state update               |


---

# 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.catalog.cat/technical-manual/puzzles.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.
