@@ -337,6 +337,30 @@ rule Probe_Host_Token_Mismatch:
337337 ]->
338338 [ ]
339339
340+
341+ // Open-community AUTH auto-registration. A community with no NIP-43 member
342+ // pubkey allowlist admits any authenticated npub, but still only into the
343+ // community resolved from the connection host. This is a separate admission
344+ // source from NIP-43 member-list signing: NIP-43 admissions emit
345+ // `MemberAdmitted`; open AUTH emits `OpenCommunityAutoRegistered`. Both mint the
346+ // same downstream `!Admitted(pk, comm)` fact, so later read/write checks stay
347+ // literal admission checks rather than read-path carve-outs.
348+ rule Mark_Open_Community:
349+ [ !Community(comm) ]
350+ --[
351+ OpenCommunityEnabled(comm)
352+ ]->
353+ [ !OpenCommunity(comm) ]
354+
355+ rule Authenticate_To_Open_Community:
356+ [ !ClientPublic(pk), !HostCommunity(host, comm), !OpenCommunity(comm) ]
357+ --[
358+ OpenCommunityAutoRegistered(pk, comm, host),
359+ HostBoundFor(host, comm),
360+ OpenRegistrationResolved(pk, comm, host, comm)
361+ ]->
362+ [ !Admitted(pk, comm) ]
363+
340364// ============================================================================
341365// Per-community signing keys
342366// ============================================================================
@@ -567,6 +591,14 @@ lemma host_token_mismatch_not_authorized:
567591 HostTokenMismatchAttempt(tok, client, minted_comm, host_comm, host) @ i
568592 ==> not (Ex #j. ChannelLessAuthorized(tok, client, minted_comm, host) @ j)"
569593
594+ // Open-community auto-registration is host-confined: the registered community is
595+ // exactly the community bound to the connection host. There is no client-supplied
596+ // community selector in the rule.
597+ lemma open_auth_registration_confined_to_host_community:
598+ "All pk registered_comm host host_comm #i.
599+ OpenRegistrationResolved(pk, registered_comm, host, host_comm) @ i
600+ ==> registered_comm = host_comm"
601+
570602// S2: every minted token has exactly one stamped community, and every requested
571603// channel recorded for that mint resolved to that stamp.
572604lemma minted_token_channels_match_stamp:
@@ -709,4 +741,8 @@ lemma executable_member_admitted:
709741 exists-trace
710742 "Ex pk comm #i. MemberAdmitted(pk, comm) @ i"
711743
744+ lemma executable_open_auth_registration:
745+ exists-trace
746+ "Ex pk comm host #i. OpenCommunityAutoRegistered(pk, comm, host) @ i"
747+
712748end
0 commit comments