> For the complete documentation index, see [llms.txt](https://docs.stacks.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacks.co/cookbook/clarity.md).

# Clarity

- [Address Utilities](https://docs.stacks.co/cookbook/clarity/address-utilities.md)
- [Convert BTC to STX address](https://docs.stacks.co/cookbook/clarity/address-utilities/convert-btc-to-stx-address.md)
- [Convert string to principal](https://docs.stacks.co/cookbook/clarity/address-utilities/convert-string-to-principal.md)
- [Derive principal addresses between networks](https://docs.stacks.co/cookbook/clarity/address-utilities/derive-principal-addresses-between-networks.md)
- [Create a random burn address](https://docs.stacks.co/cookbook/clarity/address-utilities/create-a-random-burn-address.md)
- [Data Utility](https://docs.stacks.co/cookbook/clarity/data-utility.md)
- [Filter items from a list](https://docs.stacks.co/cookbook/clarity/data-utility/filter-items-from-a-list.md)
- [Check for duplicates](https://docs.stacks.co/cookbook/clarity/data-utility/check-for-duplicates.md)
- [Return an entry from a map](https://docs.stacks.co/cookbook/clarity/data-utility/return-an-entry-from-a-map.md)
- [Cryptography & Security](https://docs.stacks.co/cookbook/clarity/cryptography-and-security.md)
- [Create sha256 hash clarity](https://docs.stacks.co/cookbook/clarity/cryptography-and-security/create-sha256-hash-clarity.md)
- [Contract post-conditions](https://docs.stacks.co/cookbook/clarity/cryptography-and-security/contract-post-conditions.md)
- [Generate random number](https://docs.stacks.co/cookbook/clarity/cryptography-and-security/generate-random-number.md)
- [Helper function to restrict contract calls](https://docs.stacks.co/cookbook/clarity/cryptography-and-security/helper-function-to-restrict-contract-calls.md)
- [Example Contracts](https://docs.stacks.co/cookbook/clarity/example-contracts.md): How Clarity contracts look in practice
- [Megapont Ape Club NFT](https://docs.stacks.co/cookbook/clarity/example-contracts/megapont-ape-club-nft.md)
- [Smart Wallets](https://docs.stacks.co/cookbook/clarity/example-contracts/smart-wallets.md)
- [Proof of Transfer (PoX)](https://docs.stacks.co/cookbook/clarity/example-contracts/proof-of-transfer-pox.md)
- [Semi Fungible Token](https://docs.stacks.co/cookbook/clarity/example-contracts/semi-fungible-token.md)
- [Send Many](https://docs.stacks.co/cookbook/clarity/example-contracts/send-many.md)
- [ExecutorDAO Framework](https://docs.stacks.co/cookbook/clarity/example-contracts/executordao-framework.md)
- [NFT Marketplace](https://docs.stacks.co/cookbook/clarity/example-contracts/nft-marketplace.md)
- [Ordinals Swap](https://docs.stacks.co/cookbook/clarity/example-contracts/ordinals-swap.md)
- [DeFi Lending](https://docs.stacks.co/cookbook/clarity/example-contracts/defi-lending.md)
- [Non-Fungible token](https://docs.stacks.co/cookbook/clarity/example-contracts/non-fungible-token.md)
- [Fungible Token](https://docs.stacks.co/cookbook/clarity/example-contracts/fungible-token.md)
- [Counter](https://docs.stacks.co/cookbook/clarity/example-contracts/counter.md)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stacks.co/cookbook/clarity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
