1

In the solana developer docs for PDAs

I think this like might be a little misleading

If this occurs a different set of seeds or a seed bump (additional 8 bit seed) can be used to find a valid program address off the curve.

Does this mean that Solana could fail to find your PDA after the bump is nudged all the way from 255 to 0?

When this happens will the function find_program_address prompt you to use different seeds or will it do it for you?

2 Answers 2

1

i'm pretty sure it won't change de seeds for you because you need to know the seeds in order to be able to find again the pda with the same seeds you used.

my guess is it would fail, but i think the best way is to try it :) (trying to create 257 PDAs with same seeds..)

1

It's technically possible that all address derivations will fail for the possible bump seeds, from 255 to 1. This is extremely unlikely, since there's about a 1 in 2^255 chance of no bump seed working.

The Rust version will panic if no good ones are found, so you can use try_find_program_address instead to recover.

Here's the source code explaining the panic case and how to recover using Pubkey::try_find_program_address: https://github.com/solana-labs/solana/blob/634eede841ccfa1cb45ef235cc7494ebbbf1d6bd/sdk/program/src/pubkey.rs#L285-L295

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.