Expand description
Hopper-owned PDA ergonomics on top of the native runtime boundary.
Constants§
- MAX_
SEED_ LEN - The longest seed of an address (
MAX_SEED_LEN).
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.
- create_
with_ seed - The address the System Program’s
*WithSeedinstructions derive frombase,seed, andowner:sha256(base, seed, owner), the same value asPubkey::create_with_seed. Onesol_sha256on chain. - 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
seedshash toexpected, searching from 255 down with onesol_sha256per candidate and no curve check (about 150 CU per candidate instead of about 310). ReturnsInvalidSeedswhen no bump matches. Same soundness condition asverify_pda_address: use it only whenexpectedis bound to a program-owned or about-to-be created account; otherwisefind_canonical_bump_checked. - find_
canonical_ bump_ checked - The canonical bump for
seeds, found with the curve check on every candidate, provided the canonical address equalsexpected. - find_
program_ address - Find a program-derived address and its bump seed.
- find_
program_ address_ const - The canonical program-derived address of
seedsunderprogram_idand its bump, found at compile time. The seeds may be anyconstexpressions. Seehopper_native::pda::find_program_address_const. - try_
find_ program_ address - Find the canonical address and bump without panicking on invalid seeds.
- verify_
address_ with_ seed - Check that
expectedis the addresscreate_with_seedderives frombase,seed, andowner;InvalidSeedswhen it is not. - verify_
pda - Verify that an account’s address matches a PDA derived from the given seeds.
- verify_
pda_ address - Verify that
expectedis the address the PDA hash ofseeds(bump included) yields underprogram_id: onesol_sha256(about 150 CU), nocreate_program_addresssyscall (1,500 CU) and no curve check. - verify_
pda_ address_ checked verify_pda_addresswith the fullcreate_program_addresssyscall, so an address whose hash lands on the ed25519 curve is refused.- verify_
pda_ address_ cold verify_pda_addresskept 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.