traits
traits copied to clipboard
Add error/keypair modules and documentation for VRF crate (based on #1794)
Summary
This pull request adds the following to the draft proposed by @carloskiki in #1794 to the issue [#1728]:
- Error Module: Introduced a dedicated error type and improved error handling for VRF operations.
- Keypair Module: Added a keypair structure to encapsulate private/public keys more cleanly.
- Documentation: Wrote additional comments and high-level documentation explaining how to use the VRF traits and keypair functions.
Notes
- All commits from #1794 are included, retaining the original authorship by @carloskiki.
signature already contains the Keypair and KeypairRef traits, I don't think we should duplicate them.
I am not in favor of having an error type. Proving, verifying and hashing are all defined as infallible in RFC9381. Except for ECVRF proof to hash, where it can fail because of proof string deserialization. This is not a concern for us because we implement Proof for a concrete type that is already deserialized. I understand that signature does have an error type so if someone is able to prove any benefit of having it then I am fine with it.