Hello

@Serializable
@SerialName(value = "hello")
data class Hello(val displayName: String, val sessionId: String, val deviceId: String? = null, val targetRoom: String? = null, val protocolVersion: Int? = null, val key: DidKey? = null, val joinerNonce: ByteArray? = null) : AdmitMessage

Sent by a joiner to the host immediately after transport connection.

displayName — human-readable display name. sessionId — joiner-minted session identifier (UUID-style). deviceId — the app's own id for this device, optional. The joiner's device key signs it into its Proof (v4, #3211), and the host records it as the member's MemberIdentity.deviceId. It does not recognise a returning member: the device key does, through the host's key → seat table (#3159). targetRoom — the host us.tractat.kuilt.core.Pattern.roomKey this joiner intends to enter, from us.tractat.kuilt.core.Tag.roomKey. null (the default) means the transport already bound the room, so the host admits without comparing; a non-null value that mismatches the host's own room key is rejected. Nullable + defaulted so it is wire-safe: an older build that never sends it decodes as null (see the shared cbor codec's ignoreUnknownKeys), and an old encoded frame with no targetRoom key still decodes to null. protocolVersion — the admit-handshake version this joiner speaks (ProtocolVersion.CURRENT). The host compares it against its supported range and rejects a mismatch at admit time with RejectCode.ProtocolMismatch (#1569). Additive, exactly like targetRoom: nullable + defaulted, so a peer that predates the field decodes as null (kotlinx omits the defaulted null, so a version-less Hello is byte-identical to the pre-#1569 wire form). Since v2 the host refuses that null with RejectCode.ProtocolMismatch rather than admitting it as legacy (ProtocolVersion). key — the joiner's device key, from its us.tractat.kuilt.identity.DeviceKeyStore (v3, #3210). The joiner proves it holds the key by answering the host's Challenge with a Proof (v4, #3211). joinerNonce — JOINER_NONCE_SIZE fresh random bytes, drawn for every Hello (v3, #3210). The host's signed Challenge will echo it, which is what makes each answer single-use. Its width is checked here, in the constructor, so a wrong-width nonce is refused on every decode path and a decode of one returns null.

key and joinerNonce are nullable on the wire, though a v3 Hello must carry both. A v2 Hello has neither. Were they required, a v2 Hello would fail to decode, decode would drop it as malformed, and the version gate — which needs a decoded Hello to read protocolVersion from — would never answer: the v2 joiner would wait out its admit deadline instead of hearing RejectCode.ProtocolMismatch. So the requirement is the host's, enforced next to the version gate, and a v3 Hello missing either is refused with that same code.

Constructors

Link copied to clipboard
constructor(displayName: String, sessionId: String, deviceId: String? = null, targetRoom: String? = null, protocolVersion: Int? = null, key: DidKey? = null, joinerNonce: ByteArray? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val key: DidKey?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares joinerNonce by content: a decoded Hello equals the one that was encoded.

Link copied to clipboard
open override fun hashCode(): Int