ChainAgnostic / varsig

The cryptographic signature multifomat
Other
9 stars 4 forks source link

Add test vectors for JWS and Eip712 #13

Open oed opened 6 months ago

oed commented 6 months ago

This PR adds two test vector CAR files for JWS and eip712 varsigs. The content of these files can be explored through the https://explore.ipld.io/ interface.

The encoding follows this general format: image

Specifically for eip712 and secp256k1 signatures this format is used: image

oed commented 6 months ago

Either in this PR or one to follow, we should include a /test-vectors/README.md that explains to inspect with explore.ipld.io. (Also possibly worth noting that explore.ipld.io wouldn't let me upload the CAR files without modifying the file extension. Seems odd).

Good point. I can update this PR! Strange it doesn't let you upload, it definitely works for me. What do you need to change the extension to? It should already be *.car.

...it says "codec optional". How does that get signalled? Is there a one-bit flag or similar?

I think this is supposed to depend on the key codec, the key type would basically dictate if it's needed or not. But in our test cases we actually include it for all key codecs.

My understanding (please correct me) about what we need to update in the spec to support this is:

Yes, the spec needs to be updated in a few places. I will follow up on that as soon as I have some spare cycles.