Here we directly use the authorPublicKey, but it should be matched:
await transaction.spaceKeyBox.createMany({
data: keyBoxes.map((keyBox) => ({
id: `${keyBox.id}-${inviteeAccountId}`,
nonce: keyBox.nonce,
ciphertext: keyBox.ciphertext,
accountId: inviteeAccountId,
authorPublicKey: keyBox.authorPublicKey,
spaceKeyId: keyBox.id,
})),
});