owner
can unfortunately mean two things, in the same way that heap
can mean multiple things in computer science.
See how the Solana runtime stores accounts. You will notice that it has an owner
field of type Pubkey
and a data
field that stores bytes. The runtime only allows an account's owner
to modify that account's data
. So this is the meaning of owner
in the context of the runtime.
The other meaning can be best explained with reference to an example. Say you want to write a token program. Users should be able to 'transfer', which decrements their own balance and increments the payee's balance. But they shouldn't be able to arbitrarily change their own balances (else, they would be able to give themselves infinite tokens), which is what would be possible if they owned their balance accounts directly.
So instead, what you can do is have your token program be the owner of balance accounts according to the runtime, and store balance accounts as a tuple of (balance (number), authority (public key)). Then, inside your transfer
code, you can check that the authority account has signed this transaction before decrementing their balance and incrementing the payee's balance.
You'll notice that calling it an authority was completely arbitrary; you could have called it something else like owner
or user
. And indeed, many programs such as the SPL token program do call it owner
(src). This is where we get the second meaning of owner.
An analogy you might want to consider is a bank. Ostensibly, you 'own' your bank account. But you can't climb into your bank's database and start changing your balance. You are like the authority over your account; the bank allows you to trigger state transitions, but at the end of the day the bank is the one making the changes in the database.