Repository navigation
Description
Problem
The spec gives one reason for shared-PSK records. They are "Convenient for storage-constrained clients".
The spec does not identify the device. It gives no slot count and no hardware type. But the cost is high: a second security model, and special rules in three files.
Affected sections
- connection.md, Pre-Shared Key. The two storage models. One sentence can replace them.
- management.md, Records. The two record types. The field
server_id?becomes mandatory inlist-recordsandadd-record. Remove the reference constraint inremove-record. - management.md, Record mode. The full section, and its fields in
get-pairing-configandset-pairing-config. Without shared-PSK records this section has no function. - messaging.md,
server/unpair. The exception "the client MUST NOT remove it". - management.md, Storage accounting. The field
cost_shared. Remove the full section, see below.
The change removes approximately 25 to 30 lines. Storage accounting removes 15 more lines.
Recommendation: remove shared-PSK records
The security improves. The shared model is the weaker model. The server sends its server_id, and the client accepts the value without a check. More than one server can also use the same PSK.
The device is not identified. A record needs approximately 64 bytes of key material. A client with less memory than this, in a house with many servers, is only a possibility.
The complexity is too high. One fallback procedure adds seven different rules.
Necessary related change
Today the shared-PSK record is the fallback when the client storage is full. If you remove the fallback, the spec does not define this condition.
Today pair/abort has no reason for full storage. The server also stores its record before the client stores its record. Thus a silent failure gives the server a record that the client does not have.
Make this change: the client must examine its storage before it sends client/pair-finalize. If the storage is full, the client sends pair/abort with a new reason storage_exhausted. This adds two lines to pairing.md.
Storage accounting
Remove this section in all conditions. The spec already says that "storage_exhausted however stays authoritative". The spec also defines the behavior when the client does not send the storage key.
Thus the four values give no necessary data. Remove the field storage? from management/result at the same time.
This is also the safe alternative if shared-PSK records stay. The server loses only a capacity indication.
Effect on function
The change removes a function. Today a client with full storage can pair with more servers through one shared record. After the change, the operator must first remove a record.
Compatibility
The change breaks compatibility. It affects clients with a factory-installed shared record. It also affects servers that read record_mode or storage.
The client must ignore an existing shared record, or change it to a stored-pubkey record.
Note for #143: this change makes the rename of cost_individual unnecessary.
Activity
arturpragacz commentedon Aug 18, 2026
Thanks for the posted issue, but I decidedly don't think we should change this. The shared-fallback model is a deliberate design choice, and the case for it is stronger than the single sentence in
connection.mdsuggests.The main reason is UX. Without the fallback, pairing against a client with full storage is a dead end: the server hitting the error has no user trust, so it cannot remove records itself. The operator would have to find another already paired server that exposes record management, or factory reset the client. With the fallback, pairing always succeeds and the user never has to think about client-side record storage at all. That property is worth far more than a few lines of spec.
Storage-constrained clients are also a real target, not a hypothetical. Repurposed microcontrollers are exactly the kind of devices we want as clients, and homes running many servers are more, not less, likely to have a few of those around.
The cost is much lower than the issue suggests. The handshake is structured so that all PSK categories run the same KKpsk2 path; the only difference for shared records is skipping the server_id post-match check. So there is no second security model in the implementation, just a second record kind in storage, which is trivial and not crypto-critical. On the security delta itself: the shared PSK is client-specific and random, it only ends up on servers the user deliberately paired, and abusing it requires compromising one of those servers, which already holds user trust. In a home threat model that is not critical.
Storage accounting exists to serve exactly these bounded-storage clients, so it stays consistent with the above, and it is optional on the wire for anyone who ignores it. With the record model unchanged, the proposed pair/abort change also isn't needed.
Where I think we could potentially change something: the spec does not give all the arguments for this design currently, we could add those. But on the other hand the spec's job is to describe the protocol, not give all the rationale behind it.
balloob commentedon Aug 31, 2026
The dead-end is resolved in #182 by allowing a max of 5 connections and leaving eviction strategy to the client.
balloob commentedon Sep 2, 2026
Fixed in #183