pub struct BranchV0 {
pub id: PubKey,
pub crdt: BranchCrdt,
pub repo: ObjectRef,
pub root_branch_readcap_id: ObjectId,
pub topic: PubKey,
pub topic_privkey: Vec<u8>,
pub pulled_from: Vec<u8>,
pub metadata: Vec<u8>,
}
Expand description
Branch definition
First commit in a branch, signed by branch key In case of a fork, the commit DEPS indicate the previous branch heads, and the ACKS are empty.
Can be used also to update the branch definition when users are removed In this case, the total_order quorum is needed, and DEPS indicates the BranchCapRefresh commit
Fields§
§id: PubKey
Branch public key ID
crdt: BranchCrdt
§repo: ObjectRef
Reference to the repository commit
root_branch_readcap_id: ObjectId
object ID of the current root_branch commit (ReadCap), in order to keep in sync this branch with root_branch The key is not provided as external readers should not be able to access the root branch definition. it is only used by verifiers (who have the key already)
topic: PubKey
Pub/sub topic for publishing events
topic_privkey: Vec<u8>
topic private key (a BranchWriteCapSecret), encrypted with a key derived as follow BLAKE3 derive_key (“NextGraph Branch WriteCap Secret BLAKE3 key”, RepoWriteCapSecret, TopicId, BranchId ) so that only editors of the repo can decrypt the privkey For individual store repo, the RepoWriteCapSecret is zero
pulled_from: Vec<u8>
optional: this branch is the result of a pull request coming from another repo. contains a serialization of a ReadBranchLink of a transactional branch from another repo
metadata: Vec<u8>
App-specific metadata