3

According to the docs, a Solana address is one of the following:

  • an ed25519 public key
  • a program-derived account address (32byte value forced off the ed25519 curve)
  • a hash of an ed25519 public key with a 32 character string

The first 2 of these I've encountered numerous times, but I can't recall ever (knowingly) running into the third variation. Where is this used and what use case does supporting this type of address serve that user accounts and PDAs don't? I suppose they can be both on- and off-curve, but I don't really see any reason why you'd want that.

1
  • I think it might only be relevant when generating signatures , but it’s good question. Not sure. Commented Jan 28 at 18:44

1 Answer 1

4

That last one is more of a legacy use-case. Before there was the concept of program-derived addresses, many of the native programs allowed you to use addresses that were strings hashed with the signing pubkey.

You'll see most of these instructions contain *_with_seed somewhere, like create_account_with_seed https://github.com/solana-labs/solana/blob/b3ea62fba31767fae75238a714081ab924cc6fbc/sdk/program/src/system_instruction.rs#L461

And these keys are created using Pubkey::create_with_seed https://github.com/solana-labs/solana/blob/b3ea62fba31767fae75238a714081ab924cc6fbc/sdk/program/src/pubkey.rs#L211

It would probably be better to deprecate these and use PDAs instead, but it's not too pressing an issue.

1
  • That clears things up, thank you Jon!
    – McBain
    Commented Jan 31 at 15:36

Your Answer

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

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