CodeChain-io / CodeChain-io/foundry

Add new error types for signatures and public keys

Open
#200 4 comments 0 reactions 0 assignees View on GitHub
bls refactoring
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.