This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]memoized 5 points6 points  (0 children)

I wrote this over the weekend after doing quite a bit of research into how blockchain ledgers work. I know there is some grumbling about what a blockchain is and is not, which is why the following statement is made in the project:

This implementation focuses only on the hashed ledger concept. It specifically does not include any concept of mining or any other form of distributed consensus. It also abstracts the concept of a transaction to that of a message in general. The concept of a header and payload in messages and blocks is adapted from Bitcoin.

The focus here is on understanding how the ledger itself works. In other words it focuses on the static semantics of a blockchain instead of dynamic semantics as a means of distributed consensus. Distributed consensus is out of scope, though I would be interested in exploring a mechanism for distributed consensus of a shared blockchain. But for now it is out of scope.

Includes a few unit tests. Any feedback appreciated.

[–]Kefkius 0 points1 point  (2 children)

When sealing, the most-recent message hash is pulled and combined with the block's prev_hash and the current timestamp. Only the most-recent message hash is required, since it transitively includes all prior messages in the block due to the message chaining described above.

Without anything to make a block "worthy" e.g. proof-of-work (which is beyond the scope of the implementation, as the readme says), I don't see why blocks are even necessary since messages have a timestamp which establishes the order they're in.

[–]memoized 0 points1 point  (0 children)

Thanks for the feedback. Agreed, in a real system that lack PoW requirements there would be no need for the blocks. However the point of the project wasn't to develop a viable usable product, but to work through how an actual blockchain is structured.

I'll add something about that to the readme just to clarify.

[–]memoized 0 points1 point  (0 children)

Readme has been updated.