Why does libp2p TCP example automatically listening on ipfs multiaddr?

I spun up the example for transports and I noticed that they are all listening on /ipfs.

I’m very curious what the significance there is. ip4 is obviously the addressing protocol, then tcp declares that it is on a TCP connection on the respective port.

But what does /ipfs mean?
Is there an API to change that?

The /ipfs/Qm... tells us that we’re connecting to the peer with the peer ID Qm.... We use the protocol name /ipfs/ because IPFS came before libp2p (libp2p was extracted from IPFS).

We’re in the process of changing this to /p2p. In the future, addresses will look like:

  • /ip4/
  • /ip4/
  • etc…

Note: we need to know the peer ID for security. The peer ID is actually the hash of the remote peer’s public key and allows us to setup an encrypted, authenticated connection.