Basic Blockchain implementation in JAVA. This code can be reformatted to any other language. This Blockchain consist in only three blocks. Is a must to understand that the more blocks there are, the more confirmed are the previous because you will have to hack every block until the last.
There are some things missing in this project:
- There is no signature in the blocks.
- There is no nonce.
- Transactions are not really accurate.
- And so on...
The code is inside src folder.
The blockchain and its behaviour is defined here.
Also, genesis block (first block of blockchain) is coded here.
Block is defined as an object and will consist of three elements:
- List of transactions
- Previous Hash
- Hash
Number of transactions can be different in each block.
UNDERSTANDING BLOCKCHAIN