Search code examples
solana

Only allow specific transfers in solana


I want only specific public keys/accounts (decided by votes) to be able to transfer SOL into a project account. Just anyone should not be able to transfer SOL into the project account. The project account in question is going to be created using my solana program.

Could someone here please inform if this is TECHNICALLY FEASIBLE or not and how to go about it conceptually?


Solution

  • Fundamentally:

    1. A wallet owner can use system transfer of SOL from any system owned account to any account (either system owned or program owned).
    2. Programs can transfer SOL from any program owned account to any account (either system owned or program owned).

    What you're looking for is not feasible. For example in option 1 you'd have to be in the system transfer logic to prevent transfers and for option 2 it still won't prevent what can be done by option 1.