I had this idea a couple of months back, and wanted to gather comments from the public.
In order to have an open internet, we need an open standard of interfaces to build around. The goal of this design is to have a repository of such interfaces.
Each interface would have a purpose and a name (and documentation). For example, we are in the process of reworking the wallet canister, and it requires a callback to an API endpoint of your canister. Therefore, we need a DID that people can use to verify that their canister is compatible with that endpoint (and its signature). Since DID signatures are also covariant, we can version those DIDs with backward compatible changes and versioning.
Since DID services are a flat namespace, I am going to suggest the following;
- the name of the interface must be alphanumeric, but starts with a letter and follow camelCase. e.g.
assets
ormanagementCanister
- every function exported by the service should have the name of the interface (as a namespace), followed by
_
, then by the name of the method using camelCase, e.g.wallet_createCanister
. - if a breaking change must happen, a new interface needs to be created. It is suggested to simply append a major version number at the end of the existing interface name (e.g.
assets2
). - To avoid breaking changes as much as possible, the interface should follow the best practice of receiving a record with optional fields and return a single record with potentially optional fields.
- A repository of those DID files would be kept up to date, accept PRs and make tests (to ensure DID can build), and maybe publish documentation in some way.
What do you think?