For the complete documentation index, see llms.txt. This page is also available as Markdown.

Events

Events serve two distinct purposes, and every DeRecEvent falls into one of them:

  • Notification. Most events tell the application what has happened as a result of driving a flow — a channel became Paired, a share was stored, a Secret was recovered, an inbound Secret sync arrived. The application reacts to these to update its own UI, its own state, and downstream systems. The protocol has already decided what to do; the event is the report.

  • Control point. One event variant — DeRecEvent::ActionRequired { channel_id, action: PendingAction } — pauses a flow and hands the decision back to the application (or to the human behind it). The application either calls accept(action) to let the flow proceed on protocol-correct terms, or reject(action, status, memo) to refuse. This is how the application (or its user) gates every inbound request that admits an application-level choice — accepting a pairing, storing a share, disclosing a share during recovery, and so on. ActionRequired is the mechanism by which policy — not just protocol — reaches the wire.

    RequestFailed can carry a token too: a PendingAction::RespondToFailure for a failed request the library has not answered. It is resolved only with reject(action, status, memo).

This chapter is the reference enumeration of every DeRecEvent the orchestrator emits and every PendingAction the application can be asked to resolve. Per-flow walkthroughs of when each fires live in Flows; SDK-specific naming (Rust enum variants, .NET subclass records, Go EventType* constants, TypeScript discriminated unions) lives in the SDK chapters and in Cross-SDK naming below.

How events are surfaced

The DeRecProtocol orchestrator is event-driven by design. protocol.process(envelope_bytes) decodes inbound wire bytes and returns a Vec<DeRecEvent> describing what changed. Before it handles the message, process settles any expired sharing-round and unpair deadlines; those timeout events come first in the returned list, sharing-round before unpair, followed by the events the message produced.

protocol.start(flow) also returns a Vec<DeRecEvent>: one *Started event per request it dispatched — PairingStarted, ProtectSecretStarted, DiscoveryStarted, and so on (see Flow dispatch) — and, for fan-out flows, a *Failed event for each target whose send failed. PairingStarted carries the temporary pairing channel_id the new pairing was minted under. Settlement events fire on a later process call (for example SharingComplete, once every targeted Helper has responded or timed out), or on tick(), which runs the same timeout sweep without an inbound message.

restore(secret, version) returns events too: PeerNotRestored for each roster entry it wrote no channel for, then the Unpaired / UnpairFailed events of the recovery-channel teardown.

DeRecEvent::ActionRequired — the control-point event described above — is what gives the application its say. Every inbound request that needs an application-level policy decision is funnelled through ActionRequired: the orchestrator has decoded the request, validated its shape, and is ready to send the protocol-correct response — but it will not do so until the application (or its user) has been consulted. accept(action) releases the response; reject(action, status, memo) sends back a refusal with the supplied status and human-readable reason. A flow the application opted into AutoAcceptPolicy for is accepted inside process instead, and reported as AutoAccepted.

DeRecEvent::MessageIgnored reports an inbound message the orchestrator dropped without acting on it — a message on a channel whose fingerprint this device has not confirmed yet, one older than the inbound timeout, one whose envelope and inner timestamps disagree, or a verification response to a challenge a newer one replaced. Nothing was stored and nothing was sent back. See MessageIgnored.

DeRecEvent::RequestFailed reports a request on an authenticated channel that failed while it was handled. Every such request is answered exactly once, by the library or by the application through the event's token; the failure is not an error from process or accept, so the call's other events are kept. See RequestFailed.

DeRecEvent::NoOp is the explicit "nothing meaningful happened" signal — emitted for a well-formed message with no application-visible effect, such as an acknowledgement or a stray or replayed response the library safely dropped (see Verification binding gate for one example). Applications can usually ignore NoOp; it exists so the event stream is total rather than carrying a None semantic.

When process fails

A failed request on an authenticated channel is not a failed call: it is reported as RequestFailed in a successful result. process fails only for what cannot be answered: an envelope that does not decode, a channel with no key, a message that does not decrypt, any other failure of the pairing handshake or of a response this device received, a store failure before the message could be authenticated, and a failure of the publish that follows a completed pairing.

A failed process call still reports what it produced before failing. The deadlines it settled are already saved and are never reported again, so the error carries those events, along with the channel the failing message arrived on. Handle the carried events exactly as a successful call's events, then handle the error.

Binding
Events
Channel

Rust

ProcessError::events

ProcessError::channel_id (Option<ChannelId>)

.NET

DeRecException.Events

DeRecException.ChannelId (ulong?)

Go

*protocol.ProcessError Events

*protocol.ProcessError ChannelID (*uint64)

TypeScript / React Native

DeRecError.events

DeRecError.channel_id (decimal string)

The channel is absent when the bytes were not a decodable envelope. See Error Handling — When process fails.

Matching responses to requests

The library does not check that a response answers a request this device sent. Every response arrives on a channel authenticated with its channel key, from the peer paired on it, and the library acts on it only as far as its own state needs:

  • Applied against the flow that asked. A response that would change stored state is applied only against the state the matching flow left behind: GetShareResponse against a recovery in progress for that Secret and version, VerifyShareResponse against the outstanding challenge on that channel, UnpairResponse against an unpair this side started, and a replica discovery answer against a discovery in progress. Anything else is dropped as NoOp.

  • Counted only by an open round. A sharing round counts a StoreShareResponse only while that round is open and still waiting on that Helper.

  • Newer than held. A replica catch-up (a GetShareResponse from a group member) is applied by the same rule as a pushed copy: only when it is newer than what this device holds.

  • Reported unmatched. Every other response is reported as it arrives: ShareConfirmed and ShareRejected (whether or not a round counts them), SecretsDiscovered, ChannelInfoUpdated, ChannelInfoUpdateRejected and ErrorResponseReceived.

Keeping track of what it asked, and pairing each answer with its request, is the application's concern. An application that acts on these events records what it started (the flow, channel, Secret and version) and matches each event against that record, using the trace_id of the *Started events and the response envelope's traceId where it needs an exact pairing.

The event surface is identical across SDKs — only the language-specific naming differs. The variant set, field set, and emission semantics are defined once by the orchestrator API; bindings just re-expose the same values under language-idiomatic names. See Cross-SDK naming at the bottom of this page.

Event catalogue

Events are grouped by the flow that produces them, matching the order in Flows. Each entry documents the field shape and what state transition triggers emission. Field types are the Rust ones; status fields are the raw StatusEnum value (i32) in Rust and a typed StatusEnum in every other SDK.

Pairing

PairingCompleted

The pair handshake closed successfully on this side. The event does not mean the channel is usable. An InlineKeys / HashedKeys Owner↔Helper channel reaches Paired immediately; every replica channel and every NoKeys channel stays Pending until both sides complete fingerprint cross-confirmation.

Field
Type
Description

channel_id

ChannelId

The long-term channel the handshake rotated to (see Channel id rotation). Used for all subsequent traffic.

pairing_channel_id

ChannelId

The transient contact-time channel id the pairing was bootstrapped from — the channel_id of the matching PairingStarted. No longer resolvable in library state after completion.

kind

SenderKind

This node's own role in the pairing. The channel record stores its inverse — the peer's role — on HelperChannel.peer_role, which the orchestrator consults on every subsequent flow start and inbound message.

peer_communication_info

HashMap<String, String>

Key-value identity metadata extracted from the peer's CommunicationInfo (e.g. "name", "email"). Empty if absent.

Triggers:

  • Owner side: arrival of a PairResponseMessage whose nonce and binding fields validate against the cached pairing state.

  • Helper / responder side: completion of accept on the corresponding PendingAction::Pairing.

See Pairing.

ReplicaPaired

Fires alongside PairingCompleted on replica-mode channels. Carries the peer's stable replica_id, which the application needs as a from_replica_id correlation handle for later Secret syncs.

Field
Type
Description

channel_id

ChannelId

The channel the pair handshake completed on.

peer_replica_id

u64

Peer's replica_id, extracted from the derec.replica_id entry in their CommunicationInfo.

Triggers:

  • Same as PairingCompleted, restricted to channels whose role is ReplicaSource or ReplicaDestination.

See Pairing.

PrePairRejected

The contact creator answered the scanner's PrePairRequest with a non-Ok status (the HashedKeys or NoKeys contact-delivery sub-flow). The scanner cannot proceed to a normal PairRequest because the public keys were never published.

Field
Type
Description

channel_id

ChannelId

Channel the pre-pair was targeting.

status

i32

StatusEnum value from the contact creator's response.

memo

String

Human-readable reason from the contact creator.

Distinct from PairingError::PrePairHashMismatch, which fires when keys were published but failed the binding-hash check — that surfaces as an error from process(), not an event.

Triggers:

  • Inbound PrePairResponseMessage with non-Ok status on a HashedKeys or NoKeys flow.

See Pairing — PrePair sub-flow.

PairingRefused

This device (the responder) refused an inbound PairRequest under a protocol rule and sent the requester a PairResponse carrying status and memo. No channel was created. The refusal is the result of process, not an error, and is sent whatever AutoAcceptPolicy or auto_respond_on_failure says.

Field
Type
Description

channel_id

ChannelId

Channel the PairRequest arrived on.

status

i32

StatusEnum value sent to the requester: INCOMPATIBLE_PARAMETER_RANGE or REPLICA_ID_CONFLICT.

memo

String

What the requester reads, written from its side — for a range, the field, the requester's range and the accepted one, e.g. `shareSize` range [10, 500] does not overlap the accepted range [1000, 5000].

error_code

String

The refusal's error code name: incompatible_parameter_range or replica_id_conflict. Local only.

message

String

Full local description of the refusal. Never sent to the peer.

Triggers:

  • Inbound PairRequest whose ParameterRange does not overlap this device's, or is malformed (a negative value, or min greater than a non-zero max; a max of 0 means no upper bound).

  • Inbound replica PairRequest naming a replica_id already held by a member of the group, this device included.

Once the refusal is handed to the transport it is reported, even when that send or the cleanup of the pairing secret after it fails; that failure follows as RequestFailed with action_kind: Pairing and responded: true. A failure before the refusal reaches the transport fails process instead. The initiator is unchanged: its process fails with non_ok_status when the PairResponse arrives, carrying the refusal's status and memo.

See Pairing.

Sharing

ShareStored

A share was accepted and stored locally on the helper side after the application's accept resolved the matching PendingAction::StoreShare (or after an auto-accept). { channel_id: ChannelId, version: u32 }.

A Helper never learns which replica wrote a share: helper-bound requests carry no replica identity, so every member of a replica group publishes to a Helper as the Owner. A replica learns the author of a version from ReplicaSecretReceived instead.

Triggers:

  • protocol.accept on a PendingAction::StoreShare after the share has been persisted via DeRecShareStore::save.

See Sharing.

ShareRefused

The library refused an inbound StoreShareRequest on the helper side. Nothing was stored, no stored version was removed, and the Owner was sent a StoreShareResponse carrying status and memo, which it observes as ShareRejected with the same values.

Field
Type
Description

channel_id

ChannelId

Channel of the Owner that sent the share.

version

u32

Version of the refused share.

status

i32

StatusEnum value sent to the Owner.

memo

String

Human-readable reason sent to the Owner.

Emitted for every refusal the library makes itself, whatever AutoAcceptPolicy or auto_respond_on_failure says, and always in place of ActionRequired: a refused share never reaches the application's decision. The share is checked before ActionRequired is raised and again when a StoreShare action is accepted.

status

Cause

FORMAT_ERROR

The share is empty, is not a CommittedDeRecShare, lacks its wrapped share, commitment or Merkle path, or does not wrap a DeRecShare.

VERIFICATION_FAILED

The wrapped share does not verify against its commitment: no subshares, a repeated x, or a Merkle path that does not lead to the commitment.

SIZE_LIMIT_EXCEEDED

The share is outside this helper's own configured minShareSize / maxShareSize (memo "share size is outside the helper's accepted range").

VERSION_CONFLICT

A different share is already stored at version on this channel.

A refusal decided by the application's own share store (ShareStoreError::Refused) is the application's decision and does not emit this event: the helper's call returns [NoOp]. See Error Handling — Helper share refusals.

See Sharing.

ShareConfirmed

A helper confirmed it stored an owner-side share. { channel_id: ChannelId, version: u32 }.

Reported as the response arrives, without matching it to a request this device sent. A sharing round counts the confirmation only while it is open and still waiting on that helper, so decide which versions committed from SharingComplete, not by counting these. See Matching responses to requests.

Triggers:

  • Inbound StoreShareResponseMessage with result.status == Ok.

See Sharing.

ShareRejected

A helper rejected or failed to store a share. The protocol absorbs the failure and surfaces it as an event so the application can render per-participant progress. An inbound rejection is reported without being matched to a request; see Matching responses to requests.

Field
Type
Description

channel_id

ChannelId

Channel of the rejecting helper.

version

u32

Version that was being distributed.

status

i32

StatusEnum value from the helper's response. VERSION_CONFLICT means the helper already holds a different share at this version.

memo

String

Human-readable reason from the helper, or "timeout" (synthetic).

Triggers:

  • Inbound StoreShareResponseMessage with non-Ok status.

  • Local timeout firing on an outstanding outbound store-share request.

See Sharing.

SharingComplete

Aggregate result for one DeRecFlow::ProtectSecret round. Emitted exactly once per round after every targeted helper has either confirmed, rejected, or timed out — and, if the round had replica members, after every member has settled too.

Field
Type
Description

version

u32

The version this round distributed.

confirmed_count

usize

Number of helpers that confirmed with Ok. Helpers only.

failed_count

usize

Number of helpers that rejected or timed out. Helpers only.

threshold_met

bool

true when the confirmed helpers' combined subshare weight is >= the threshold this round split at (the round's own t, not the current one). A helper's weight comes from the share this device dispatched to it, 1 if that share is missing or does not decode. Equal to confirmed_count >= t only when every helper had weight 1.

Triggers:

  • Resolution of the last outstanding store-share request in the round, across both populations.

It also waits for the replica leg

A round that targeted replica members as well as Helpers does not report until both populations have settled. SharingComplete and ReplicaSyncComplete are emitted together, at that moment.

The counts above describe Helpers only and are known the instant the Helpers answer — but the event is withheld until every member has acknowledged, refused, or timed out.

A Helpers-only round is unaffected and completes as soon as the Helpers answer.

See Sharing.

Replica group

These fire only on protocols built with a replica_id. Several are keyed by replica_id rather than channel_id: every member of a group answers on the one group channel, so the channel cannot say who replied.

A Secret sync from a group member is applied on receipt: it raises no ActionRequired, so it is not governed by AutoAcceptPolicy and produces no AutoAccepted.

ReplicaSecretReceived

A group member's copy of a later version of a Secret this device already held arrived and has been written to the stores — the Secret, the roster, and the per-helper share map. The copy arrives either as a push from the publishing member or as the answer to this device's own ReplicaDiscovery catch-up.

Field
Type
Description

channel_id

ChannelId

The channel the copy arrived on.

from_replica_id

u64

The member this copy came from: the publisher on a push, the member that answered on a catch-up. Not necessarily the writer.

author_replica_id

Option<u64>

The member that published version, now stored with it. Equal to from_replica_id on a push; on a catch-up it names the original publisher. None when the serving member's snapshot records no author.

secret_id

u64

The secret_id the copy was sent under: the publisher's on a push, the serving member's on a catch-up.

version

u32

The version the copy belongs to.

secret

Secret

Decoded full Secret: helpers, secrets, replicas. See the Secret payload section in Messages.

shares

Vec<ChannelShare>

Per-helper VSS share map. Each entry pairs a helper's channel_id with the serialized CommittedDeRecShare bytes that helper holds.

Triggers:

  • Inbound StoreShareRequest on a replica channel whose payload decodes as a ReplicaSecretPayload at a version newer than the one held.

  • The answer to a ReplicaDiscovery fetch, when a member held a newer version.

See Secret synchronization.

ReplicaSecretInstalled

The first sync for a secret_id this device held no snapshot for — the Secret now exists here. Same fields as ReplicaSecretReceived; the distinct name is what tells the application that the set of secrets on the device changed. Fires only on first sync; every later version arrives as ReplicaSecretReceived.

Field
Type
Description

channel_id

ChannelId

The channel the request arrived on. During an admission handover this is the ephemeral pairing channel, not the group channel — the group's own id is secret.replicas.channel_id.

from_replica_id

u64

The member this copy came from, as on ReplicaSecretReceived.

author_replica_id

Option<u64>

The member that published version, as on ReplicaSecretReceived.

secret_id

u64

As on ReplicaSecretReceived.

version

u32

As on ReplicaSecretReceived.

secret

Secret

Decoded full Secret, already written to the stores.

shares

Vec<ChannelShare>

Per-helper VSS share map, as on ReplicaSecretReceived.

This is not a recovery. Recovery reconstructs a Secret from Helper shares and is driven by the application through restore; this arrives unsolicited from a group member and is applied on receipt.

See Secret synchronization.

ReplicaVersionConflict

A member offered a different copy of the version this device holds. Two members published the same version independently — each derives the next version from what it held, so concurrent changes collide. Nothing was written: this device keeps its own copy and refused the incoming one with VERSION_CONFLICT, so the publisher sees ReplicaSyncRejected.

Field
Type
Description

channel_id

ChannelId

The channel the copy arrived on.

from_replica_id

u64

The member this copy came from.

secret_id

u64

secret_id of the incoming copy.

version

u32

The contested version.

held_author_replica_id

Option<u64>

Who published the copy this device holds. None when its snapshot records no author.

incoming_author_replica_id

Option<u64>

Who published the incoming copy. None when the serving member's snapshot records no author.

secret

Secret

The incoming copy's full state: secrets, helpers and replicas.

The conflict is the application's to resolve. Both copies are complete states: the held one is in the local stores, the incoming one is secret. Publishing the merged state with ProtectSecret writes the next version, which supersedes both on every member and Helper.

Triggers:

  • An inbound push (from another member's ProtectSecret) at the version this device already holds, from a different author. An older copy is refused with VERSION_CONFLICT but raises no event here.

It fires only on the receiving side. ReplicaDiscovery never produces it: that flow fetches only a strictly newer version, which is applied. In a simultaneous write both writers push to each other, so each normally receives the other's copy here. A device that only saw ReplicaSyncRejected { status: VERSION_CONFLICT } has no library call that fetches the rival copy.

ReplicaSecretRefused

This device refused a group member's copy of the Secret. The whole copy is checked before anything is written, so nothing was: no helper channel or key, no tracking share, no group member and no snapshot.

Field
Type
Description

channel_id

ChannelId

The channel the copy arrived on.

from_replica_id

u64

The member the copy came from.

secret_id

u64

Echoed from the inbound StoreShareRequest.

version

u32

Echoed from the inbound StoreShareRequest.

status

i32

StatusEnum value of the refusal, as sent to the publisher on a push.

memo

String

Human-readable reason, as sent to the publisher on a push.

status is one of:

  • FORMAT_ERROR — the payload does not decode, lacks its secret, disagrees with the request's version or with the roster's group key, carries a key that is not 32 bytes or a member with a reserved id or unknown role, names a Helper in its share map that the roster does not list, or carries a share map entry that does not decode.

  • VERIFICATION_FAILED — a share map entry does not verify against its commitment.

Triggers:

  • Push (a replica-bound StoreShareRequest): the publisher has already been answered with status and memo, whatever auto_respond_on_failure says, and sees ReplicaSyncRejected with the same values. An admission handover is answered on the group channel under the group key it carries, since the admitter no longer holds the ephemeral key; a handover that does not decode, or whose group key or channel is unusable, is answered where it arrived, and the admitter learns of the refusal only by timing out.

  • Catch-up (a member's GetShareResponse carrying the Secret): nothing is answered, since the payload is itself an answer. from_replica_id is the member that served it.

A different copy of a version already held is ReplicaVersionConflict instead.

ReplicaSecretAcked

A replica peer's StoreShareResponse to a Secret sync this node sent earlier. Mirrors ShareConfirmed / ShareRejected on the helper side.

Field
Type
Description

channel_id

ChannelId

The channel the response arrived on.

from_replica_id

u64

The member that produced the response.

secret_id

u64

Echoed from the response.

version

u32

Echoed from the response.

status

i32

StatusEnum value from StoreShareResponseMessage.result.

memo

String

Human-readable reason from the peer (empty on Ok).

Triggers:

  • Inbound StoreShareResponse on a replica channel correlating to an outbound Secret-sync request.

ReplicaSyncRejected

A group member refused a Secret sync this node sent. Keyed by replica_id, not channel_id.

Field
Type
Description

replica_id

u64

The member that refused, from the response payload.

secret_id

u64

Echoed from the response.

version

u32

Echoed from the response.

status

i32

StatusEnum value from the member's response. See below for VERSION_CONFLICT.

memo

String

Human-readable explanation from the member.

VERSION_CONFLICT means another member holds a different copy of this version. The device must not publish again until the conflict is resolved. The rival copy reaches a device only as ReplicaVersionConflict, when the other writer's push arrives; running ReplicaDiscovery does not fetch it, because that flow fetches only a strictly newer version. Merge, then publish the result once with ProtectSecret.

ReplicaSyncFailed

A Secret sync could not be delivered to a member at all. Distinct from ReplicaSyncRejected, which is the member answering "no": here nothing was sent, so no acknowledgement can ever arrive. The member is reported once, at dispatch, and also appears in ReplicaSyncComplete.behind.

Field
Type
Description

replica_id

u64

The member that could not be reached.

version

u32

The version this round was publishing.

reason

String

The transport or encoding failure, rendered for display.

ReplicaSyncComplete

The replica leg of a publishing round finished. Reported separately from SharingComplete because the two populations have different success rules and different keys — but emitted at the same moment, once both have settled.

Field
Type
Description

version

u32

The version this round was publishing.

synced

Vec<u64>

Members that acknowledged.

behind

Vec<u64>

Members that refused, timed out, or could not be reached.

Replicas are best-effort: a member in behind does not fail the round. A replica holds a full copy and contributes nothing to the recovery quorum, so blocking on one offline device would freeze writes for the whole group while buying no safety.

Best-effort governs the outcome, not the timing: a member that never answers does not fail the round, but it does delay the report, holding back SharingComplete with it until the sharing_round timeout expires.

ReplicaRemoved

A member was removed from the group and its roster row dropped. Fires on the members that remain; the departing device instead reports SelfRemovedFromGroup.

Field
Type
Description

replica_id

u64

The member that left or was evicted.

Triggers:

  • On a remaining member: an arriving roster that omits a member already flagged Unpairing.

  • On the device that ran the removal: that member acknowledging the excluding version.

ReplicaSourceChanged

The group's Source role moved to a different member, because the previous source is leaving.

Field
Type
Description

replica_id

u64

The member that now holds the source role.

Fires on the device that ran the removal — from start(UnpairReplica) itself, naming the successor it chose (the first remaining member in the order DeRecChannelStore::replicas returns) — and on any member whose own row is promoted by an arriving roster. A member that is neither is unaffected — it reads the new source from the roster like any other field. A roster restating an unchanged source is silent.

SelfRemovedFromGroup

This device has been removed from the group and has torn down its own secret_id partition — group channel, helper channels, shares, secrets, and the user-secret snapshot. The application should expect its local state for that secret_id to be gone.

Field
Type
Description

version

u32

The version whose roster completed the removal.

Fires only after both halves of the safety rule hold: this device was told to leave, and has since seen a roster excluding it. Absence alone never destroys a copy of the Secret.

What the removed member experiences: it is not asked, and gets no event when it is told to leave. The teardown is automatic, and this event is the first and only report. Any member may cause it, the source included; the Secret survives on the remaining members and the Helpers. See Replica removal.

ReplicaDiscoveryComplete

A replica catch-up started with start(ReplicaDiscovery) finished.

Field
Type
Description

local_version

u32

The version this device held when the check started.

group_version

u32

The newest version any member reported. 0 when no member answered.

fetched_from

Option<u64>

The member the newest state was pulled from. Absent when this device was already current — in which case no hydration event follows.

When a fetch happened, the hydration event — ReplicaSecretReceived or ReplicaSecretInstalled — is reported when the answer arrives. See ReplicaDiscovery.

Verification

Every channel a start(VerifyShares) round challenges ends with exactly one of four events: ShareVerified, ShareVerifyInvalid, ShareVerifyRejected, or VerifySharesFailed when no verdict could be reached on this device. A wrong or missing proof is never an error from process.

The Owner keeps a proof of each helper's share — the exact bytes it sent — to check that helper's answers. A stored proof is either confirmed by its helper (ShareConfirmed) or part of a sharing round still open: when a round settles a channel as failed (ShareRejected or a round timeout), that channel's proof for the round's version is deleted, and a late ShareConfirmed is still emitted but stores nothing. This guarantee holds on the publishing device; a replica Destination holds the proofs the Source mirrored at publish time and never sees SharingComplete, so verifying there can report ShareVerifyRejected (UNKNOWN_SHARE_VERSION) for a helper that failed the Source's round or dropped the version under a later keepVersion. A Destination never deletes a proof on its own; freeing them is the application's concern (see Proof storage on replicas). Verify only versions whose round completed (SharingComplete). Starting verification on a channel with no proof at the requested version sends no challenge and emits VerifySharesFailed with reason NoProof immediately.

ShareVerified

A helper's VerifyShareResponse passed both the (nonce, secret_id, version) binding gate and the SHA-384 hash check.

Field
Type
Description

channel_id

ChannelId

The helper whose proof checked out.

version

u32

The challenged version.

subshares

Option<u32>

How many subshares this helper holds for version: Share::subshares of the Owner's stored share for this channel and version — the weight of the round that published version, not the helper's current weight. None when that row was written before 0.0.9.

threshold

Option<u32>

The t version was split with: Share::threshold of the same Owner row — that version's t, not the current one. None when that row was written before 0.0.9.

Judging recoverability. Sum subshares over the ShareVerified events for one version and compare the sum with their threshold: recovery needs that many distinct subshares. If either value is None on any of those events, the result is unknown — a None count is not 0 or 1. The values are never backfilled; publishing a new version records both. In .NET and Go the fields are nullable (uint?, *uint32); in TypeScript and React Native they are optional and absent for None.

Triggers:

  • Inbound VerifyShareResponseMessage that binds to an outstanding VerifyShareRequest and whose proof hash matches the locally-recomputed SHA-384(share || nonce).

A response whose proof does not match is reported as ShareVerifyInvalid.

See Verification.

ShareVerifyInvalid

A helper answered a verification challenge with a proof that does not match the share this device stored for it. { channel_id: ChannelId, version: u32 }.

Triggers:

  • Inbound VerifyShareResponseMessage with an Ok status that binds to an outstanding VerifyShareRequest, where the proof differs from the locally-recomputed SHA-384(share || nonce).

An honest helper never sends one: treat it as a sign of a damaged or dishonest helper, for example by sharing again or unpairing it. The challenge is spent; checking the helper again takes a new VerifyShares round.

See Verification.

ShareVerifyRejected

A helper refused a verification challenge: its VerifyShareResponse carried a non-Ok status instead of a proof — for example UNKNOWN_SHARE_VERSION when it holds no share for version. It is reported whether or not this device still holds a proof for the channel.

Field
Type
Description

channel_id

ChannelId

The helper that refused.

version

u32

The challenged version.

status

i32

StatusEnum value from the helper's response.

memo

String

Human-readable reason from the helper.

The challenge is spent either way — a later response to it is dropped — so checking this helper again takes a new VerifyShares round. Only a helper that never answers shows up as absence.

See Verification.

Discovery

SecretsDiscovered

A helper returned its catalogue of (secret_id, version) pairs it currently holds for this Owner identity. The application persists this and uses it to drive DeRecFlow::RecoverSecret.

Field
Type
Description

channel_id

ChannelId

Channel of the responding helper.

secrets

Vec<SecretVersionEntry>

One entry per known secret_id, each carrying a Vec<VersionEntry> of (version, description).

The catalogue carries no writer identity. A Helper holds exactly one share per (secret_id, channel_id, version) and knows nothing about replicas; concurrent writes at the same version are refused with VERSION_CONFLICT at store time rather than stored side-by-side for the application to reconcile later. See Helpers hold exactly one share per version.

Triggers:

  • Inbound GetSecretIdsVersionsResponseMessage from a Helper.

Reported as the response arrives, without matching it to a request this device sent; see Matching responses to requests.

See Discovery.

Recovery

start(RecoverSecret { secret_id, version }) asks every paired Helper for its share of one (secret_id, version). Each Helper's answer settles as exactly one of RecoveryShareReceived, RecoveryShareRefused, RecoveryShareCorrupted (judged on arrival), or — once enough consistent shares are in — SecretRecovered. Each of these answers the RecoverSecretStarted issued for that channel, so an application counting answers against those requests counts every one.

How shares are combined

A share that fails on its own — it is bigger than this device's own configured max_share_size (rejected before it is even parsed), does not decode, is bound to another secret or version, or fails its Merkle proof — is reported as it arrives and never collected. Shares that are each valid but disagree (a different commitment root or ciphertext) are grouped by (commitment root, ciphertext). Groups are tried largest first, ties going to the group whose first share arrived earliest, and the first group that reconstructs is the Secret. A group of one share is never tried. Every collected share outside the winning group is reported as RecoveryShareCorrupted { reason: Inconsistent } alongside SecretRecovered, once per Helper.

A corrupted share therefore never blocks recovery from the honest shares, and the shares a Secret is rebuilt from always share one root and one ciphertext.

RecoveryShareReceived

A Helper's share was collected but the Secret cannot be reconstructed yet — more shares are needed.

Field
Type
Description

channel_id

ChannelId

Helper that sent this share response.

shares_received

usize

Number of Helpers whose shares are collected so far for this (secret_id, version): one per channel, not counting refused or corrupted shares.

Triggers:

  • Inbound GetShareResponseMessage whose share validated on its own but did not yet complete reconstruction.

RecoveryShareRefused

A Helper refused the share request: its GetShareResponse carried a non-Ok status instead of a share — for example UNKNOWN_SHARE_VERSION when it holds no share for version.

Field
Type
Description

channel_id

ChannelId

The Helper that refused.

version

u32

The requested version.

status

i32

StatusEnum value from the Helper's response.

memo

String

Human-readable reason from the Helper.

The refusal is not collected: it does not count toward shares_received, triggers no reconstruction attempt, and leaves the recovery open for the other Helpers' shares.

RecoveryShareCorrupted

A Helper answered with an Ok status but a share that cannot be part of the recovered Secret. The share is set aside: it is never used for reconstruction, does not count toward shares_received, and cannot block the recovery.

Field
Type
Description

channel_id

ChannelId

The Helper whose share was set aside.

version

u32

The requested version.

reason

CorruptionReason

How the share failed; see below.

CorruptionReason:

Variant
Judged
Meaning

Malformed

On arrival

The response carries no decodable share for the requested secret and version: the share bytes are missing or undecodable, the share is bound to another secret or version, or the share exceeds this device's own configured max_share_size and is rejected before being parsed at all.

InvalidProof

On arrival

The share decodes but its Merkle proof does not open to its own commitment root — for example a value altered after it was split.

Inconsistent

Alongside SecretRecovered

The share verifies on its own, but its commitment root or ciphertext disagrees with the shares the Secret was reconstructed from. Only judgeable against the other shares.

An honest Helper never sends a corrupted share, so the application may treat this event as a sign that the Helper's device or storage is damaged or compromised — for example by offering to unpair it.

RecoveryShareError

Reconstruction ran and succeeded, but the reconstructed bytes did not decode as a Secret. A corrupted share never causes this: it is set aside and reported as RecoveryShareCorrupted instead.

Field
Type
Description

channel_id

ChannelId

Helper whose share completed the reconstruction attempt.

shares_received

usize

Total share responses collected so far.

error

String

Description of the decode failure.

SecretRecovered

Reconstruction succeeded. The reconstructed Secret is returned exactly once.

Field
Type
Description

secret

Secret

The reconstructed Secret, already decoded into the typed Secret struct (helpers, secrets, replicas). No separate decode step.

Triggers:

  • Enough mutually-consistent shares accumulated for (secret_id, version).

Restore

restore(secret, version) returns events the application must handle like any other.

PeerNotRestored

restore wrote no channel for one entry of the recovered roster. Every other entry and the user-secret snapshot were restored as usual. This is not an error.

Field
Type
Description

channel_id

ChannelId

The Helper's channel, or the replica group's channel when the entry is a group member.

replica_id

Option<u64>

The member's replica_id when the entry is a replica group member; None for a Helper.

reason

NotRestoredReason

Why this entry got no channel.

NotRestoredReason has one variant, NoTransports: the recovered roster names no endpoint for the peer, so a channel to it would have nothing to send to. A legacy roster whose single URI had a scheme this library does not recognise decodes this way.

Nothing is stored for the peer, so this device cannot reach it. The peer itself is untouched: a Helper still holds its share, and pairing with it again is what makes it reachable from this device.

restore also tears down the throwaway recovery-mode channels, emitting Unpaired for each and UnpairFailed for any whose unpair request could not be delivered.

UpdateChannelInfo

ChannelInfoUpdated

The stored channel record was updated with new communication_info and/or transport endpoints. Surfaces on both sides of the flow: on the responder side from accept, on the initiator side from process when the peer's Ok response arrives. { channel_id: ChannelId }. On the initiator it is reported as the response arrives, without matching it to a request this device sent; see Matching responses to requests.

The post-update values are already on the local record by the time the event fires; applications that care about the new state read it from the channel store directly.

Triggers:

  • Responder: protocol.accept on a PendingAction::UpdateChannelInfo writes the new fields to the channel record.

  • Initiator: inbound UpdateChannelInfoResponseMessage with Ok status.

See UpdateChannelInfo.

ChannelInfoUpdateRejected

The peer answered an outbound UpdateChannelInfo with a non-Ok status. The peer's stored state is unchanged; the initiator's local state is also unaffected. Reported as the response arrives, without matching it to a request this device sent; see Matching responses to requests.

Field
Type
Description

channel_id

ChannelId

Channel the update was targeting.

status

i32

StatusEnum value from the peer's response.

memo

String

Human-readable reason from the peer.

Triggers:

  • Inbound UpdateChannelInfoResponseMessage with non-Ok status.

Unpair

Unpaired

The local channel/share/secret state for channel_id has been dropped as the result of an unpair flow. { channel_id: ChannelId }.

Surfaces on both sides of the flow:

  • Initiator: emitted when (a) UnpairAck::NotRequired and the request has just been sent — in the same event list, right after UnpairStarted, (b) UnpairAck::Required and the peer acknowledged with Ok, or (c) UnpairAck::Required and the unpair_ack timeout elapsed without a response.

  • Responder: emitted by accept after the channel/share/secret state for the requesting peer has been removed.

  • restore: emitted for each recovery-mode channel it tears down.

Triggers:

  • See per-side conditions above. Self-initiated, peer-initiated, and timeout-induced tear-downs all surface through the same event variant; distinguishing them is the application's responsibility (typically by tracking whether start(Unpair) was called locally).

See Unpair.

UnpairRejected

The peer answered an outbound unpair request with a non-Ok status. The initiator's local state is not dropped — the application decides whether to retry, escalate, or force-delete locally.

Field
Type
Description

channel_id

ChannelId

Channel the unpair was targeting.

status

i32

StatusEnum value from the peer's response.

memo

String

Human-readable reason from the peer.

Triggers:

  • Inbound UnpairResponseMessage with non-Ok status.

See Unpair.

UnpairFailed

An unpair request could not be delivered. Emitted by restore when tearing down the ephemeral recovery channels. The teardown is fire-and-forget, so local state is dropped anyway and an Unpaired for the same channel follows. The pair means "the channel is gone locally, but the peer was not told" — the application may notify the peer out-of-band.

Field
Type
Description

channel_id

ChannelId

The recovery channel whose teardown was not sent.

error

String

The send failure, rendered for display.

start(Unpair) never emits it: a send failure there returns Err.

Flow dispatch

protocol.start(flow) returns one *Started event per request it dispatched. These are notifications only — they carry no PendingAction. A flow that fans out to several channels (a ProtectSecret round across many Helpers, say) emits one event per targeted channel.

Every *Started event carries a trace_id: one token per start call, shared by every request that call sends and echoed by the peer on its response (see traceId in Messages). SDKs that carry ids as strings expose it as a decimal string. It matches the trace_id on the peer's ActionRequired and MessageIgnored for the same round. *Failed events carry none.

Event
Fields
Fires when

PairingStarted

{ channel_id: ChannelId, trace_id: u64, kind: SenderKind }

start(Pairing) sent the PairRequest (or PrePairRequest for HashedKeys / NoKeys). channel_id is the temporary pairing id; PairingCompleted.pairing_channel_id repeats it once the channel rotates. kind is the local role.

ProtectSecretStarted

{ channel_id: ChannelId, version: u32, trace_id: u64, weight: u32 }

start(ProtectSecret) sent version to a Helper. weight is the number of subshares sent this round, which is also the weight now stored for that Helper (HelperChannel.weight): its ProtectSecret.weights entry, 1 for a Helper the map does not name, or the stored weight on a publish the library starts on its own. The replica leg is not reported here — members report through ReplicaSyncFailed and ReplicaSyncComplete.

ProtectSecretFailed

{ channel_id: ChannelId, version: u32, error: String, weight: u32 }

The send to one Helper failed. weight is the number of subshares that Helper was meant to receive, with the same meaning as on ProtectSecretStarted. The rest of the round is unaffected.

VerifySharesStarted

{ channel_id: ChannelId, version: u32, trace_id: u64 }

start(VerifyShares) sent a challenge to a Helper.

VerifySharesFailed

{ channel_id: ChannelId, version: u32, reason: VerifyFailureReason, error: String }

No verdict could be reached for one Helper on this device. reason is NoSharedKey (the channel has no shared key), NoProof (this device holds no proof of the Helper's share at version; no challenge is sent, and a response arriving after the proof was removed reports the same) or DispatchFailed (the challenge could not be sent, or the proof could not be loaded).

DiscoveryStarted

{ channel_id: ChannelId, trace_id: u64 }

start(Discovery) sent an enumeration request to a Helper.

DiscoveryFailed

{ channel_id: ChannelId, error: String }

The request to one Helper could not be sent.

RecoverSecretStarted

{ channel_id: ChannelId, version: u32, trace_id: u64 }

start(RecoverSecret) requested a share from a Helper.

RecoverSecretFailed

{ channel_id: ChannelId, version: u32, error: String }

The request to one Helper could not be sent.

UnpairStarted

{ channel_id: ChannelId, trace_id: u64 }

start(Unpair) sent an unpair request.

UnpairFailed

{ channel_id: ChannelId, error: String }

Emitted by restore only, for a recovery-channel teardown that could not be sent. See UnpairFailed.

UpdateChannelInfoStarted

{ channel_id: ChannelId, trace_id: u64 }

start(UpdateChannelInfo) sent an update to a Helper channel.

UpdateChannelInfoFailed

{ channel_id: ChannelId, error: String }

The update to one channel could not be sent. Outbound dispatch failure only: a peer refusing the update answers with ChannelInfoUpdateRejected.

A ProtectSecret whose paired Helpers' total weight is below the round's t splits nothing: no Helper is sent a share and no ProtectSecretStarted / ProtectSecretFailed is emitted for Helpers, while replica members still receive the secret and the version still advances. With no replica members paired either, start returns Ok with no events. This is not an error.

Rules that apply across the table:

  • Errors before any send are Err, not *Failed. Invalid input, a missing precondition, or a role mismatch makes start return Err before any request goes out, and no event is emitted.

  • Fan-out failures are per target. Once a multi-target flow starts sending, a failed send becomes that target's *Failed event and does not abort the rest of the round.

  • Single-channel flows return Err on send failure. Pairing and Unpair have no *Failed of their own; a failed send returns Err and no *Started is emitted.

  • Replica flows emit no *Started. start(ReplicaDiscovery) returns no events and concludes later with ReplicaDiscoveryComplete; start(UnpairReplica) returns at most a ReplicaSourceChanged when it removes the source.

Lifecycle and housekeeping

ActionRequired

An inbound request needs application confirmation before the library responds.

Field
Type
Description

channel_id

ChannelId

Channel the inbound request arrived on.

action

PendingAction

Token round-tripped to protocol.accept or protocol.reject. See the PendingAction catalogue.

Triggers:

  • Any inbound request message that admits an application-level policy decision, unless its flow is opted into AutoAcceptPolicy.

SDK fields

In Rust the application matches on the PendingAction variant and reads the decoded request directly. The other SDKs carry action as opaque bytes, to be passed back to accept / reject verbatim, and flatten what a decision needs onto the event itself:

Field (wire name)
Present on
Description

action

always

Opaque serialized PendingAction.

action_kind

always

One of the PendingActionKind labels: "Pairing", "PrePair", "StoreShare", "VerifyShare", "Discovery", "GetShare", "Unpair", "UpdateChannelInfo".

trace_id

always

Correlation token of the inbound request; matches the peer's *Started event for the same round.

peer_communication_info

Pairing

The peer's CommunicationInfo. Omitted when empty.

sender_kind

Pairing

The senderKind of the inbound PairRequest.

version

StoreShare, VerifyShare, GetShare

Share version.

share_secret_id

StoreShare, VerifyShare, GetShare

Secret identifier. On GetShare, with version, it names the share being asked for.

share_description

StoreShare

Description of the secret version, when the request carries one.

share_size

StoreShare

Length in bytes of the share the helper would store — what a size or quota decision is made on.

unpair_memo

Unpair

The peer's memo.

updated_communication_info

UpdateChannelInfo

The map the peer replaces its stored communication info with. Absent: unchanged. Empty: cleared.

updated_transports

UpdateChannelInfo

The endpoints the peer is moving to. Absent: unchanged.

The names above are the TypeScript / React Native ones. .NET exposes them as PascalCase properties on ActionRequiredEvent (ActionKind, TraceId, ShareSize, UpdatedTransports, …) and Go as fields on Event (ActionKind, TraceID, ShareSecretID, ShareSize, UnpairMemo, …). Ids are typed ulong / uint64 in .NET and Go and decimal strings in TypeScript and React Native.

AutoAccepted

The orchestrator accepted an inbound request on the application's behalf because the configured AutoAcceptPolicy opted into its flow. Emitted by process in place of ActionRequired, followed in the same event list by the events a manual accept(action) would have produced (ShareStored, PairingCompleted, Unpaired, …). Use it for observability and audit logging; no further action is required.

Field
Type
Description

channel_id

ChannelId

Channel the auto-accepted request arrived on.

action_kind

PendingActionKind

Which kind of action was auto-accepted (Pairing, StoreShare, …). The action payload itself was consumed by the internal accept.

Triggers:

  • An inbound request whose PendingActionKind the configured AutoAcceptPolicy opts into.

It is not emitted for replica Secret syncs or replica-originated unpairs: those raise no PendingAction and are acknowledged without one.

A failure while auto-accepting is reported as RequestFailed after AutoAccepted, which is kept.

RequestFailed

A request that arrived on an authenticated channel failed while it was being handled. Every such request is owed exactly one response; a request counts as answered once its response is handed to the transport. The event is returned instead of an error from process or accept, so the call's other events (AutoAccepted included) are kept.

Field
Type
Description

channel_id

ChannelId

The channel the request arrived on.

action_kind

PendingActionKind

The type of the request that failed. Failed for a body that could not be decoded or a request the channel cannot carry.

responded

bool

true when the response was handed to the transport.

status

i32

The StatusEnum value that was sent, or that would have been. Always present.

memo

String

The memo sent with status, or that would have been. Wire-safe: never the local error text.

error_code

String

The error's code name, as in the error catalog. Local only.

message

String

Local description of the failure. Never sent to the peer.

action

Option<PendingAction>

A PendingAction::RespondToFailure token, present only when responded is false and a reply target can exist. Opaque bytes in the other SDKs.

Who answers is decided by auto_respond_on_failure:

  • On — the library sends the request's own response type with status and memo; responded: true, action: None. If no reply target can be resolved before any send, the event carries the token anyway.

  • Off (the default) — nothing is sent; responded: false and action holds the token. Pass it to reject(action, status, memo). Passing the event's own status and memo sends exactly what the library would have sent with the option on.

action is None with responded: false only when no token could ever be answered: a request on a replica group channel that names no member and carries no reply_to (no reply target exists, so nothing is sent in either mode), and, with the option off, a replica copy that hands this device the group key and fails before that key is stored.

responded: true also reports a failure after the response was sent, which is never sent again — for example a responder whose PairResponse send fails reports PairingCompleted followed by RequestFailed { action_kind: Pairing, responded: true }.

The protocol's own refusals are not RequestFailed: they are answered in both modes and reported as ShareRefused, ReplicaSecretRefused or PairingRefused. Status mapping, exempt messages and the undecodable-body case are in Error Handling — Replying to the peer on failure.

ErrorResponseReceived

The peer answered a message from this device with an ErrorResponseMessage: it could not process it, typically because the body could not be decoded (FORMAT_ERROR). Reported as the response arrives, without matching it to a request this device sent; see Matching responses to requests.

Field
Type
Description

channel_id

ChannelId

The channel the response arrived on.

status

i32

StatusEnum value from the peer's response.

memo

String

Human-readable reason from the peer.

Reported only once the message passes the envelope timestamp check, like any other body. It is never answered, in either auto_respond_on_failure mode, so two peers cannot trade them. An ErrorResponseMessage from a 0.0.8 peer carries no timestamp and is ignored as MessageIgnored { TimestampMismatch } instead.

See ErrorResponseMessage.

MessageIgnored

An inbound message was dropped without being acted on: no store was written and nothing was sent back, so the sender learns nothing from the drop and a retry is always safe.

Field
Type
Description

channel_id

ChannelId

The channel the message arrived on.

reason

IgnoreReason

Why it was dropped; see below.

trace_id

u64

The envelope's trace id, so the drop can be matched to the peer's *Started event for the same round. 0 when the sender set none.

IgnoreReason:

Variant
Meaning

PendingVerification

The channel's fingerprint has not been confirmed on this device yet: a Pending helper channel, or a Pending replica member on the channel the message arrived on. Nothing a peer sends is acted on before the comparison, which is the only defence against a man-in-the-middle.

Expired

The message is older than Timeouts::inbound_message (default 300 s).

TimestampMismatch

The envelope's timestamp and the decrypted inner message's timestamp differ, or either or both are absent. A sender stamps both with the one time the message was sent, so a mismatch means the envelope was altered or built by a non-conforming peer (including a 0.0.8 peer, which stamps its replies separately). Every body, ErrorResponse included, carries the field and obeys the same rule; an ErrorResponse from a 0.0.8 peer has no timestamp and lands here. Checked after decryption, before dispatch.

StaleResponse

A VerifyShareResponse whose (nonce, secret_id, version) does not match the challenge outstanding on its channel: an answer to an earlier challenge that a newer one replaced. The outstanding challenge is kept, so its own answer still completes it.

PendingVerification is the case an application should surface. It typically means a replica source pushed its first copy while this destination was still showing the fingerprint code. Confirming does not replay the dropped message. Once verify_fingerprint succeeds, a replica destination should start(ReplicaDiscovery) to pull the copy from the source itself. See Fingerprint cross-confirmation.

NoOp

Explicit "nothing meaningful happened". Carries no fields. Applications can usually ignore it.

Triggers:

  • A well-formed message with no application-visible effect, such as an acknowledgement.

  • An inbound response that fails the per-flow binding gate (e.g. a VerifyShareResponse arriving on a channel with no outstanding challenge — see Verification binding gate), or the replay of an already-processed response. A VerifyShareResponse that does not match the challenge still outstanding is MessageIgnored with StaleResponse instead.

  • A helper-side accept of a VerifyShare or GetShare for a share the helper does not hold: the helper answers UNKNOWN_SHARE_VERSION and reports NoOp.

  • A helper whose share store refuses a save or record_verification with a Refusal: the library answers the Owner with the mapped status and the helper's call returns [NoOp]. See Error Handling — Helper share refusals.

Traffic on a channel awaiting fingerprint confirmation, older than the inbound timeout, with mismatched timestamps, or answering a replaced verification challenge, is not NoOp; it is reported as MessageIgnored.

AutoAcceptPolicy

AutoAcceptPolicy is a per-flow opt-in for accepting inbound requests without asking the application. When a flow's field is true, process runs the equivalent of accept internally and emits AutoAccepted in place of ActionRequired, followed by the same flow events a manual accept would have produced. A failure of the accepted request is reported as RequestFailed in the process result, exactly as a manual accept would report it; process fails only where a manual accept would return Err.

The default is every field false: no flow is auto-accepted and every request raises ActionRequired.

No field covers PendingActionKind::Failed. A failed request can only be rejected, so AutoAcceptPolicy::allows is false for a PendingAction::RespondToFailure under every policy, all() included. Answering failed requests automatically is auto_respond_on_failure's job, not this policy's.

Rust field (PendingActionKind)

.NET / Go

TypeScript / React Native

Gates

pairing (Pairing)

Pairing

pairing

Inbound PairRequest, standard and replica.

pre_pair (PrePair)

PrePair

prePair

Plaintext PrePairRequest of a HashedKeys / NoKeys contact.

store_share (StoreShare)

StoreShare

storeShare

Inbound share from a paired Owner.

verify_share (VerifyShare)

VerifyShare

verifyShare

Verification challenge.

discovery (Discovery)

Discovery

discovery

Request to enumerate held (secret_id, version) pairs.

get_share (GetShare)

GetShare

getShare

Recovery share request.

unpair (Unpair)

Unpair

unpair

Owner's request to drop this channel.

update_channel_info (UpdateChannelInfo)

UpdateChannelInfo

updateChannelInfo

Peer's announced communication-info / endpoint change.

Configuring it:

SDK
Set the policy
Every flow on

Rust

DeRecProtocolBuilder::with_auto_accept(policy)

AutoAcceptPolicy::all()

.NET

DeRecProtocolBuilder.WithAutoAccept(policy)

AutoAcceptPolicy.All()

Go

protocol.Config.AutoAccept

set each field to true

TypeScript / React Native

builder.withAutoAccept(policy)

set each field to true

all() turns on every flow, including the ones with the caveats below. Read them before using it outside tests.

Per-flow caveats:

  • pairing — standard pairing moves the channel to Paired immediately, so auto-accepting it skips any "user X wants to pair" confirmation. Replica pairing and NoKeys pairing stay Pending until both sides run verify_fingerprint, so auto-accepting them is benign: the channel is inert until the out-of-band fingerprint match.

  • pre_pair — the man-in-the-middle defence is on the scanner side (the binding-hash check) and is unaffected, but enabling it turns the contact creator into a request-amplification oracle: anyone who knows the contact's nonce and channel_id can elicit a key-publish response. Keep it off unless both ends of the transport are controlled (LAN, integration tests).

  • store_share — this is the helper's admission-control point for inbound shares beyond what the library checks itself. Whatever this flag says, the library refuses a share that does not decode or verify, or is outside this device's own configured minShareSize / maxShareSize, before ActionRequired is considered (reported as ShareRefused). With the flag off, ActionRequired hands the application the decoded request (and share_size in the SDKs) so it can reject with a tighter or per-user limit — SIZE_LIMIT_EXCEEDED, TOO_FREQUENT — or any other decline. With it on, every in-range, valid share from every paired Owner is stored unless the share store refuses it (see Helper share refusals). Keep it off in any deployment with per-user storage limits tighter than this device's own configured range.

  • unpair — destructive. Accepting deletes the local channel record and its shares and secrets. Unpaired still fires afterwards, but the user has no chance to intervene first.

  • update_channel_info — silently overwrites the stored channel record with the peer's announced endpoints and communication info. Cryptographically safe (only the paired peer can send it), but a compromised peer key re-routes outbound traffic faster.

The other fields wrap routine request/response flows and carry no caveat beyond "the application chose not to gate them". Auto-accept relaxes only the application's opportunity to refuse; it never relaxes an invariant the protocol enforces itself. Replica Secret syncs and replica-originated unpairs never raise ActionRequired, so the policy does not apply to them.

PendingAction catalogue

PendingAction is the token carried by DeRecEvent::ActionRequired (and, as PendingAction::RespondToFailure, by RequestFailed; see Failed requests). The application must call protocol.accept(action) to drive the protocol-correct response, or protocol.reject(action, status, memo) to refuse. Each variant carries the inbound request payload plus the trace id, shared key, and any other state the orchestrator needs at resolution time. No variant carries private key material — the pairing accept paths reload the pairing secret from the secret store — so the token is safe to persist or ship across a language boundary.

The library never expires an unresolved action: a token stays valid until the application resolves it, and one nobody resolves leaves its sender to time out. 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. In Rust PendingAction is Clone, so an application can keep a copy of an action it passes to accept and still reject it if a RequestFailed follows.

Before acting on a persisted action, accept checks its channel again. A channel that is gone or no longer Paired has nothing to answer on: accept returns InvalidInput, and nothing is stored or sent. A peer that no longer holds the role the flow requires is a failed request, answered REJECTED and reported as RequestFailed.

Pairing

PendingAction::Pairing

The peer sent a PairRequest. Emitted on the responder side.

Field
Type
Description

channel_id

ChannelId

Channel the request arrived on.

request

PairRequestMessage

The decoded inbound request (peer's public keys, senderKind, communicationInfo, ...).

kind

SenderKind

The peer's declared role on this channel.

peer_communication_info

HashMap<String, String>

Identity metadata copied from the peer's CommunicationInfo.

trace_id

u64

Trace id read from the inbound envelope, echoed verbatim on the response.

accept derives the shared key, persists the channel, and sends back a PairResponseMessage with Ok. reject sends a non-Ok response and discards the pairing state.

See Pairing.

PendingAction::PrePair

The peer scanned a HashedKeys- or NoKeys-mode ContactMessage and is asking for the real pairing public keys via a plaintext PrePairRequest. Emitted on the contact-creator side.

Field
Type
Description

channel_id

ChannelId

Channel the request arrived on.

request

PrePairRequestMessage

The decoded inbound PrePairRequest.

trace_id

u64

Trace id read from the inbound envelope, echoed on the response.

In HashedKeys mode, accept loads the PairingSecret the creator committed to at contact-creation time and replies with the actual mlkemEncapsulationKey / eciesPublicKey and the fingerprintCommitment, which the scanner validates against the contact's contactBindingHash. In NoKeys mode, accept generates fresh key material and a fingerprint nonce on the fly (matching the request nonce), persists them as the PairingSecret, and replies with the keys and the fingerprintCommitment; there is no hash for the scanner to check. Either way the nonce is revealed only in the PairResponse. Either way the scanner then proceeds to a normal PairRequest. reject sends back a non-Ok PrePairResponse and keeps no state.

See Pairing — PrePair sub-flow.

Sharing

PendingAction::StoreShare

The peer sent a StoreShareRequest. Emitted on the helper side, only for a share that passed the library's own checks (encoding, commitment, this device's configured share-size range, version conflict; a failure is ShareRefused instead). This is the helper's admission-control point beyond those checks: the protocol enforces no quota or rate limit, so a tighter size, quota or rate decision is made here.

Field
Type
Description

channel_id

ChannelId

Channel the request arrived on.

request

StoreShareRequestMessage

The decoded inbound request.

shared_key

SharedKey

The post-pairing symmetric key for this channel.

trace_id

u64

Trace id read from the inbound envelope, echoed on the response.

accept checks the share again, persists it via DeRecShareStore::save and sends back Ok. A share store that refuses the write with a Refusal gets the mapped status sent instead, and accept returns [NoOp] (see Helper share refusals). reject returns a non-Ok and stores nothing; SIZE_LIMIT_EXCEEDED, TOO_FREQUENT and REJECTED are the designated statuses for size limits, rate limits and a user-declined request. The Owner sees the refusal as ShareRejected.

See Sharing.

Verification

PendingAction::VerifyShare

The peer sent a VerifyShareRequest. Emitted on the helper side.

Field
Type
Description

channel_id

ChannelId

Channel the request arrived on.

request

VerifyShareRequestMessage

The decoded inbound request (carries secretId, version, nonce).

shared_key

SharedKey

Channel symmetric key.

trace_id

u64

Trace id, echoed verbatim on the response.

accept loads the stored share for (secret_id, version), computes SHA-384(share || nonce), and returns the proof. If the helper holds no share for that version, accept answers UNKNOWN_SHARE_VERSION instead and the Owner sees ShareVerifyRejected. Once the share is found, accept calls DeRecShareStore::record_verification; a Refusal there sends the mapped status (for example TOO_FREQUENT) instead of a proof and accept returns [NoOp]. reject returns a non-Ok and discloses nothing.

See Verification.

Discovery

PendingAction::Discovery

The peer is asking the helper to enumerate the (secret_id, version) tuples it holds for them. Emitted on the helper side.

Field
Type
Description

channel_id

ChannelId

Channel the request arrived on.

request

GetSecretIdsVersionsRequestMessage

The decoded inbound request.

shared_key

SharedKey

Channel symmetric key.

trace_id

u64

Trace id, echoed verbatim on the response.

accept builds the catalogue from DeRecShareStore::load_all and replies. reject returns a non-Ok and discloses no catalogue content.

See Discovery.

Recovery

PendingAction::GetShare

The peer sent a GetShareRequest. Emitted on the helper side.

Field
Type
Description

channel_id

ChannelId

Channel the request arrived on.

request

GetShareRequestMessage

The decoded inbound request (carries secretId, version).

shared_key

SharedKey

Channel symmetric key.

trace_id

u64

Trace id, echoed verbatim on the response.

accept returns the stored committed share for (secret_id, version). If the helper holds no share for that version, accept answers UNKNOWN_SHARE_VERSION instead and the Owner sees RecoveryShareRefused. reject returns a non-Ok and discloses nothing.

See Recovery.

UpdateChannelInfo

PendingAction::UpdateChannelInfo

The peer announced an update to its communication_info and/or transport endpoints. Emitted on the receiver side, on Helper channels only.

Field
Type
Description

channel_id

ChannelId

Channel the request arrived on.

request

UpdateChannelInfoRequestMessage

The decoded inbound request (carries the new communicationInfo and/or supportedTransports).

shared_key

SharedKey

Channel symmetric key.

trace_id

u64

Trace id, echoed verbatim on the response.

accept writes the new fields onto the stored channel record automatically — the application does not call set_communication_info / set_own_transports here; those setters exist for the initiating side only. An empty supportedTransports leaves the stored endpoints unchanged.

On accept, the announced endpoints are filtered by this device's transport policy only, exactly as in pairing; which transports this device serves itself is irrelevant. Survivors replace the stored set and the Ok response is routed to them, so subsequent outbound traffic on this channel already targets the new address. If every announced endpoint is refused, the request fails with NoUsableEndpoint: the stored record is left unchanged and accept returns RequestFailed with UNSUPPORTED_TRANSPORT_PROTOCOL, not an error. Two cases fail on receipt, in process, before any ActionRequired: an update that carries neither communicationInfo nor supportedTransports (FAIL, with a memo naming the missing fields), and an announced endpoint that is malformed (UNSUPPORTED_TRANSPORT_PROTOCOL). Both are reported as RequestFailed. reject sends a non-Ok response and leaves the stored channel state unchanged.

See UpdateChannelInfo for the endpoint-changeover discipline.

Unpair

PendingAction::Unpair

The peer is asking this node to drop its state for the channel. Emitted on the receiver side.

Field
Type
Description

channel_id

ChannelId

Channel the request arrived on.

request

UnpairRequestMessage

The decoded inbound request (carries memo).

shared_key

SharedKey

Channel symmetric key.

trace_id

u64

Trace id, echoed verbatim on the response.

accept deletes the local channel/share/secret state for this peer and sends back Ok (also emits Unpaired). reject sends a non-Ok response and keeps the state.

A replica-originated unpair is a different operation and raises no PendingAction. UnpairRequestMessage carries an optional replicaId naming the member being removed — required on a replica-originated unpair, forbidden on an owner-originated one. Receiving it does not delete a channel: it flags one member row ChannelStatus::Unpairing, and the removal completes only when a roster omitting that member arrives. See UnpairReplica and Replica removal.

See Unpair.

Failed requests

PendingAction::RespondToFailure

A request on an authenticated channel failed and the response it is owed has not been sent. Carried by RequestFailed (never by ActionRequired), with PendingActionKind::Failed ("Failed" in the SDKs).

Field
Type
Description

channel_id

ChannelId

The channel the failed request arrived on.

trace_id

u64

Trace id read from the inbound envelope, echoed verbatim on the response.

reply

ReplyTarget

Where the response goes: the channel_id whose shared key encrypts it and the endpoints it is delivered to.

request

FailedRequest

The request being answered, which decides the response type: StoreShare, VerifyShare, GetSecretIdsVersions, GetShare, Unpair, UpdateChannelInfo, or Undecodable (answered with an ErrorResponseMessage).

The only resolution is reject(action, status, memo), which sends exactly one response of the request's own type with that status and memo; passing the event's own status and memo sends what auto_respond_on_failure would have sent. accept returns InvalidInput: there is no success to send for a request that already failed. No AutoAcceptPolicy field covers it.

The token carries no shared key; the key is loaded from reply.channel_id when the response is sent.

Cross-SDK naming

Variant names follow one convention in every SDK: Rust DeRecEvent::Foo → .NET FooEvent → Go Event with Type == EventTypeFoo → TypeScript / React Native { type: "Foo", ... }. The discriminator string is the Rust variant name verbatim in every binding. All five SDKs expose the same 54 variants.

Events

Rust
.NET
Go
TypeScript / React Native

DeRecEvent::PairingCompleted

PairingCompletedEvent

EventTypePairingCompleted

{ type: "PairingCompleted" }

DeRecEvent::ReplicaPaired

ReplicaPairedEvent

EventTypeReplicaPaired

{ type: "ReplicaPaired" }

DeRecEvent::PrePairRejected

PrePairRejectedEvent

EventTypePrePairRejected

{ type: "PrePairRejected" }

DeRecEvent::PairingRefused

PairingRefusedEvent

EventTypePairingRefused

{ type: "PairingRefused" }

DeRecEvent::ShareStored

ShareStoredEvent

EventTypeShareStored

{ type: "ShareStored" }

DeRecEvent::ShareRefused

ShareRefusedEvent

EventTypeShareRefused

{ type: "ShareRefused" }

DeRecEvent::ShareConfirmed

ShareConfirmedEvent

EventTypeShareConfirmed

{ type: "ShareConfirmed" }

DeRecEvent::ShareRejected

ShareRejectedEvent

EventTypeShareRejected

{ type: "ShareRejected" }

DeRecEvent::SharingComplete

SharingCompleteEvent

EventTypeSharingComplete

{ type: "SharingComplete" }

DeRecEvent::ReplicaSecretReceived

ReplicaSecretReceivedEvent

EventTypeReplicaSecretReceived

{ type: "ReplicaSecretReceived" }

DeRecEvent::ReplicaSecretInstalled

ReplicaSecretInstalledEvent

EventTypeReplicaSecretInstalled

{ type: "ReplicaSecretInstalled" }

DeRecEvent::ReplicaVersionConflict

ReplicaVersionConflictEvent

EventTypeReplicaVersionConflict

{ type: "ReplicaVersionConflict" }

DeRecEvent::ReplicaSecretRefused

ReplicaSecretRefusedEvent

EventTypeReplicaSecretRefused

{ type: "ReplicaSecretRefused" }

DeRecEvent::ReplicaSecretAcked

ReplicaSecretAckedEvent

EventTypeReplicaSecretAcked

{ type: "ReplicaSecretAcked" }

DeRecEvent::ReplicaSyncRejected

ReplicaSyncRejectedEvent

EventTypeReplicaSyncRejected

{ type: "ReplicaSyncRejected" }

DeRecEvent::ReplicaSyncFailed

ReplicaSyncFailedEvent

EventTypeReplicaSyncFailed

{ type: "ReplicaSyncFailed" }

DeRecEvent::ReplicaSyncComplete

ReplicaSyncCompleteEvent

EventTypeReplicaSyncComplete

{ type: "ReplicaSyncComplete" }

DeRecEvent::ReplicaRemoved

ReplicaRemovedEvent

EventTypeReplicaRemoved

{ type: "ReplicaRemoved" }

DeRecEvent::ReplicaSourceChanged

ReplicaSourceChangedEvent

EventTypeReplicaSourceChanged

{ type: "ReplicaSourceChanged" }

DeRecEvent::SelfRemovedFromGroup

SelfRemovedFromGroupEvent

EventTypeSelfRemovedFromGroup

{ type: "SelfRemovedFromGroup" }

DeRecEvent::ReplicaDiscoveryComplete

ReplicaDiscoveryCompleteEvent

EventTypeReplicaDiscoveryComplete

{ type: "ReplicaDiscoveryComplete" }

DeRecEvent::ShareVerified

ShareVerifiedEvent

EventTypeShareVerified

{ type: "ShareVerified" }

DeRecEvent::ShareVerifyInvalid

ShareVerifyInvalidEvent

EventTypeShareVerifyInvalid

{ type: "ShareVerifyInvalid" }

DeRecEvent::ShareVerifyRejected

ShareVerifyRejectedEvent

EventTypeShareVerifyRejected

{ type: "ShareVerifyRejected" }

DeRecEvent::SecretsDiscovered

SecretsDiscoveredEvent

EventTypeSecretsDiscovered

{ type: "SecretsDiscovered" }

DeRecEvent::RecoveryShareReceived

RecoveryShareReceivedEvent

EventTypeRecoveryShareReceived

{ type: "RecoveryShareReceived" }

DeRecEvent::RecoveryShareRefused

RecoveryShareRefusedEvent

EventTypeRecoveryShareRefused

{ type: "RecoveryShareRefused" }

DeRecEvent::RecoveryShareCorrupted

RecoveryShareCorruptedEvent

EventTypeRecoveryShareCorrupted

{ type: "RecoveryShareCorrupted" }

DeRecEvent::RecoveryShareError

RecoveryShareErrorEvent

EventTypeRecoveryShareError

{ type: "RecoveryShareError" }

DeRecEvent::SecretRecovered

SecretRecoveredEvent

EventTypeSecretRecovered

{ type: "SecretRecovered" }

DeRecEvent::PeerNotRestored

PeerNotRestoredEvent

EventTypePeerNotRestored

{ type: "PeerNotRestored" }

DeRecEvent::ChannelInfoUpdated

ChannelInfoUpdatedEvent

EventTypeChannelInfoUpdated

{ type: "ChannelInfoUpdated" }

DeRecEvent::ChannelInfoUpdateRejected

ChannelInfoUpdateRejectedEvent

EventTypeChannelInfoUpdateRejected

{ type: "ChannelInfoUpdateRejected" }

DeRecEvent::Unpaired

UnpairedEvent

EventTypeUnpaired

{ type: "Unpaired" }

DeRecEvent::UnpairRejected

UnpairRejectedEvent

EventTypeUnpairRejected

{ type: "UnpairRejected" }

DeRecEvent::UnpairFailed

UnpairFailedEvent

EventTypeUnpairFailed

{ type: "UnpairFailed" }

DeRecEvent::PairingStarted

PairingStartedEvent

EventTypePairingStarted

{ type: "PairingStarted" }

DeRecEvent::ProtectSecretStarted

ProtectSecretStartedEvent

EventTypeProtectSecretStarted

{ type: "ProtectSecretStarted" }

DeRecEvent::ProtectSecretFailed

ProtectSecretFailedEvent

EventTypeProtectSecretFailed

{ type: "ProtectSecretFailed" }

DeRecEvent::VerifySharesStarted

VerifySharesStartedEvent

EventTypeVerifySharesStarted

{ type: "VerifySharesStarted" }

DeRecEvent::VerifySharesFailed

VerifySharesFailedEvent

EventTypeVerifySharesFailed

{ type: "VerifySharesFailed" }

DeRecEvent::DiscoveryStarted

DiscoveryStartedEvent

EventTypeDiscoveryStarted

{ type: "DiscoveryStarted" }

DeRecEvent::DiscoveryFailed

DiscoveryFailedEvent

EventTypeDiscoveryFailed

{ type: "DiscoveryFailed" }

DeRecEvent::RecoverSecretStarted

RecoverSecretStartedEvent

EventTypeRecoverSecretStarted

{ type: "RecoverSecretStarted" }

DeRecEvent::RecoverSecretFailed

RecoverSecretFailedEvent

EventTypeRecoverSecretFailed

{ type: "RecoverSecretFailed" }

DeRecEvent::UnpairStarted

UnpairStartedEvent

EventTypeUnpairStarted

{ type: "UnpairStarted" }

DeRecEvent::UpdateChannelInfoStarted

UpdateChannelInfoStartedEvent

EventTypeUpdateChannelInfoStarted

{ type: "UpdateChannelInfoStarted" }

DeRecEvent::UpdateChannelInfoFailed

UpdateChannelInfoFailedEvent

EventTypeUpdateChannelInfoFailed

{ type: "UpdateChannelInfoFailed" }

DeRecEvent::ActionRequired

ActionRequiredEvent

EventTypeActionRequired

{ type: "ActionRequired" }

DeRecEvent::AutoAccepted

AutoAcceptedEvent

EventTypeAutoAccepted

{ type: "AutoAccepted" }

DeRecEvent::RequestFailed

RequestFailedEvent

EventTypeRequestFailed

{ type: "RequestFailed" }

DeRecEvent::ErrorResponseReceived

ErrorResponseReceivedEvent

EventTypeErrorResponseReceived

{ type: "ErrorResponseReceived" }

DeRecEvent::MessageIgnored

MessageIgnoredEvent

EventTypeMessageIgnored

{ type: "MessageIgnored" }

DeRecEvent::NoOp

NoOpEvent

EventTypeNoOp

{ type: "NoOp" }

DeRecEvent is #[non_exhaustive] in Rust: match it with a fallback arm. A variant newer than a binding's own type definitions reaches it as NoOp (and .NET additionally defines UnmappedEvent for a discriminator its converter does not know).

Reason enums

The four reason enums are Rust enums and string labels everywhere else. The label is the Rust variant name.

Rust
.NET (string constants)
Go (string constants)
TypeScript / React Native (string union)

IgnoreReason::PendingVerification

IgnoreReason.PendingVerification

IgnoreReasonPendingVerification

IgnoreReason — "PendingVerification"

IgnoreReason::Expired

IgnoreReason.Expired

IgnoreReasonExpired

IgnoreReason — "Expired"

IgnoreReason::TimestampMismatch

IgnoreReason.TimestampMismatch

IgnoreReasonTimestampMismatch

IgnoreReason — "TimestampMismatch"

IgnoreReason::StaleResponse

IgnoreReason.StaleResponse

IgnoreReasonStaleResponse

IgnoreReason — "StaleResponse"

VerifyFailureReason::NoSharedKey

VerifyFailureReason.NoSharedKey

VerifyFailureReasonNoSharedKey

VerifyFailureReason — "NoSharedKey"

VerifyFailureReason::NoProof

VerifyFailureReason.NoProof

VerifyFailureReasonNoProof

VerifyFailureReason — "NoProof"

VerifyFailureReason::DispatchFailed

VerifyFailureReason.DispatchFailed

VerifyFailureReasonDispatchFailed

VerifyFailureReason — "DispatchFailed"

CorruptionReason::Malformed

CorruptionReason.Malformed

CorruptionReasonMalformed

CorruptionReason — "Malformed"

CorruptionReason::InvalidProof

CorruptionReason.InvalidProof

CorruptionReasonInvalidProof

CorruptionReason — "InvalidProof"

CorruptionReason::Inconsistent

CorruptionReason.Inconsistent

CorruptionReasonInconsistent

CorruptionReason — "Inconsistent"

NotRestoredReason::NoTransports

NotRestoredReason.NoTransports

NotRestoredReasonNoTransports

NotRestoredReason — "NoTransports"

Actions

PendingAction does not surface as a top-level discriminator in the bindings — .NET, Go, TypeScript and React Native all carry it as the opaque action payload of ActionRequired, with a string discriminator the application switches on: ActionRequiredEvent.ActionKind (.NET, compared against the PendingActionKind string constants), Event.ActionKind (Go, compared against the ActionKind* constants), and action_kind (TypeScript / React Native, typed PendingActionKind). AutoAccepted and RequestFailed use the same vocabulary; Failed appears only on RequestFailed, whose action carries a PendingAction::RespondToFailure as the same kind of opaque payload. The labels are PascalCase in every binding.

Rust

.NET ActionKind

Go ActionKind

TypeScript / React Native action_kind

PendingAction::Pairing

PendingActionKind.Pairing

ActionKindPairing

"Pairing"

PendingAction::PrePair

PendingActionKind.PrePair

ActionKindPrePair

"PrePair"

PendingAction::StoreShare

PendingActionKind.StoreShare

ActionKindStoreShare

"StoreShare"

PendingAction::VerifyShare

PendingActionKind.VerifyShare

ActionKindVerifyShare

"VerifyShare"

PendingAction::Discovery

PendingActionKind.Discovery

ActionKindDiscovery

"Discovery"

PendingAction::GetShare

PendingActionKind.GetShare

ActionKindGetShare

"GetShare"

PendingAction::Unpair

PendingActionKind.Unpair

ActionKindUnpair

"Unpair"

PendingAction::UpdateChannelInfo

PendingActionKind.UpdateChannelInfo

ActionKindUpdateChannelInfo

"UpdateChannelInfo"

PendingAction::RespondToFailure

PendingActionKind.Failed

ActionKindFailed

"Failed"

Refer to the SDK chapters for the exact field shapes and decoding helpers each binding ships.

Last updated