rust-multiaddr icon indicating copy to clipboard operation
rust-multiaddr copied to clipboard

Consider an inline representation for small multiaddrs

Open rklaehn opened this issue 5 years ago • 0 comments

Similar to https://github.com/multiformats/rust-multihash/pull/47

Using the same approach, for a total size of 64 bytes, you get 62 bytes of data. That is enough to store a multiaddr like /ip4/<32 bit addr>/tcp/<port>/ipfs/<256 bit node hash> or even /ip6/<128 bit addr>/tcp/<port>/ipfs/<256 bit node hash> inline, which should be quite useful.

Rust-libp2p nodes frequently store peer ids multiple times, so this would be a nice optimisation.

rklaehn avatar Feb 17 '20 19:02 rklaehn