With the basic version we don't care about the key generated for the account. For example we just spawn some account like this:
let a: PublicKey = new Keypair().publicKey;
let params: CreateAccountParams = {
fromPubkey: wallet.payer.publicKey,
newAccountPubkey: a,
lamports: 9999,
space: 500,
programId: program.programId
};
We can't recover this account if we don't have access to the original key that we made. Usually we don't care about this because you can easily look up the account on-chain, or you've already stored it somewhere.
The seed version requires you to create a base pubkey. You can use PublicKey.createWithSeed()
to derive a key for your account given that base key. This means that now if you have have the seed_key
and the seed string, you can easily derive the account's address.
let seed_key: PublicKey = new Keypair().publicKey;
let b = await PublicKey.createWithSeed(seed_key, "cake", program.programId);
let seedParams: CreateAccountWithSeedParams = {
fromPubkey: wallet.payer.publicKey,
newAccountPubkey: b,
lamports: 9999,
space: 500,
programId: program.programId,
basePubkey: seed_key,
seed: "cake"
};
So let's say you want others to come use your program and write bots on it or something. So they can easily find various accounts your program uses, you might share the seed_key
and the seed strings.