CodeChain-io / CodeChain-io/foundry

Add new error types for signatures and public keys

Offen
#200 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bls refactoring
Vorherrschende Sprache
Rust
Sterne
36
Forks
11
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Lesen der Behandlung von RLP DecoderError und der Decodierungspfade für Signaturen und öffentliche Schlüssel. Sieh dir das Beispiel SchnorrSignature und die Anforderungen an die Gültigkeit elliptischer Kurvenpunkte an. Als abgeschlossen gilt die Aufgabe, wenn die neuen Fehlertypen und das Decodierungsverhalten für ungültige Punkte konsistent definiert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
blockchain, cryptography
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.