Multiaddr grammar

In simple case Multiaddr looks similar to /ip4/ It is easily parseable - /{key}/{value/{key}/{value}.

But I found this example:


It makes Mulriaddr needing some sort of formal grammar specification (BNF?). Is there one? If no, do you think Multiaddr should support this?

Yes, we definitely should, but a BNF is not going to be enough, as the kinds of addresses the http protocol requires include slashes in their string representation, which creates ambiguity when parsing multiaddrs. Some background here: