I'm using elliptic curve cryptography (curve25519 and ed25519) for key exchange and signing. The signing and key exchange keypairs are independent. I need two users to be able to verify each other's identity using their permanent ed25519 keys. One solution I came up with was to have each user generate a nonce, have the opposite user sign the nonce, and then we can verify the signature. The problem with this is that a malicious user may generate a nonce that reads "revoke this key" or something a user doesn't want to sign.
The second proposed solution is to have each user generate an ephemeral curve25519 exchange key that will only be used for this verification. We then have both users compute a shared secret, hash the shared secret, and sign the hash. This way, each user will most likely be signing some garbage data. Is this method of verification secure, and what is the accepted way of verifying someone owns a signing key?