Multi-sig
M-of-N threshold signature wallet for secure group transactions
Pending
Anchor 0.32
Program ID
3AZTsn99QJnAVJ7gJE5QWgbWgj5jJ8D6wEBn89fKJvJH
Repository
ExpertVagabond/solana-multisig
Binary Size
254K
Cluster
Devnet
Instructions
IX
create_multisig
Creates a new multi-signature wallet with a list of owners and a required approval threshold.
| Parameter | Type | Description |
|---|---|---|
owners | Vec<Pubkey> | List of owner wallet addresses (max 10) |
threshold | u8 | Number of approvals required to execute a transaction |
IX
propose_transfer
Proposes a new token transfer from the multisig vault. The proposer's approval is automatically counted.
| Parameter | Type | Description |
|---|---|---|
amount | u64 | Token amount to transfer |
IX
approve
Approves a pending transaction. Each owner can only approve once.
| Parameter | Type | Description |
|---|---|---|
| No parameters | ||
IX
execute
Executes the transfer once the required number of approvals has been reached.
| Parameter | Type | Description |
|---|---|---|
| No parameters | ||
Accounts
Multisig
| Field | Type | Description |
|---|---|---|
owners | Vec<Pubkey> | List of owner wallet addresses |
threshold | u8 | Required number of approvals |
tx_count | u64 | Total transactions proposed |
bump | u8 | PDA bump seed |
Transaction
| Field | Type | Description |
|---|---|---|
multisig | Pubkey | The multisig wallet this transaction belongs to |
proposer | Pubkey | Wallet that proposed the transaction |
id | u64 | Sequential transaction ID |
destination | Pubkey | Recipient wallet address |
mint | Pubkey | Token mint for the transfer |
amount | u64 | Token amount to transfer |
approvals | Vec<bool> | Approval status for each owner (indexed by position) |
executed | bool | Whether the transaction has been executed |
created_at | i64 | Unix timestamp when the transaction was proposed |
bump | u8 | PDA bump seed |
PDA Derivation
multisig
seeds = [b"multisig", creator]
tx
seeds = [b"tx", multisig, tx_count.to_le_bytes()]
Error Codes
InvalidThreshold
Threshold must be between 1 and the number of owners
TooManyOwners
Maximum of 10 owners allowed per multisig
NotOwner
The signer is not an owner of this multisig
AlreadyApproved
This owner has already approved the transaction
ThresholdNotMet
Not enough approvals to execute the transaction
AlreadyExecuted
This transaction has already been executed
Overflow
Arithmetic overflow in transaction processing
Usage Example
import { Program, BN } from "@coral-xyz/anchor"; import { PublicKey } from "@solana/web3.js"; // Create a 2-of-3 multisig const owners = [owner1.publicKey, owner2.publicKey, owner3.publicKey]; const threshold = 2; const [multisigPda] = PublicKey.findProgramAddressSync( [Buffer.from("multisig"), owner1.publicKey.toBuffer()], program.programId ); await program.methods .createMultisig(owners, threshold) .accounts({ multisig: multisigPda, creator: owner1.publicKey, }) .signers([owner1]) .rpc(); // Propose a transfer of 5000 tokens await program.methods .proposeTransfer(new BN(5_000_000_000)) .accounts({ multisig: multisigPda, proposer: owner1.publicKey, destination: recipient.publicKey, mint, }) .signers([owner1]) .rpc();