Storing the sidecar next to the file would help in many cases, but it doesn’t always work – the app may not be able to write to the directory, for example. So, at the very least, there needs to be a fallback that uses the sandbox. But in the fallback case, because two original files can have the same name (from different folders), the app would need to give each sandbox file some kind of unique specifier. As a simplification, I ended up storing all the sidecars in the sandbox. The “hex data” is the unique specifier – because of how it’s constructed, the app can connect the sidecar to the original even if the files move.
BTW: even if the sidecars were next to the originals, you would still have a problem. The connection between sidecar and original would be broken once you renamed the originals [unless, of course, you renamed the original and sidecar together].