You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently digging into the precise cause, but it seems like the something in Credential/Presentation's impl of to_dataset_for_signing is not correctly forming the dataset when this arbitrary_precision feature is enabled in the serde_json crate. The arbitrary_precision feature causes numbers to be stored as strings, so perhaps to_dataset_for_signing is incorrectly canonicalizing numbers as strings.
The specific error returned by Credential::verify / Presentation::verify is "Verification equation was not satisfied" if ed25519-dalek is used, and "ring::error::Unspecified" if ring is used.
The text was updated successfully, but these errors were encountered:
Ok, it looks like the call let json = ssi_json_ld::syntax::to_value_with(copy, Default::default).unwrap(); in Credential::to_dataset_for_signing is where it goes wrong.
Comparison of the json variable when serde_json/arbitrary_precision feature is not enabled and when it is enabled:
When it is not enabled (irrelevant detail truncated):
So it looks like because ssi_json_ld::syntax::to_value_with calls serde::Serialize, it's inheriting the problem described here. I'm not very familiar with how serde Serializers are implemented, but perhaps it's possible to somehow specify special behavior for "$serde_json::private::Number".
Unfortunately I'm not able to disable the arbitrary_precision feature, since it's buried my dependency on the ethers-rs crate. But ideally that crate would avoid using the arbitrary_precision flag.
I'm currently digging into the precise cause, but it seems like the something in Credential/Presentation's impl of
to_dataset_for_signing
is not correctly forming the dataset when this arbitrary_precision feature is enabled in the serde_json crate. The arbitrary_precision feature causes numbers to be stored as strings, so perhaps to_dataset_for_signing is incorrectly canonicalizing numbers as strings.The specific error returned by Credential::verify / Presentation::verify is
"Verification equation was not satisfied"
if ed25519-dalek is used, and"ring::error::Unspecified"
if ring is used.The text was updated successfully, but these errors were encountered: