I'm having some trouble to understand how am I supposed to verify if a signed data was really signed by a specific address.
Checking this CBOR
845846A201276761646472657373583900E922E8166852073D6C1C9BE0736530404C9C26D9BA1773E11D32D11C0F7B2C7F8924528D797A8F86D8210D6276E09F47B82ECD53A24900E7A166686173686564F44B68656C6C6F20776F726C645840D1FCCD8B340A46FD9573FE6A0F6BFC8373562019E9FCD8BDFD7A7D08A89FE98BF28E6736BAE823C024C7B20081C6D30FC4676D2A314299F22CB0264EE7E6AB04
That I got from signing a "hello world" message payload:
[h'A201276761646472657373583900E922E8166852073D6C1C9BE0736530404C9C26D9BA1773E11D32D11C0F7B2C7F8924528D797A8F86D8210D6276E09F47B82ECD53A24900E7', {"hashed": false}, h'68656C6C6F20776F726C64', h'D1FCCD8B340A46FD9573FE6A0F6BFC8373562019E9FCD8BDFD7A7D08A89FE98BF28E6736BAE823C024C7B20081C6D30FC4676D2A314299F22CB0264EE7E6AB04']
I see that I have the address in the headers and I also have the ed25519 signature, but I'm not sure how am I supposed to determine the public key for this and I obviously don't have access to the secret at that point. I was trying something like:
import { eddsa } from "elliptic";
const EdDSA = new eddsa("ed25519");
const key = EdDSA.keyFromPublic(
? // what do I put here? Is there a way I can get the public key from the address hex?
);
const verifies = key.verify(
"hello world",
"D1FCCD8B340A46FD9573FE6A0F6BFC8373562019E9FCD8BDFD7A7D08A89FE98BF28E6736BAE823C024C7B20081C6D30FC4676D2A314299F22CB0264EE7E6AB04"
);
console.log("Valid:", verifies);
Thanks in advance for your time!