Why do you need to worry if the data has been tampered with, the user can only hurt themselves.
If you need access to the users data then you will need to run your own server anyways, so you deal with the trust problem as any other web application does.
>I admit I'm not even sure how bittorrent make sures the other "bits" are valid...
Each peer has a sha1 hash of each peice.
>p2p-storage.js... Maybe webtorrent.min.js is what you're looking for.
Another side idea that comes with this is something like IPFS or even torrent, where bits of the file storage are stored on individual nodes but incapable of meaningful data unless put together with other bits of data from other nodes.
I admit I'm not even sure how bittorrent make sures the other "bits" are valid, would love to know if there is some p2p-storage.js you could drop on your webpage