CodeChain-io / CodeChain-io/foundry
Add new error types for signatures and public keys
- Lingua principale
- Rust
- Stelle
- 36
- Fork
- 11
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia leggendo la gestione di RLP DecoderError e i percorsi di decodifica per firme e chiavi pubbliche. Esamina l'esempio SchnorrSignature e i requisiti di validità dei punti della curva ellittica. Il lavoro è completato quando i nuovi tipi di errore e il comportamento di decodifica per i punti non validi sono definiti in modo coerente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- blockchain, cryptography
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 30/100