Nostrocket actually uses this for the relay too; you have to be in the identity tree to write to the relay, just like this example by fiatjaf. The difference is that instead of storing the list of allowed pubkeys in a local file, nostrocket stores them as events so that it can can use dynamic sets of relays that any participant can run.