Versions

Versions are immutable nodes with history, which underlie virtual mutable nodes, braids. In addition to the encrypted data and a set of references, they hold a list of up to 16 parent versions.

#![allow(unused)]
fn main() {
struct Version {
  data: Ciphertext,
  referencess: ReferenceSet,
  parents: CappedVec<16,VersionSignature>,
}
}

Serialization

Versions are serialized using atlv, as an array of those three fields, using the tag 1. The references must be listed in lexicographic order. As an example, a 128 byte ciphertext with a single reference to another braid and a single parent:

offsetbytesdescription
0081the tag (1) of a version
0143the array header (3 elements)
02c1 00the binary header for the ciphertext (128 bytes)
03…82...the ciphertext
8341the array header of the references (1 element)
8482the tag (2) of a Braid Public Key Reference
8581the tag (1) of a Schnorr-Ristretto255-Blake3 public key
8620the binary header for the public key (32 bytes)
87…a6...the content of the Schnorr-Ristretto255-Blake3 public key
a741the array header of the parents (1 element)
a881the tag (1) of a Schnorr-Ristretto255-Blake3 signature
a930the binary header for the signature key (48 bytes)
aa…d9...the content of the Schnorr-Ristretto255-Blake3 signature

References

There are two types of references to versions:

  • "Version Signature References" are produced by initializing a [deterministic signature] with a private key and the domain "Version Node Subscriptions: Reference: Version: Signature", feeding in the ciphertext, demarcating, feeding the serialized list of references, feeding the serialized list of parents, and finalizing.

  • "Braid Public Key References" are the public key corresponding to the public key used to sign the set of versions.

Summaries

Version Summaries are records of versions that elide the contained data.

#![allow(unused)]
fn main() {
struct VersionSummary {
  state: VerifyState,
  references: ReferenceSet,
  parents: Vec<VersionSignature>,
}
}

The verification state for a Version Summary is produced by initializing a [deterministic signature] with a public key and the domain "Version Node Subscriptions: Reference: Version: Signature", feeding in the ciphertext, and then extracting the state,

The reference for a Version may be verified from its Summary, by injecting the preserved verification state, feeding the serialized list of references, feeding the serialized list of parents, and finalizing.

Cryptography

Encryption

The ciphertext held within a Version is produced with using deterministic authenticated encryption with associated data, with a domain of "Versioned Node Subscriptions: Version Encryption". The associated data is the concatenation of:

  1. the serialized public key of the braid
  2. the serialized set of references
  3. the serialized list of parent versions

(In the above example, the second two correspond to the bytes 0x83 to the end.)

Analysis

Deterministic authenticated encryption with associated data is subject to chosen plaintext attacks, however, this is significantly mitigated by the entire history of the version being represented in the associated data. In order to identify a ciphertext, the attacker must have access to a different oracle for each guess at the plaintext.