If I am using the Native Ed25519 Program to verify a message signature, I will need to add the pre instruction that will contain signature, message and public key to verify. In my custom program, I will be checking if this instruction existed in the instruction list and verify the message integrity. However if I want to prevent the replay of this signature, I need some nonce in the signature that will make the message unique and invalid after first usage.
As I understand if we want to implement this, it would mean creating and maintaining an account by paying minimum rent. This PDA account will store the unused nonces of a user or a last used nonce or the next usable nonce or any such information can be used to check the uniqueness of a signature. However if I need to verify signatures of several users, I will have to create the accounts for all of them.
Is this the only way I can protect agains signature replay? Are there any better ways of doing this?
If my transaction is a durable nonce instruction can I access the block-hash that was used somehow and implement replay protection? Note that, I may not be able to use latest block-hash as the signature to be verified might be generated ahead of time. However durable nonce's block-hash can be used at it will be same until consumed.