A secure, efficient Multi-Signature Program built for Solana using the Pinocchio framework.
pinocchio-multisig is an on-chain program for the Solana blockchain that implements a multi-signature wallet. This design enhances security by requiring a predefined number of authorized signers (owners) to approve a transaction before it can be executed.
This program leverages the Pinocchio library, a zero-dependency, highly optimized framework for writing Solana programs in Rust, ensuring minimal compute unit (CU) consumption and a compact binary size.
- Trustless Multi-Signature Logic: Securely manage funds and execute arbitrary instructions only after achieving the required consensus of owners.
- Pinocchio Optimization: Built on Pinocchio for maximum efficiency in terms of compute units and on-chain program size.
- Flexible Transaction Execution: Allows the creation of proposals for any arbitrary Solana instruction, providing full administrative control over the governed accounts.
- Account Abstraction: Uses Program Derived Addresses (PDAs) to securely hold assets and execute transactions on the multisig's behalf.
- Pure Rust Implementation: Written entirely in Rust, following the best practices for low-level Solana program development.
To build, test, and deploy this program, you need to have the following installed:
- Rust: The Rust programming language and Cargo package manager.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Solana CLI: The Solana Command Line Interface.
sh -c "$(curl -sSfL https://release.solana.com/stable/install)" cargo-build-sbf: Used to compile the program for the Solana BPF (Berkeley Packet Filter) target.cargo install cargo-build-sbf
-
Clone the repository:
git clone https://github.com/Turbin3/pinocchio-multisig.git cd pinocchio-multisig -
Build the program: The Pinocchio framework uses a standard BPF build process.
cargo build-sbf --release
The compiled program file (
.so) will be located attarget/deploy/pinocchio_multisig.so. -
Deploy the program (Optional): You can deploy your local build to a Solana cluster (e.g.,
devnetortestnet).solana program deploy target/deploy/pinocchio_multisig.so
The Pinocchio Multisig program typically follows a core set of instructions:
- Initialize Multisig: Creates the multisig account, defines the set of owners, and sets the required threshold (
m of n) for transaction approval. - Create Transaction: Proposes an instruction to be executed by the multisig, specifying the target program, account list, and instruction data.
- Approve Transaction: An owner signs the transaction proposal. Once the number of approvals reaches the required threshold, the transaction can be executed.
- Execute Transaction: Finalizes the proposal and executes the underlying instruction with the multisig's authority (PDA).
Specific instruction data schemas and client-side (off-chain) tooling would be required to interact with the program correctly.
To run the program's tests (if implemented with solana-program-test or similar), use the standard Cargo test command:
cargo testContributions are welcome! Please feel free to fork the repository, create a feature branch, and submit a pull request for any improvements or bug fixes.
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.