Solana (SVM) vs EVM: Part 3
Solana programs cannot contain state.
This is different from EVM, where a smart contract *exclusively* controls the (theoretically infinite) storage associated with its address.
In contrast, Solana programs store data in separate data accounts, most often Program-Derived Addresses (PDAs). These are accounts that:
- Have no private key
- Contain data written by the program
- Can still hold lamports
- Can still participate as signers in CPIs (!)
Like any other account, PDAs follow the same account rules that require paying for rent, refund behavior, etc.
And like any other account, PDAs are openly readable by any other program. Interestingly, this is why Solana doesn't have onchain data encapsulation.
Solana (SVM) vs EVM: Part 2
There is no `msg.sender` on Solana.
In fact, you can have multiple "senders" on Solana. This is properly known as "signers", or mutable signers, as mutable allows you to modify that account's data.
If you need something similar to msg.sender on Solana, you should consider using a signer.
Note that Solana does not require a signer to be mutable. This allows you to check authorization from a user without modifying their account.