stamp-protocol / tracker

The place for all features, bugs, and discussions
https://stampid.net/
2 stars 0 forks source link

Create separate types for different keypairs/signatures #12

Closed orthecreedence closed 3 years ago

orthecreedence commented 3 years ago

The idea here is instead of SignKeypair and SignKeypairSignature we have

This could probably accomplished 95% with some kind of trait and a few newtypes.

The idea here is you have the type system enforce what kinds of signatures can be created by each key type, and where they are used in the identity. A SignKeypairSignature can be created by any kind of key, so it's not clear (without reading the "spec") where each signature comes from, and it allows making sloppy mistakes that would otherwise be easy to catch.

orthecreedence commented 3 years ago

Done.