Currently "registered types" are done via prefixing the (proto) encoded struct bytes with its "prefix bytes" as described in the Readme.
An alternative we could consider is to use proto.Any:
Basically we would use the type URL to differentiate between the actual send bytes.
Pros:
- full proto compatibility
- more human readable (as URL is string based; basically as the amino name)
Cons:
- type URLs could be long(er than current prefixes)
Update: The discussion (here and on slack) evolved quite a bit. It could be worthwhile to write our own proto wrapper for any registered type and keep the prefix bytes instead of a string based URL scheme (like proto.Any).
Here I summarize pros/cons of both approaches:
proto.Any
Pros:
- developers might already be familiar with the concept
- proto implementations provide some tooling around proto.Any
- messages contain a human readable/understandable identifier (the type URL)
Cons
- additional overhead of adding a (non size limited) string to the proto encoding (type URL)
our own proto message / BytePrefixedAny
Pros:
- closer to the existing amino library (we can keep the prefix/disfix logic)
- byte prefix / disfix are shorter -> less load on the wire or when storing
Cons:
- people need to understand how prefix/disamb bytes are computed (we need to provide guidance and implementations)
- slightly more computation when computing prefix
- less human parseable
to be continued
Currently "registered types" are done via prefixing the (proto) encoded struct bytes with its "prefix bytes" as described in the Readme.
An alternative we could consider is to use proto.Any:
Basically we would use the type URL to differentiate between the actual send bytes.
Pros:
Cons:
Update: The discussion (here and on slack) evolved quite a bit. It could be worthwhile to write our own proto wrapper for any registered type and keep the prefix bytes instead of a string based URL scheme (like proto.Any).
Here I summarize pros/cons of both approaches:
proto.Any
Pros:
Cons
our own proto message / BytePrefixedAny
Pros:
Cons:
to be continued