DEV Community

AK
AK

Posted on

Solana #1: Program Derived Address

Terminology:

  • An Account whose owner is a program and thus is not controlled by a private key like other account.
  • PDAs (program derived address) are addresses with special properties. Unlike normal addresses, PDAs are not public keys and therefore do not have an associated private key. There are 2 use cases for PDAs. They provide a mechanism to build hashmap-like structures on-chain and they allow programs to sign instructions.
  • Given a seed of arbitrary bytes plus a program id, you can generate what look like an ed25519 public key.
  • A Program Derived Address (PDA> is home to an account that's designed to be controlled by a specific program. With PDAs, programs can programmatically sign for certain address without needing a private key. At the same time, PDAs ensure that no external user could also generate a valid signature for the same address. These address serve as the foundation for Cross-Program Invocation, which allows Solana apps to be compossible with one another.

Create a PDA:

PDAs are derived from a program id and a collection of seeds such as string "vote_account", a public key, an array of numbers.

Top comments (0)