Skip to main content

find_program_address

Function find_program_address 

Source
pub fn find_program_address(
    seeds: &[&[u8]],
    program_id: &Pubkey,
) -> (Pubkey, u8)
Expand description

Derive the canonical (highest-bump) PDA for seeds under program_id.

Mirrors solana_program::Pubkey::find_program_address: the bump is appended as the last seed, then the program id and PDA_MARKER follow; bump seeds are tried 255 → 1 (descending) and the first (highest) off-curve hash wins.

Returns (pda, bump_seed). Panics only if no off-curve hash is found across 255 bumps — practically unreachable (~0.5^255 probability).