> 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/anchor-idl/create-a-multisig.md).

# Create a Multisig

To create a multisig, first derive the address. The address is technically a [PDA](https://docs.solana.com/developing/programming-model/calling-between-programs#program-derived-addresses), and can be derived based off of the `createKey.` The `createKey` can be any public key (wallet, random, etc.), as long as its supplied as a [PublicKey](https://coral-xyz.github.io/anchor/ts/classes/web3.PublicKey.html) type.

Additionally, the `create` method will need an approval threshold and a list of keys to act as the members of the multisig (signers).

For example, to create a multisig based on a user's wallet address or a random key:

```
 // using a wallet to seed the multisig & address
 const createKey = wallet.publicKey;
 // or
 const createKey = anchor.web3.Keypair.generate().publicKey;
 
 // list of members/keys
 const membersList = [wallet.publicKey, otherKey1, otherKey2];
 // threshold
 const threshold = 2;
 
 // the multisig pda
 const multisig = await anchor.web3.PublicKey.findProgramAddress(
    anchor.utils.bytes.utf8.encode("squad"),
    createKey.toBuffer(),
    anchor.utils.bytes.utf8.encode("multisig")
 );
 
 // adjust to fit your Anchor provider or if using React useAnchorWallet() hook
 const creator = wallet.publicKey;
 
 // this will create a multisig with a threshold of 2/3, with three members
 await squadsProgram.methods.create(threshold, createKey, memberList)
          .accounts({
             multisig,
             creator,
           })
           .rpc();
```

Read the [section on PDAs](/main/squads-legacy/development/pdas/multisig.md) for more information about the multisig PDA.


---

# 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/anchor-idl/create-a-multisig.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.
