CodeChain-io / CodeChain-io/foundry
Add new error types for signatures and public keys
- Dominant language
- Rust
- Stars
- 36
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Currently, all signatures and public keys are just wrapper structs of bytes.
For better performance and consistency, they should be wrappers of some types representing points in elliptic curves.
Verifying that a signature instance refers to a valid point in an elliptic curve should be done at the moment of decoding, not at the moment of signature verification.
For example, Schnorr signature defined as `pub struct SchnorrSignature([u8; 64]);` should be changed to `pub struct SchnorrSignature(G1)`.
I believe we need a different way to handle decoding errors. i.e. decoding of signatures and public keys should fail if the RLP representation is correct, but the decoded bytes do not refer to a valid point in the elliptic curve.
Currently, RLP DecoderError does not support such invalidity.
Do you have any nice idea to handle this error?
Contributor guide
Assessment
This issue has not been assessed yet.