pub struct StoreShareRequestMessage {
pub share: Vec<u8>,
pub share_algorithm: i32,
pub version: i32,
pub keep_list: Vec<i32>,
pub version_description: String,
pub timestamp: Option<Timestamp>,
}Expand description
StoreShareRequestMessage instructs a Helper to store a share for a given secret and manage the set of retained share versions.
§Context
This message is used in the sharing flow when:
- a new secret is created
- an existing secret is updated
- the helper set or recovery threshold changes
The Owner sends this message to each Helper to:
- store (or replace) a specific share version
- update the set of versions that must be retained (keepList)
§Semantics
This message may carry two independent instructions:
-
Share storage/update:
- If
shareis present, the Helper MUST store this share under the specifiedversion - If the version already exists, the Helper MUST replace it
- If
-
Retention policy update:
- If
keepListis present, it defines the complete set of versions that MUST be retained - Any stored version not in
keepListSHOULD be deleted
- If
If keepList is absent:
- The Helper MUST preserve the existing keepList
- The Helper MUST add the new
versionto the retained set
§Consistency Requirements
The Owner MUST ensure that for a given (secretId, version):
- all Helpers receive identical share contents
It is an error for different shares to be associated with the same version and secretId.
§Replay Protection
To prevent replay attacks:
- If
versionis less than the latest stored version, the Helper MUST ignore thekeepListfield
This ensures that stale messages cannot cause deletion of newer shares.
§Share Opacity
The Helper MUST treat the share field as opaque data. It is not required
to understand or validate the share contents.
§Idempotency
This message is idempotent:
- Re-sending the same (version, share) pair SHOULD result in the same state
- Re-applying the same keepList SHOULD not change state after the first time
Fields§
Share bytes to be stored by the Helper.
This is an opaque byte array produced by the share distribution algorithm. The Helper MUST store it without interpretation.
Identifier of the algorithm used to produce the share.
This allows the Owner and Helper to coordinate on how the share should be interpreted during recovery.
Algorithm 0 defines the share as a serialized CommittedDeRecShare
protobuf message (see DeRec cryptography repository).
Implementations SHOULD support algorithm 0 for interoperability.
version: i32Version number of the share.
Each resharing event increments this value. The secretId is provided in the enclosing DeRecMessage.
keep_list: Vec<i32>List of share versions that MUST be retained by the Helper.
Any stored version not included in this list SHOULD be deleted.
If absent, the Helper MUST:
- retain the existing keepList
- add the current
versionto the retained set
This field MUST be ignored if version is older than the latest
version already stored, to prevent replay attacks.
version_description: StringOptional human-readable description of this share version.
This field is visible to the Helper and is not intended to carry sensitive information. It may be used for debugging, labeling, or user-facing display.
timestamp: Option<Timestamp>Timestamp indicating when this message was created.
Used for observability, replay detection, and timeout handling.
Trait Implementations§
Source§fn clone(&self) -> StoreShareRequestMessage
fn clone(&self) -> StoreShareRequestMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.