The idea here is instead of SignKeypair and SignKeypairSignature we have
AlphaKeypair/AlphaKeypairSignature
PolicyKeypair/PolicyKeypairSignature
PublishKeypair/PublishKeypairSignature
RootKeypair/RootKeypairSignature
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.
The idea here is instead of
SignKeypair
andSignKeypairSignature
we haveAlphaKeypair
/AlphaKeypairSignature
PolicyKeypair
/PolicyKeypairSignature
PublishKeypair
/PublishKeypairSignature
RootKeypair
/RootKeypairSignature
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.