News for hackers. Stuff that matters.
Re:Where does my computer get the time from? by r3trohack3r on Thursday October 05, 2023 @07:07PM (#37785361)
Since posting this, I've discovered that IPFS has something it calls Merkle-DAGs.

A Block-Chain is a chain of blocks where there is one valid previous block and one valid next block.

A Block-Tree is a chain of blocks where there is one single valid previous block, and multiple valid next blocks.

A Block-DAG is a chain of blocks where there are multiple valid next blocks and multiple valid previous blocks, with the constraint that you can not form cycles.

They are analogues to linked-lists, trees, and directed-acyclic-graphs but with chained hashes.

From the Merkle-DAG article on the IPFS page:

> Merkle DAGs are similar to Merkle trees, but there are no balance requirements, and every node can carry a payload. In DAGs, several branches can re-converge or, in other words, a node can have several parents.

What's interesting here is that a Merkle Tree is a valid Merkle DAG, since a node can _optionally_ include a data payload. So a blockchain, a blocktree, and a blockdag are all also Merkle-DAGs. Merkle-DAG is a kind of unifying structure that can be used to model all of them.

It's really quite clever.

https://docs.ipfs.tech/concepts/merkle-dag/

This appears to have been coined in 2014: https://github.com/jbenet/random-ideas/issues/20

However the term blockchain dates back to at least 2008.

A blockchain might be a Merkle-DAG but a Merkle-DAG is not a blockchain.

There are no comments on this comment yet.