What you want is not a viable method for protecting anything, even if you could get a particular P2P program to work this way.
If you're dealing with a file format that you don't control (images, video files, etc), then your metadata ID would have to be part of that format. Which means it would be trivial to edit it.
If you establish a file format (along with the various apps needed to then use this file), then it would not be difficult for people to de-process the format and figure out where your ID is stored. You can try to use a checksum or something to ensure that the ID is unchanged, but this too is pretty easy to get around.
If you go for full-on encryption of the data and the ID... well, some program on the user's hardware is going to have to be able to decrypt it. Which means they can snatch the decrypted data right out of memory sans ID. You can use clever techniques to make this easier or harder on the user, but ultimately, so long as enough people have a desire to break your code, they will.
Also, doing P2P with fully encrypted data would be painful for all of the peers in terms of drive space. Since the ID would be folded into the encrypted portion of the data, to be able to send your copy of the data to a peer, you have to have a version of the data that is identified for that peer. Which means that, for each identified peer that you "share" with, you're going to have to basically have a separate copy of the data tailored to their ID.
I don't think people will want to do that.
This is why, when you see people doing things like this, they will put identifying info in the datastream itself. There have been attempts to track down leakers by placing small, barely audible modulations in a sound stream that uniquely identify where it came from. Or they'll use special bugs in the corner of video streams. Or whatever. And even then, they won't do it on a per-peer basis; they'll do it to the list of "trusted" agents who aren't supposed to leak the information. The goal is not to track down every person who shared it; it's to find the origin of the leak.