Accounts

Various account types in Squads V4, and how to derive them.

This section outlines the different account types you will encounter when interacting with Squads v4, including seeds and the struct associated with the account type. The program for all derivations in this section is the Squads v4 program ID.


Multisig

The multisig account is the main config for your Squad. This will contain your threshold, members, config authority, and handle any time-locks.

PDA Derivation

A multisig account is derived with the following seeds:

["multisig", "multisig", createKey]

The createKey is a unique Public Key, made specifically to derive the Multisig PDA.

Multisig Account Content

#[account]
pub struct Multisig {
    /// Key that is used to seed the multisig PDA.
    pub create_key: Pubkey,
    /// The authority that can change the multisig config.
    /// This is a very important parameter as this authority can change the members and threshold.
    ///
    /// The convention is to set this to `Pubkey::default()`.
    /// In this case, the multisig becomes autonomous, so every config change goes through
    /// the normal process of voting by the members.
    ///
    /// However, if this parameter is set to any other key, all the config changes for this multisig
    /// will need to be signed by the `config_authority`. We call such a multisig a "controlled multisig".
    pub config_authority: Pubkey,
    /// Threshold for signatures.
    pub threshold: u16,
    /// How many seconds must pass between transaction voting settlement and execution.
    pub time_lock: u32,
    /// Last transaction index. 0 means no transactions have been created.
    pub transaction_index: u64,
    /// Last stale transaction index. All transactions up until this index are stale.
    /// This index is updated when multisig config (members/threshold/time_lock) changes.
    pub stale_transaction_index: u64,
    /// Reserved for future use.
    pub _reserved: u8,
    /// Bump for the multisig PDA seed.
    pub bump: u8,
    /// Members of the multisig.
    pub members: Vec<Member>,
}

Proposal

The proposal account tracks votes cast by members pertaining to a given transaction. It stores the status of the given transaction, allowing it to be executed once the multisig threshold has been met.

PDA Derivation

A proposal account is derived with the following seeds:

["multisig", multisig_key (as buffer), "transaction", transaction_index, "proposal"]

The transaction index is a number auto incrementing based on your Multisig's total transactions.

Proposal Account Content


Vault Transaction

The vault transaction account stores a transaction message that is subsequently voted on via a proposal.

PDA Derivation

A vault transaction account is derived with the following seeds:

["multisig", multisig_key (as buffer), "transaction", transaction_index]

The transaction index is a number auto incrementing based on your Multisig's total transactions.

Vault Transaction Account Content


Batch

The batch account stores a collection of vault transactions, allowing them to be subsequently voted on, and executed with minimal actions.

PDA Derivation

A batch account is derived with the following seeds:

["multisig", multisig_key (as buffer), "transaction", transaction_index]

Batch Transaction Account Content


Config Transaction

The config transaction account is similar to a vault transaction, but deals directly with configuration parameters in your multisig account. These are used in cases where there is no set config authority.

PDA Derivation

A config transaction account is derived with the following seeds:

["multisig", multisig_key (as buffer), "transaction", transaction_index]

Config Transaction Account Content

Last updated