# 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: 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:

```
GET https://docs.squads.so/main/squads-legacy/development/anchor-idl/create-a-multisig.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
