Closure

In graph theory, a graph comprises a set of vertices (nodes) and a set of edges (links/arrows), through which the vertices are connected. A directed acyclic graph, or DAG, is a type of graph where all of the edges are associated with a particular direction, i.e. from left to right, and link the set of vertices without forming any directed cycles such that any given vertex can follow a path that leads back to itself. A DAG can be used to model a sequence of events, where the order in which they occur can be identified by following the directed edges. A graph possesses closure if, and only if, no outgoing edge leaves a closed set of connected vertices. Now, what does any of this have to do with Leep’s DLT network?

In contrast to a traditional blockchain network, transactions that take place within the Leep network can be modelled as a DAG data structure through linking nodes that are involved in related transactions. In order to properly construct a DAG, every wallet address in the network is assigned a “home database node”, which can be represented by a vertex, and transactions between addresses form the directed edges, or arrows, of the DAG. Within the DAG data structure, dependencies between transactions, and the order in which they should occur, are clearly mapped. Moreover, in order for a DAG to be accepted by the network, and ultimately committed to the blockchain transaction record, the Leep consensus protocol stipulates closure as a requirement.

The network makes an effort to close every DAG by establishing internet connections between all database nodes that comprise the set of vertices in a given DAG, such that each node is informed about and can validate every relevant transaction that makes up a part of the graph.

While a collection of connected database nodes can themselves determine whether or not the DAG they are a part of possesses closure, an additional layer of security exists to prevent the network of database nodes from acting like a trusted system. Instead of relying solely on the database nodes of a given DAG having to reach a consensus on the validity of encapsulated transactions, the network also initiates a reverse look up mechanism to guarantee closure of the graph. This mechanism uses a pseudorandom process to select nodes, which are external to the DAG itself, that serve to query the incoming/outgoing transactions of the wallet addresses involved in the DAG and raise an exception in the event that the property of closure is not satisfied.

Although the requirement of closure may seem trivial, it is the crux of Leep’s ingenuity as it provides a very elegant and simple solution to the double spend problem — the problem that conventional blockchains solve through inefficient, or insecure/centralized consensus mechanisms. Efforts to double spend tokens will always form an edge that is directed outside of a closed set of connected nodes, and so closure of the DAG is not possible when a malicious actor attempts to double spend tokens. The following example should help to visualize why this is the case.

DAG closure examples

The above visual considers two scenarios, one in which a DAG is accepted and another, where a DAG is rejected. Vertices A, B, C and D are each database nodes, and a definite sequence of events must exist in order for the transactions to succeed, i.e. transaction Tx2_bc cannot occur until after Tx1_ab as the initial balance in the wallet of node B is insufficient to carry out transaction Tx2_bc. In both cases, a connection is established between nodes A and C, which ensures that node C is informed about transaction Tx1_ab and so the order of events in the directed sequence can be determined by each node in the DAG.

The link that joins A to C forms a closed set between nodes A, B and C. In each scenario, we are looking at a DAG data structure that models multi-party transactions, where transaction dependencies are identified in a natural manner. It should be noted that every transaction shown in the two cases above is issued from a single wallet address from its respective home database node.