#[snarfed]surprisingly Nostr of all things may be a good example of doing this right, especially the relay query protocol. feels like it allows just enough power and complexity, while still carefully not expecting any particular underlying implementation