4

I am gathering some information about the advantages of PDA accounts over accounts that have private keys. While the obvious one is that there is the potential vulnerability that you can withdraw funds from non-PDA accounts when you know its private key, I wonder if you can also modify its data?

Let's assume I created a keypair and used it to create an account of a custom program. In that case, the owner of the new account is the program and I can modify the account's data via the program. I wonder if there is a way to modify the account's data without the program if you know its private key? If yes, this would be another vulnerability that can be avoided using PDAs.

1
  • please distill this to one question. from the title and description you may be asking one of three unrelated things
    – trent.sol
    Commented Jul 29, 2022 at 22:40

1 Answer 1

6

I wonder if there is a way to modify the account's data without the program if you know its private key?

No. There are two concepts that are at play. Ownership and signing authority.

  1. Only the owner of an account can debit lamports or modify its data. You have the private key, which gives you the signing authority of that account, but you're not the owner. More on accounts here

  2. The private key gives you the signing authority, which is required for any write instruction to an account. Even with this signing authority only the owner (a program) can actually write data to the account.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.