Failure Modes
The DeRec protocol defines clear threshold-based guarantees. However, real-world systems encounter operational failures. This page describes common operational failure modes and their impact on recovery.
This section is conceptual. Normative behavior is defined in the Protocol Specification.
Helper Unavailability
One or more Helpers may be offline, unreachable, or non-responsive during recovery.
Impact:
Recovery succeeds if the subshares held by reachable Helpers ≥
t.Recovery fails if they sum to less than
t.This is an availability failure, not a security failure.
With every Helper at weight 1, the system tolerates up to
n - tunavailable Helpers; with weights, losing a heavier Helper costs more. See Threshold and availability model.
Helper Data Loss
A Helper may lose its stored share for a specific version due to storage corruption, operational error, or misconfiguration.
Impact:
If enough other valid shares exist (≥
t), recovery succeeds.If total valid shares across all Helpers drop below
t, recovery becomes permanently impossible.Mitigation:
Choose
nandtwith redundancy margin.Implement verification flows.
A Helper also deletes versions on the Owner's instruction. Each StoreShareRequestMessage names one keepVersion besides the version being shared, and the Helper deletes every other version it holds on that channel, so it holds at most two. If the Owner's share store returns a version that never reached threshold, the last committed version is deleted from every Helper that stores the new one; if the new round then fails too, no version may remain recoverable. Return the newest version whose SharingComplete reported threshold_met, or 0 before any did. See Version retention.
Share Corruption
A Helper may answer with an OK status but a share that cannot be part of the recovered Secret — through storage or transport damage, or because the Helper is compromised.
Detection:
On arrival. A share that is missing, undecodable, bound to another secret or version, or bigger than this device's own configured
maxShareSizeand rejected before being parsed at all, is reported asRecoveryShareCorruptedwith reasonMalformed; one whose Merkle proof does not open to its own commitment root, with reasonInvalidProof. Since 0.0.9 that includes a forged share built from an internal node of the commitment tree, which used to pass verification and fail reconstruction without naming the Helper.At reconstruction. Valid shares are grouped by commitment root and ciphertext and the largest group is tried first, ties going to the group whose first share arrived earliest; a group of one is never tried. The first group that decrypts wins. Each Helper whose share fell outside it is reported once as
RecoveryShareCorruptedwith reasonInconsistent, alongsideSecretRecovered.
Impact:
A corrupted share is never used and does not count towards
shares_received. It cannot block a recovery: reconstruction succeeds as soon astconsistent shares are in.Reconstruction fails only if corruption leaves fewer than
tconsistent shares.RecoveryShareErroris not a corruption signal. It means the rebuilt bytes did not decode as a Secret.
Corrupted shares do not compromise security but may reduce availability. An honest Helper never sends one, so the application may treat RecoveryShareCorrupted as a reason to offer unpairing that Helper. See RecoveryShareCorrupted.
Threshold Misconfiguration
Improper selection of n and t weakens either availability or security.
Examples:
ttoo low → easier collusionttoo high → fragile recovery
This is an operational risk rather than a protocol flaw.
t and the Helper weights are recorded and reused, so a change to either has lasting effects:
A publish that drops the weights. The
weightsmap onProtectSecretis the full assignment, so a publish that leaves weighted Helpers out resets them to1. Their total can fall belowt: no split runs, no Helper receives anything, and the version still advances. See Below the threshold.A
tat or below a stored weight. Every publish, including the ones the library starts after a pairing or a fingerprint confirmation, fails withInvalidWeightand sends nothing until aProtectSecretwith valid weights publishes.Too many subshares. Recovery cost grows quadratically with the total subshares; cap it with
with_max_subshares.
Collusion at or above Threshold
If t or more Helpers collude and combine their shares independently of the Owner, reconstruction of the Secret becomes possible.
Impact:
The Secret can be reconstructed directly from the colluding shares.
Security therefore relies on Helper independence.
Compromised Owner or Replica During Recovery
If any device under the Owner identity (the Owner or any paired Replica) is compromised during recovery:
The reconstructed Secret may be exposed.
The protocol does not separate Replicas from the Owner cryptographically and does not protect against a malicious or fully compromised device under the Owner identity.
Compromised Owner or Replica Before Protection
If any device under the Owner identity is compromised before share generation:
The Secret may already be exposed.
This scenario falls outside the protocol's threat model.
Network Failure
Network disruption during recovery may prevent communication with enough Helpers.
Impact:
Recovery temporarily fails if reachable Helpers <
t.
This does not weaken security guarantees and recovery may succeed once connectivity is restored.
Protocol Version Mismatch
Owner and Helper implementations may run different library releases or protocol versions.
The reference library stamps its protocol version on every outbound envelope but neither checks it on inbound messages nor negotiates it. A mismatch is therefore never detected as such; it surfaces as whatever the incompatible message causes:
A field the receiver does not know is ignored, as protobuf does; a field it needs and does not find fails validation, and the request is refused (reported to the receiving application as
RequestFailed) or, for a response or the pairing handshake,processreturns an error.Pairing may fail, for example on disjoint parameter ranges.
Recovery may be impossible if the recovering side cannot decode the recoverable payload's encoding.
Three 0.0.10 changes break interoperability with 0.0.9. Upgrade both sides together:
Pairing. The pairing messages carry a fingerprint commitment and nonce that a 0.0.9 peer neither sends nor checks, so a 0.0.9 peer and a 0.0.10 peer cannot complete a handshake. A pairing in progress during the upgrade must be started again; channels already paired keep working.
Retention.
StoreShareRequestMessage.keepListbecamekeepVersionon the same field number with a different type, so a 0.0.9 peer cannot decode it. Helpers now keep at most two versions; there is no keep-everything policy.Fingerprint comparison.
verify_fingerprintfails on a mismatch and revokes the pairing, where it used to returnfalse.
Two 0.0.9 changes break interoperability with 0.0.8:
Timestamps. A 0.0.8 peer stamps the inner message of its replies separately from the envelope, so a 0.0.9 peer ignores them as
MessageIgnoredwith reasonTimestampMismatch, and the flow they answer never completes. Upgrade both sides together.Share format. Shares made before 0.0.9 no longer decode, so a Helper still holding one cannot answer a recovery for that version. After upgrading, the Owner publishes a new version before relying on recovery. See Security advisories.
Interoperability between releases is managed through wire compatibility, documented per release. See Versioning.
Fingerprint Mismatch
The two users compare the fingerprints of a Pending channel and they differ: the two devices hold different channel keys, which is what a man-in-the-middle on the pairing produces. A mistyped comparison looks the same.
Impact:
verify_fingerprintfails withFingerprintMismatch(code17). ThePendingpairing is revoked: its records, its channel key and its pairing material are deleted, so the channel can never carry traffic, and comparing again fails because no key remains.Nothing was ever sent on the channel, since a
Pendingchannel is not a publish target and its inbound traffic is dropped.A channel already
Pairedis never touched by a comparison.
Mitigation:
Pair again, over an out-of-band channel the users trust. Treat a repeated mismatch as an attack on that channel.
Let the user re-enter a fingerprint before calling
verify_fingerprint; a single call is final.
A man-in-the-middle cannot make the fingerprints agree by searching: the contact creator commits to its nonce before the other side contributes to the channel key. A pair response whose nonce does not open that commitment fails process with FingerprintCommitmentMismatch (code 48) and no pairing completes. See Fingerprint cross-confirmation.
Helper Refusal to Participate
A Helper may decline a recovery request, or stay silent even if it still holds a share.
Impact:
An explicit refusal arrives as
RecoveryShareRefused { channel_id, version, status, memo }— for exampleUNKNOWN_SHARE_VERSIONfrom a Helper that holds no share for the requested version. Nothing is collected, no reconstruction is attempted, and recovery stays open for the other Helpers.A silent Helper is indistinguishable from an unavailable one.
Either way, recovery succeeds only if enough other Helpers respond to satisfy the threshold.
Verification behaves the same way: an explicit refusal arrives as ShareVerifyRejected, a wrong proof as ShareVerifyInvalid, silence as the absence of a response.
A Helper may also refuse to store a share or answer a challenge under its own limits: a share outside its configured size range (SIZE_LIMIT_EXCEEDED), or a refusal from its share store (TOO_FREQUENT, SIZE_LIMIT_EXCEEDED, REJECTED). The Owner sees ShareRejected or ShareVerifyRejected with that status. See Helper admission control.
Unanswered Failed Requests
Every request that arrives on an authenticated channel is answered exactly once, even when handling it fails. The failure is reported to the receiving application as RequestFailed. With auto_respond_on_failure on, the library sends the failure response itself. With it off (the default), nothing is sent: the event carries a PendingAction token of kind Failed, and the application answers by passing it to reject — the event's own status and memo send exactly what the library would have sent.
Impact:
A token nobody answers. The library never expires a pending action. A token the application drops leaves its sender waiting, and the sender's round or challenge eventually times out — indistinguishable, on the sender's side, from an unavailable peer.
A token answered twice. The library is stateless, so resolving each token once is the application's part. Rejecting the same token twice, or rejecting a copy of an action already accepted, sends a second response.
Mitigation: handle RequestFailed in every event loop, and either reject each token once or turn auto_respond_on_failure on.
Helper Set Change Without Reconfiguration
Helpers are removed or replaced without redistributing shares:
Impact:
Some shares may become inaccessible.
The effective number of available Helpers may decrease.
If the effective n becomes less than t, recovery becomes permanently impossible.
Proper Helper set changes require redistributing shares and typically creating a new secret version.
Replica Synchronization Failures
Replicas extend the Owner identity across multiple devices via the Secret synchronization mechanism. The following failures are specific to that mechanism.
Stale Replica
A Replica device may hold a Secret version older than the current one — for example, if the device was offline when newer versions were published, or if it was paired before the most recent change but has not yet received the sync.
Impact:
Reading the user-facing data from the stale Secret yields outdated information.
Driving recovery against Helpers using snapshotted addressing may fail or return shares for an older version if the Helper roster has been rotated since the snapshot was taken.
The Replica catches up on the next Secret sync round, or sooner by running ReplicaDiscovery, which asks every member which version it holds, pulls the newest, and concludes with ReplicaDiscoveryComplete. Nothing runs it automatically; the application chooses when (app start, a timer, a user action).
A Replica that publishes from a stale copy collides with the newer version the group already holds — see the next section.
Concurrent Writes from Different Replicas
Two Replicas may independently publish the same version of the Secret before either has seen the other's write. Each derives the next version from what it holds, so this needs no simultaneous edit: a member that was offline and publishes from a stale copy reaches the same conflict.
Impact:
Helper leg. The first write to arrive is stored. A second write at the same version with different content is refused with
VERSION_CONFLICT— nothing is overwritten and nothing is stored alongside. The losing writer seesShareRejected.Replica leg. A member compares an incoming copy with the version it holds. A different author at the same version is a conflict: the member keeps its own copy, writes nothing, refuses with
VERSION_CONFLICT, and emitsReplicaVersionConflictcarrying the incoming copy's fullsecret. An older copy is also refused withVERSION_CONFLICT. The publisher seesReplicaSyncRejected, and the member is counted as behind for that round.The protocol does not merge and does not retry. The application resolves the conflict and publishes the result once.
A partial round is the shape to watch for: some Helpers may have accepted the first writer's version before the second write arrived, leaving the Helper set split across two versions with neither necessarily above threshold. Publishing a fresh, uncontested version is what repairs it.
See What the application must do for the full resolution flow.
Helper Posing as a Replica Member
A paired Helper sends a body naming a group member in replicaId on its own channel: a GetShareResponse dressed as a catch-up, a StoreShareRequest carrying a copy of the Secret, an UnpairRequest naming a member, or an answer to a replica discovery.
Impact:
None on the stores. The member is not recorded on that channel, so the message is refused before any handler runs: a request settles as
RequestFailed, a response failsprocesswithInvalidInput. Nothing is hydrated, stored or flagged.
See Replica-group membership is bound to the channel.
Loss of a Replica Device
A Replica device may be lost, destroyed, or otherwise permanently unavailable.
Impact:
Other devices under the Owner identity continue to operate normally — the Secret is held in full by every remaining Replica.
The lost device's local Secret cache is unrecoverable but does not need to be: the same data lives on every other device under the identity.
If the application wants the lost device out of the group, any remaining member removes it with
UnpairReplica. Any member may remove any member, the source included, so a lost or stolen source is removable; the application should ask the user first.UnpairReplicaonly announces the removal. It completes when the application publishes a roster without the member — an ordinaryProtectSecret— andReplicaRemovedfires when that round completes. A group with nothing to publish cannot complete a removal.Removing the source promotes the first remaining member as successor (
ReplicaSourceChanged).A replacement device that recovered the Secret from the Helpers should join the group, not
restore, while another member is live: pair with that member and catch up. Joining adds it as a new member. A restored device cannot publish, or answer a catch-up, until it is configured with areplica_idthe roster names, and taking the lost device's id puts a second device in that member's role. Neither path gives the new device proofs of earlier versions; the remaining members keep theirs. See Restore or join after recovery.
See Replica removal.
Ignored Messages
process drops some inbound messages without acting on them: no store is written and nothing is sent back. Each drop is reported as MessageIgnored { channel_id, reason, trace_id }, so the sender learns nothing and a retry is always safe. A dropped message is not replayed later.
First push before fingerprint confirmation (PendingVerification)
A peer sent something on a channel this device has not yet confirmed — a Pending helper channel, or a Pending replica member. The typical case is a replica Source publishing its first copy while the Destination is still showing the fingerprint.
Impact:
The Destination holds nothing after confirming, and nothing arrives on its own: the Source already sent its copy.
Mitigation: once
verify_fingerprintsucceeds, a replica Destination startsReplicaDiscoveryto pull the copy from the group.
Timestamps that disagree (TimestampMismatch)
Every channel message carries one timestamp, in both the outer envelope and the encrypted inner message. After decrypting, the receiver ignores a message whose two timestamps differ, or where either is absent.
Impact:
The message never takes effect, and nothing is sent back.
The typical cause is a 0.0.8 peer, which stamps its replies separately. Upgrade both sides together.
Stale message (Expired)
The message is older than the inbound_message timeout — a store-and-forward hop, a device that was offline, or a skewed clock.
Impact:
The request the message carried never takes effect. The sender sees no answer and its own round eventually times out.
Mitigation: retry from the sender, or raise
inbound_messageif legitimate traffic routinely arrives this late. See Concurrency and scheduling.
Messages that are well-formed but have no effect — acknowledgements, stray or replayed responses — are reported as NoOp, not MessageIgnored.
Process Restart During In-Flight Flows
Every protocol flow produces short-lived in-flight state for outstanding requests — verification challenges awaiting their responses, unpair acknowledgements still pending, recovery accumulators tracking how many shares have arrived, share-distribution rounds tracking which Helpers have confirmed. The orchestrator does not hold this state in memory; it persists all of it through the DeRecStateStore the application supplies.
Whether an in-flight flow survives a process restart therefore depends on the state store backend:
Durable backend (SQLite, Postgres, Redis, …) — the in-flight state outlives the restart. When the process resumes, inbound responses still bind to their originating requests and the flow continues where it left off. This is what lets the orchestrator run in stateless or load-balanced deployments where any instance may handle any message.
In-memory backend — the state is lost on restart, exactly as an in-memory-only deployment always behaved. Inbound responses then arrive with no in-flight entry to bind to, and the protocol safely drops them as nothing actionable; the affected flows must be re-initiated by the application after the process resumes.
Impact:
With a durable state store, verification challenges, unpair acknowledgements, and recovery sessions in flight at restart resume automatically; with an in-memory state store they must be re-initiated by the application after the process resumes.
Replay safety does not depend on the restart. A response binds only to a still-outstanding request, and the orchestrator removes that request's state the moment the response is accepted — so a replayed or late-delivered copy finds nothing to bind to, whether or not a restart occurred.
In the in-memory case the cost is availability of the specific in-flight flow, not security.
See Implementing a persistent store for the DeRecStateStore contract and the trade-off between an in-memory and a durable backend.
Last updated