Closed CantTouchDis closed 7 months ago
I am sorry for opening the Issue. I figured it out. For other ppl having the same issue:
I was missing the part in the CIP where they mentioned they sign a structure in a different format... Therefore instead of passing payload to verify we need to pass data to verify which is constructed as follows:
let data = serde_cbor::to_vec(&serde_cbor::Value::Array(vec![
serde_cbor::Value::Text("Signature1".to_string()),
cose_sig.get(0).unwrap().clone(),
serde_cbor::Value::Bytes(vec![]),
cose_sig.get(2).unwrap().clone(),
])).unwrap();
assert!(pub_key.verify(&data, &signature));
println!("we made it!");
Hi,
I think I have encountered an issue when verifying a signature, or I might've just misunderstood the process of verifying a signature created by a CIP30 wallets
signData
. I don't quite understand why the verification fails.cose_key
andcose_sig
were both returned by usingsignData
with Nami,Hashing the pub key also returns the same Ed25519KeyHash as contained in the attached address.
Could you please clarify if I used the verify function correctly or if I encountered a bug?
For this example I was using version 4.2 but it also happened on 5.1
Minimal code example:
Output: