I've got a CS problem: let's say you're writing a networked service that wants to allow clients to create posts. In a naive centralized system, you'd generate UUID4s (or maybe UUID7s, if you're nasty) on the back end. But, for idempotence, you really want the *client* to generate the IDs, so that it can safely resubmit any requests. But, clients, being clients, are untrusted, and you don't want malicious clients to be able to create ID collisions.

Is there a best practice for this scenario?

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/glyph/statuses/115562368868068555 on your instance and quote it. (Note that quoting is not supported in Mastodon.)