Overview
Themulticall_handler program provides a secure way to execute arbitrary batched instructions on Solana via Across cross-chain messages. It acts as a message receiver that deserializes and executes compiled instructions sent from other chains.
Program ID: HaQe51FWtnmaEcuYEfPA7MRCXKrtqptat4oJdJ8zV5Be
Purpose
When users bridge tokens to Solana with an attached message, themulticall_handler enables:
- Arbitrary execution - Execute any Solana instruction as part of the bridge
- Batched operations - Multiple instructions in a single cross-chain message
- Composability - Interact with any Solana program after receiving bridged funds
- Handler signing - Optional PDA signer for permissioned operations
Architecture
The handler receives serialized instructions from the SVM Spoke program and executes them as Cross-Program Invocations (CPIs).Implementation
Program Structure
Compiled Instruction Format
Handler Signer PDA
The handler maintains a PDA that can sign CPIs: Seeds:["handler_signer"]Bump: 255 (optimized for compute efficiency) This PDA can be included as a signer in any instruction executed by the handler, enabling permissioned operations.
Usage Example
Creating a Cross-Chain Message
On the origin chain (e.g., Ethereum), encode Solana instructions into the message field:Executing on Solana
When the relayer fills the deposit on Solana with the message:Use Cases
1. Token Swap After Bridge
Bridge USDC to Solana and immediately swap to another token:2. DeFi Interaction
Bridge and deposit into yield protocol:3. NFT Minting
Bridge payment and mint NFT:4. Multi-Step Operations
Complex multi-instruction flows:Security Considerations
Handler Signer PDA
Thehandler_signer PDA can sign arbitrary instructions. Programs accepting this PDA as a signer should:
- Validate the PDA derivation
- Implement proper authorization checks
- Not grant unlimited privileges
Account Validation
The handler does not validate:- Target program IDs
- Account ownership
- Instruction data validity
Message Size Limits
Solana transactions have a 1232 byte limit. Complex multi-instruction messages may hit this limit. Consider:- Minimizing instruction count
- Using compact instruction data
- Splitting across multiple deposits if needed
Reentrancy
The handler executes instructions sequentially. Each instruction can potentially call back into the handler, but:- The handler has no state to corrupt
- Target programs must implement their own reentrancy guards
- Standard Solana CPI rules apply
Deployment
Build
Deploy
Verification
Testing
Optimization
Handler Signer Bump
The program ID is chosen such that thehandler_signer PDA has a bump of 255:
Account Indexing
Instructions reference accounts by index rather than full pubkeys, reducing message size:Integration with SVM Spoke
The SVM Spoke program automatically calls the handler when a fill includes a message:recipient field in the deposit.
Limitations
- No state - Handler is stateless, cannot persist data between calls
- No validation - Handler does not validate instructions or accounts
- Size limits - Subject to Solana transaction size limits
- Sync execution - Instructions execute sequentially, not in parallel
- Error handling - Any instruction failure reverts entire transaction
Resources
Source Code
View on GitHub
Solana CPI Guide
Learn about Cross-Program Invocation
Transaction Limits
Solana transaction constraints
Bug Bounty
Report security issues