See the comment above about Freenet, which does something like this; although according to https://freenetproject.org/pages/documentation.html#content it seems to prioritise popular files rather than rare ones.
IIRC eDonkey prioritised rare files, although I don't know if this was a property of the network or just a common choice in clients.