Skip to main content

Module pda

Module pda 

Source
Expand description

Hopper-owned PDA ergonomics on top of the native runtime boundary.

Functions§

const_program_address
A program-derived address evaluated at compile time.
create_program_address
Create a program-derived address from seeds and a program ID.
derive
Hopper-facing alias for PDA derivation.
find_and_verify_pda
Verify that an account matches a PDA derived from the given seeds.
find_bump_for_address
Find the bump under which seeds hash to expected, searching from 255 down with one sol_sha256 per candidate and no curve check (about 150 CU per candidate instead of about 310). Returns InvalidSeeds when no bump matches. Same soundness condition as verify_pda_address: use it only when expected is bound to a program-owned or about-to-be created account; otherwise find_canonical_bump_checked.
find_canonical_bump_checked
The canonical bump for seeds, found with the curve check on every candidate, provided the canonical address equals expected.
find_program_address
Find a program-derived address and its bump seed.
verify_pda
Verify that an account’s address matches a PDA derived from the given seeds.
verify_pda_address
Verify that expected is the address the PDA hash of seeds (bump included) yields under program_id: one sol_sha256 (about 150 CU), no create_program_address syscall (1,500 CU) and no curve check.
verify_pda_address_checked
verify_pda_address with the full create_program_address syscall, so an address whose hash lands on the ed25519 curve is refused.
verify_pda_address_cold
verify_pda_address kept out of line.
verify_pda_from_stored_bump
Verify a PDA using the bump stored in account data (cheapest path).
verify_pda_strict
Verify that a raw address matches a PDA derived from the given seeds.
verify_pda_with_bump
Verify a PDA with an explicit bump seed appended to the seeds.