5/5
## Introduction to Program Derived Addresses (PDAs) In the Solana ecosystem, understanding account management is fundamental to building secure and functional decentralized applications (dApps). While most developers are familiar with standard accounts, **Program Derived Addresses (PDAs)** represent an intermediate but critical concept that unlocks the full potential of Solana’s programming model. To understand a PDA, we must first look at a standard Solana account. Typically, an account is defined by a public/private key pair. The **Private Key** is used to derive the **Public Key**, and the private key is required to sign transactions authorized by that account. A **PDA** breaks this rule. It is a Public Key that has **no associated Private Key**. Because there is no private key, no external user (like a wallet owner) can generate a signature for a PDA. Instead, the Solana network allows the program that derived the address to "sign" for it programmatically. ## How is a PDA Created? Unlike standard wallet addresses, PDAs are not generated randomly. They are created **deterministically**. This means that if you provide the exact same inputs, you will always arrive at the exact same address. To derive a PDA, three specific inputs are required: 1. **Program ID:** The address of the program that will own and control the PDA. 2. **Seeds:** A set of predefined inputs chosen by the developer. These can be strings, numbers, or other public keys (such as a user's wallet address). 3. **Bump:** A specific integer (ranging from 0 to 255) used to force the address off the cryptographic curve (explained in the technical deep dive below). The conceptual formula for a PDA looks like this: > **PDA = hash(Program ID + Seeds + Bump)** ## Why Are PDAs Useful? PDAs are the backbone of secure state management on Solana. They offer three primary benefits that solve complex architectural problems: ### 1. Security and Programmatic Ownership Because a PDA has no private key, no human user can sign transactions for it. The Solana runtime recognizes that a PDA belongs to a specific Program ID. Consequently, **only the program that derived the address** has the authority to modify the account's data or transfer its funds. This eliminates the overhead of managing private keys for smart contracts and creates a trustless environment where account constraints are enforced strictly by code. ### 2. Hashmap-like Data Structures PDAs allow developers to create deterministic mappings between users and on-chain data, functioning similarly to a Key-Value store or a Hashmap. * **Key:** Derived from the User's Public Key + Program ID. * **Value:** The data stored in the resulting PDA. For example, a developer can map a `User's Public Key` directly to a `Locked State` account or an `Authorization Status` account without needing a centralized database to track where that data lives. ### 3. Deterministic Addressing Because the address is calculated from known inputs (seeds), client-side applications (like a web frontend) can calculate exactly where a specific piece of data will be stored *before* any interaction with the blockchain occurs. This improves UI responsiveness and simplifies transaction construction. ## Real-World Example: The "Lock Program" To visualize how this works, consider a use case where a user, **Alice**, wants to lock **1 SOL** for one year using a **Lock Program**. **The Inputs:** * **Program ID:** The address of the Lock Program. * **Seeds:** `Alice's Public Key` + `User Specified Random Number`. (Including a random number or ID allows Alice to create multiple, distinct lock accounts if she wishes). * **Bump:** A canonical number (e.g., 255) to validate the address. **The Process:** 1. **Derivation:** The Lock Program (or the client) calculates the PDA using the inputs above. This becomes **Alice’s Lock Account**. 2. **Funding:** Alice sends 1 SOL to this newly derived PDA. 3. **State Management:** The program initializes the account and stores data inside it, such as the `Lock Expiry Timestamp`. **The Result:** Although the PDA is cryptographically associated with Alice (because her key was a seed), she cannot withdraw the funds directly. **Only the Lock Program** can move the 1 SOL out of that account. The program code will check the current time against the `Lock Expiry Timestamp` stored in the PDA and only sign the withdrawal transaction if the time condition is met. ## Technical Deep Dive: The "Bump" and Ed25519 Curves The most technical aspect of a PDA is the concept of the "Bump" and why it is necessary to ensure the address has no private key. Solana uses the **Ed25519** digital signature scheme. In this cryptographic system: * **Standard Public Keys** (wallets) represent points that lie **ON** the Ed25519 elliptic curve. * **PDAs** must represent points that lie **OFF** the curve. If an address lies on the curve, it has a corresponding private key. If it lies off the curve, it is mathematically impossible to generate a private key for it. **The Function of the Bump:** When the system attempts to create a PDA using the Program ID and Seeds, it runs a hash function. However, there is a roughly 50% chance the resulting hash will land "on the curve" (which would be a valid public key, but an invalid PDA). To solve this, the "Bump" is used as a nonce: 1. The system starts with a bump of **255**. 2. It hashes the inputs. 3. It checks: "Is this point on the curve?" 4. **If YES (On Curve):** It is invalid for a PDA. The bump is decremented by 1 (to 254), and the hash is recalculated. 5. **If NO (Off Curve):** It is a valid PDA. This ensures the address acts strictly as a storage account controlled by the program, with no external backdoor via a private key. ## Summary and Key Takeaways Mastering PDAs is essential for writing sophisticated Solana programs. Here are the core concepts to remember: * **No Private Keys:** PDAs are addresses without private keys, ensuring that only the owning program can sign for them via the Solana runtime. * **Deterministic Mapping:** They act as an on-chain Key-Value store, allowing you to locate data based on a user's address and program seeds. * **Uniqueness:** By adding unique seeds (like a generic ID or random number), a single user can own multiple PDAs derived from the same program. * **Security:** They enforce program logic over assets, as seen in the "Lock Program" example, where funds are programmatically secured rather than user-managed.
In the Solana ecosystem, understanding account management is fundamental to building secure and functional decentralized applications (dApps). While most developers are familiar with standard accounts, Program Derived Addresses (PDAs) represent an intermediate but critical concept that unlocks the full potential of Solana’s programming model.
To understand a PDA, we must first look at a standard Solana account. Typically, an account is defined by a public/private key pair. The Private Key is used to derive the Public Key, and the private key is required to sign transactions authorized by that account.
A PDA breaks this rule. It is a Public Key that has no associated Private Key. Because there is no private key, no external user (like a wallet owner) can generate a signature for a PDA. Instead, the Solana network allows the program that derived the address to "sign" for it programmatically.
Unlike standard wallet addresses, PDAs are not generated randomly. They are created deterministically. This means that if you provide the exact same inputs, you will always arrive at the exact same address.
To derive a PDA, three specific inputs are required:
Program ID: The address of the program that will own and control the PDA.
Seeds: A set of predefined inputs chosen by the developer. These can be strings, numbers, or other public keys (such as a user's wallet address).
Bump: A specific integer (ranging from 0 to 255) used to force the address off the cryptographic curve (explained in the technical deep dive below).
The conceptual formula for a PDA looks like this:
PDA = hash(Program ID + Seeds + Bump)
PDAs are the backbone of secure state management on Solana. They offer three primary benefits that solve complex architectural problems:
Because a PDA has no private key, no human user can sign transactions for it. The Solana runtime recognizes that a PDA belongs to a specific Program ID. Consequently, only the program that derived the address has the authority to modify the account's data or transfer its funds. This eliminates the overhead of managing private keys for smart contracts and creates a trustless environment where account constraints are enforced strictly by code.
PDAs allow developers to create deterministic mappings between users and on-chain data, functioning similarly to a Key-Value store or a Hashmap.
Key: Derived from the User's Public Key + Program ID.
Value: The data stored in the resulting PDA.
For example, a developer can map a User's Public Key directly to a Locked State account or an Authorization Status account without needing a centralized database to track where that data lives.
Because the address is calculated from known inputs (seeds), client-side applications (like a web frontend) can calculate exactly where a specific piece of data will be stored before any interaction with the blockchain occurs. This improves UI responsiveness and simplifies transaction construction.
To visualize how this works, consider a use case where a user, Alice, wants to lock 1 SOL for one year using a Lock Program.
The Inputs:
Program ID: The address of the Lock Program.
Seeds: Alice's Public Key + User Specified Random Number. (Including a random number or ID allows Alice to create multiple, distinct lock accounts if she wishes).
Bump: A canonical number (e.g., 255) to validate the address.
The Process:
Derivation: The Lock Program (or the client) calculates the PDA using the inputs above. This becomes Alice’s Lock Account.
Funding: Alice sends 1 SOL to this newly derived PDA.
State Management: The program initializes the account and stores data inside it, such as the Lock Expiry Timestamp.
The Result:
Although the PDA is cryptographically associated with Alice (because her key was a seed), she cannot withdraw the funds directly. Only the Lock Program can move the 1 SOL out of that account. The program code will check the current time against the Lock Expiry Timestamp stored in the PDA and only sign the withdrawal transaction if the time condition is met.
The most technical aspect of a PDA is the concept of the "Bump" and why it is necessary to ensure the address has no private key.
Solana uses the Ed25519 digital signature scheme. In this cryptographic system:
Standard Public Keys (wallets) represent points that lie ON the Ed25519 elliptic curve.
PDAs must represent points that lie OFF the curve.
If an address lies on the curve, it has a corresponding private key. If it lies off the curve, it is mathematically impossible to generate a private key for it.
The Function of the Bump:
When the system attempts to create a PDA using the Program ID and Seeds, it runs a hash function. However, there is a roughly 50% chance the resulting hash will land "on the curve" (which would be a valid public key, but an invalid PDA).
To solve this, the "Bump" is used as a nonce:
The system starts with a bump of 255.
It hashes the inputs.
It checks: "Is this point on the curve?"
If YES (On Curve): It is invalid for a PDA. The bump is decremented by 1 (to 254), and the hash is recalculated.
If NO (Off Curve): It is a valid PDA. This ensures the address acts strictly as a storage account controlled by the program, with no external backdoor via a private key.
Mastering PDAs is essential for writing sophisticated Solana programs. Here are the core concepts to remember:
No Private Keys: PDAs are addresses without private keys, ensuring that only the owning program can sign for them via the Solana runtime.
Deterministic Mapping: They act as an on-chain Key-Value store, allowing you to locate data based on a user's address and program seeds.
Uniqueness: By adding unique seeds (like a generic ID or random number), a single user can own multiple PDAs derived from the same program.
Security: They enforce program logic over assets, as seen in the "Lock Program" example, where funds are programmatically secured rather than user-managed.
A conceptual guide to Introduction to Program Derived Addresses (PDAs) - Explore the mechanics of deterministic account generation that allows smart contracts to sign transactions without private keys. Master the cryptographic requirements of the Ed25519 curve and learn how seeds and bumps create secure, hashmap-like data structures on-chain.
Previous lesson
Previous
Next lesson
Next
Course Overview
About the course
Native Rust & Anchor framework
PDAs, CPIs, and SPL Tokens
DeFi builds: oracles, auctions, AMMs
Last updated on January 12, 2026
Rust Developer
SolanaDuration: 8min
Duration: 23min
Duration: 4min
Duration: 2min
Duration: 4min
Duration: 11min
Duration: 4min
Duration: 0min
Duration: 0min
Course Overview
About the course
Native Rust & Anchor framework
PDAs, CPIs, and SPL Tokens
DeFi builds: oracles, auctions, AMMs
Last updated on January 12, 2026