There is currently a lot of excitement around cryptocurrencies, with many making it rich and many more hoping to get rich quick. While speculating on cryptocurrencies is fun and (currently) profitable, cryptocurrencies are only part of the story of what makes this next technological innovation so ground-breaking.
At the heart of cryptocurrencies lies the concept of a blockchain, which, as the name implies, chains a number of blocks together, one after the other, with each block holding information whether transactions, smart contracts, data structures or anything else which needs to record something in an immutable way.
While revolutionary, the concept of the blockchain is quite simple; it is really just a linked list data structure. And it’s very easy to develop your own blockchain in pretty much any programming language you can think of.
Currently the implementation is very basic but it highlights the principles of a block chain; blocks can hold arbitrary data, are linked together via a blockchain and cannot be changed without corrupting the entire chain. I have also added basic mining to demonstrate the concept of proof-of-work.
Future developments on the PHP Blockchain roadmap might include:
- Distributed architecture
This is an open source project aimed at PHP programmers who wish to build a PHP-specific blockchain, so feel free to fork the code, make your own changes and contribute them back.
Some additional material for working with blockchains:
Python-focussed blockchain development with transaction and consensus coding examples.
Information about merkle trees which form the basis of transaction management.
The bitcoin code. While is C++ it is quite easy to follow the overall structure of a blockchain-based crypotcurrency.