I want to create an anchor PDA using the following logic:
seeds = [
b"some-text",
user.key().as_ref(),
Vec<Pubkey>,
bool
]
Is this possible? The array of pubkeys are variable in length.
If it doesn't work outright for the vector of pubkeys, one idea I had was to hash the vector of pubkeys together to produce a string in a deterministic manner.
e.g. something like:
function hashSortedConcatenatedPublicKeys(publicKeys):
sortedKeys = sort(publicKeys)
concatenatedKeys = ''.join(sortedKeys)
hashOfConcatenatedKeys = sha256(concatenatedKeys)
return hashOfConcatenatedKeys
The goal is to create a unique PDA for a group of addresses so if you think there are other methods of doing this let me know!