**Introduction**

*Topology:* “an area of mathematics concerned with the properties of space that are preserved under continuous deformations, such as stretching and bending, but not tearing or gluing” (from Wikipedia). It has been puzzling children and mathematicians alike since the discovery of the Seven Bridges Problem and Möbius strips.

A map is a great example of a *topological space*. If you draw the latitudinal and longitudinal lines on a globe, it will still work if it becomes dented, or expands or contracts in size. If you disassemble and project it onto a 2D surface, however, the image will always be distorted.

As the digital era advances, topology is growing even more abstract. Topological data analysis can take data and map it to a 3D space, giving it a visible form. Network topology involves the shape of a digital network, and how the points connect.

Now, a new branch is emerging, closely related to both of the aforementioned. We’ll call it *blockchain topology*; it may inevitably be broadened to something more like *Merkle*,* crypto*, or* data topology*, but will suffice as a working term, for now.

Blockchains are perfect for topological study: they are spaces for the storage of data. This data comes in *sets*, which are arranged in branching structures and evolve in response to real-world factors that we can analyze once defined.

**Fundamentals**

Blockchains are essentially made of *Merkle trees*, a type of data structure named after their inventor. They rely on a mathematical process called *hashing*–an irreversible function–and are essential to the operation of the Bitcoin protocol.

In addition to inventing the public/private key pairs on which all Bitcoin wallets rely, Merkle came up with a way to distill any set of data to a single hash value called the *Merkle root*. Although you cannot reclaim any data from the root, it’s easy to prove whether a piece of information was used to produce that number.

A Merkle tree takes all of the data pieces and hashes them together two at a time, eventually coalescing in the Merkle root at the top. A Bitcoin block uses the root of the previous block as one of its “leaves,” along with all the transactions its miner chose to include.

In this manner, a blockchain forms a giant Merkle structure composed of many trees linked together. Its shape is impacted by protocol updates, interactions with other blockchains, and market forces in the cryptocurrency mining/minting industry.

**Topological Spaces**

As alluded to before, blockchains can be thought of as topological spaces if we arrange their constituent data into sets. We’ll not bother casual readers with the math, for now, but we can still learn a lot by employing related topological terminology.

A topology on a set describes the relationship between its elements. In the blockchain’s case, it illustrates the structure that forms when we connect them in the order that they were calculated. It doesn’t matter how we draw the connecting lines, practically speaking–they only need to connect to the right data pieces, giving the blockchain invariant topological properties.

The space generated is an example of a metric space, meaning the distance between every element is defined by a *metric* (the 3D world you live in is a good example). The blockchain’s metric is *difficulty*, a term coined by Bitcoin miners which will prove important to blockchain topology.

Difficulty usually refers to the chance of successfully mining or minting a block; it can also be applied in the context of a double-spend attack, with difficulty increasing as the transaction gains confirmations. At the intra-block level, brute-force attacking a Merkle tree to get a hash value in reverse (currently impossible) becomes more difficult with the number of steps taken.

**Functions and Definitions**

A blockchain’s *metric function* is therefore the one which calculates the difficulty of finding the input data point from the output for any two points on the chain. It is absolute, since it should not matter whether we are measuring forward or backwards in time along the chain. If the blockchain forks, the distance between points on separate prongs is taken along the path joining them, backward then forward again.

The difficulty function is *continuous*: it increases exponentially with the number of hashes performed, in a gradual slope without any jumps, asymptotes, or open points. The hash function itself is discontinuous, however, since changes in input yield drastic and unpredictable changes in output.

The blockchain is always *connected*, however, in the topological sense. There are no 0 elements in its data set, or else they would hash to themselves (zero). There would be a missing link in the blockchain, and its topological space would fall apart. Blockchains are also *compact*, having boundaries consisting of the most recent block’s root hash and all of its leaves.

This establishes the basics of blockchain topology, without getting into rigorous formal definitions. Now that the terminology is clear, we can make and examine some hypotheses about blockchain technology that can be tested or proven. Such will be the purpose of the following articles.

*This article was reviewed for accuracy by Piotr Piasecki who completed his Masters in Bitcoin in Poland, and Alireza Beikverdi, who is pursuing his in South Korea. Special thanks to artist Ram Reva!*

Topology: “an area of mathematics concerned with the properties of space that are preserved under continuous deformations, such as stretching and bending, but not tearing or gluing” (from Wikipedia). It has been puzzling children and mathematicians alike since the discovery of the Seven Bridges Problem and Möbius strips .

A map is a great example of a topological space . If you draw the latitudinal and longitudinal lines on a globe, it will […]