> 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/development/other/migrating-from-multisigcreate-v1-to-v2.md).

# Migrating from MultisigCreate v1 to v2

Squads has recently made a new update to their program which introduced rent collection of account data for transactions that have been initiated through the Squads program.

Here's how to use the new Multisig Create V2 instruction.

## Typescript

```typescript
    const creator = fundedKeypairExample();

    const createKey = Keypair.generate();
    
    const [multisigPda] = multisig.getMultisigPda({
      createKey: createKey.publicKey,
    });
    
  
    const programConfigPda = getProgramConfigPda({})[0];

    const programConfig =
      await multisig.accounts.ProgramConfig.fromAccountAddress(
        connection,
        programConfigPda
      );

    const configTreasury = programConfig.treasury;

    const tx = multisig.transactions.multisigCreateV2({
      blockhash: (await connection.getLatestBlockhash()).blockhash,
      treasury: configTreasury,
      createKey: createKey.publicKey,
      creator: creator.publicKey,
      multisigPda,
      configAuthority: null,
      timeLock: 0,
      threshold: 1,
      rentCollector: null,
      members: [
        {
          key: members.almighty.publicKey,
          permissions: Permissions.all(),
        },
        {
          key: members.almighty.publicKey,
          permissions: Permissions.all(),
        },
      ],
      programId,
    });

    
    tx.sign([creator, createKey]);
```

## Rust

```rust

        let rpc_client = RpcClient::new(rpc_url);

        let progress = ProgressBar::new_spinner().with_message("Sending transaction...");
        progress.enable_steady_tick(Duration::from_millis(100));

        let blockhash = rpc_client
            .get_latest_blockhash()
            .await
            .expect("Failed to get blockhash");

        let random_keypair = Keypair::new();

        let multisig_key = get_multisig_pda(&random_keypair.pubkey(), Some(&program_id));

        let program_config_pda = get_program_config_pda(Some(&program_id));

        let program_config = rpc_client
            .get_account(&program_config_pda.0)
            .await
            .expect("Failed to fetch program config account");

        let mut program_config_data = program_config.data.as_slice();

        let treasury = ProgramConfig::try_deserialize(&mut program_config_data)
            .unwrap()
            .treasury;

        let message = Message::try_compile(
            &transaction_creator,
            &[Instruction {
                accounts: MultisigCreateV2Accounts {
                    create_key: random_keypair.pubkey(),
                    creator: transaction_creator,
                    multisig: multisig_key.0,
                    system_program: system_program::id(),
                    program_config: program_config_pda.0,
                    treasury,
                }
                .to_account_metas(Some(false)),
                data: MultisigCreateV2Data {
                    args: MultisigCreateArgsV2 {
                        config_authority,
                        members,
                        threshold,
                        time_lock: 0,
                        memo: None,
                        rent_collector,
                    },
                }
                .data(),
                program_id,
            }],
            &[],
            blockhash,
        )
        .unwrap();

        let transaction = VersionedTransaction::try_new(
            VersionedMessage::V0(message),
            &[
                &*transaction_creator_keypair,
                &random_keypair as &dyn Signer,
            ],
        )
        .expect("Failed to create transaction");

        let signature = send_and_confirm_transaction(&transaction, &rpc_client).await?;

```


---

# 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/development/other/migrating-from-multisigcreate-v1-to-v2.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.
