> For the complete documentation index, see [llms.txt](https://docs.squads.so/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.squads.so/main/squads-legacy/development/authorities.md).

# Authorities

Authority PDAs are responsible for signing the underlying CPIs executed by the multisig. Generally they should be seeded by a u32 starting from the default of 1 (the `authorityIndex`). The `authorityIndex` of a Transaction account will be used to generate the seeds necessary to perform the CPI. Most often you can simply use the `authorityIndex` of 1. For example, the Squads client uses an `authorityIndex` of 1 for all default PDAs (the vault, program upgrade authorities, etc).

Transactions must specify this `authorityIndex` upon creation, and all instructions attached to the Transaction should use the same authority PDA for any account that is designated as a signer.

*The `authorityIndex` of 0 is reserved for internal multisig instructions, and should generally be avoided.*&#x20;

The Authority PDAs are derived as such:

```
await anchor.web3.PublicKey.findProgramAddress([
    anchor.utils.bytes.utf8.encode("squad"),
    multisig.toBuffer(),
    authorityIndex.toBuffer("le", 4),  // note authority index is an u32 (4 byte)
    anchor.utils.bytes.utf8.encode("authority")
], programId);
```

Note that the authorityIndex should be supplied to the function as a 4 byte little-endian buffer.

The format of deriving an authority is:

`["squad", multisig, authorityIndex, "authority"]`


---

# 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.squads.so/main/squads-legacy/development/authorities.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.
