> ## Documentation Index
> Fetch the complete documentation index at: https://new-docs.squads.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating from MultisigCreate v1 to v2

## Overview

Squads has introduced a program update with the MultisigCreate v2 instruction. This update introduces rent collection for account data for transactions initiated through the Squads program. `multisigCreate` is deprecated in favour of `multisigCreateV2`, and the current program source rejects `multisigCreate` with a `MultisigCreateDeprecated` error.

## What Changed

The main difference in v2 is the addition of:

* **Program Config PDA**: A new account that holds program configuration
* **Treasury Account**: Used for rent collection purposes
* **Rent Collector**: Optional parameter for specifying rent collection

## TypeScript Implementation

```typescript theme={null}
const creator = fundedKeypairExample();

const createKey = Keypair.generate();

const [multisigPda] = multisig.getMultisigPda({
  createKey: createKey.publicKey,
});

const programConfigPda = multisig.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.proposer.publicKey,
      permissions: Permissions.all(),
    },
  ],
  programId,
});

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

### Key Changes from v1

1. **Fetch Program Config**: You now need to fetch the program config PDA
2. **Get Treasury**: Extract the treasury address from the program config
3. **Pass Treasury**: Include the treasury in the `multisigCreateV2` call
4. **Rent Collector**: Optionally specify a rent collector address

## Rust Implementation

```rust theme={null}
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?;
```

### Key Rust Changes

1. **Program Config PDA**: Fetch using `get_program_config_pda()`
2. **Deserialize Config**: Use `ProgramConfig::try_deserialize()` to get treasury
3. **New Account Structure**: Use `MultisigCreateV2Accounts` instead of v1
4. **New Args Structure**: Use `MultisigCreateArgsV2` with additional fields

## Troubleshooting

| Issue | Cause | Solution |
| - | - | - |
| Program config fetch fails | RPC issues or incorrect program ID | Verify you're using the correct program ID. Check RPC connection. Ensure correct network (mainnet vs devnet). |
| Treasury address invalid | Treasury not properly extracted from program config | Verify program config was deserialized correctly. Check that treasury field exists and is valid. |
| Transaction simulation fails | Missing accounts or incorrect instruction format | Ensure all required accounts are included. Verify accounts are in correct order. Check that all signers are included. |

## See Also

* [Create Multisig](/developers/typescript-sdk/instructions/create-multisig)
* [Accounts Reference](/developers/reference/accounts)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.