Network Protocol

Common Structures

Event ID

Is blake3::Hash of the event, we use those IDs to request and reply events and tips (tips being childless events in the graph).

Event

Representation of an event in the Event Graph. This is either sent when a new event is created, or in response to EventReq.

DescriptionData TypeComments
timestampu64Timestamp of the event
contentVec<u8>Content of the event
parents[blake3::Hash; N_EVENT_PARENTS]Parent nodes in the event DAG
layeru64DAG layer index of the event

Events could have multiple parents, N_EVENT_PARENTS is the maximum number of parents an event could have.

Receiving an event with missing parents, the node will issue EventReq requesting the missing parent from a peer.

P2P Messages

EventPut

This message serves as a container of the event being published on the network.

DescriptionData TypeComments
EventPutEventEvent data.

EventReq

Requests event data from a peer.

DescriptionData TypeComments
EventReqEventIdRequest event using its ID.

EventRep

Replys back the requested event's data.

DescriptionData TypeComments
EventRepEventReply event data.

TipReq

Requests tips from connected peers. We use this message as first step into syncing asking connected peers for their DAG's tips.

TipRep

Replys back our DAG tips' IDs.

DescriptionData TypeComments
TipRepVec<EventId>Event IDs.