jurruh/blockchain

There is no license information available for the latest version (0.0.1) of this package.

0.0.1 2017-12-09 18:05 UTC

This package is not auto-updated.

Last update: 2025-08-17 07:52:23 UTC


README

This repository contains a basic PHP blockchain implementation.

Example usage:

//Create the chain
$chain = new \Blockchain\Chain();

//Add some blocks to te chain
$firstBlock = new \Blockchain\Block(0, null, time(), 'Example data 1');
$chain->addBlock($firstBlock);

$secondBlock = new \Blockchain\Block(1, $firstBlock->getHash(), time(), 'Example data 2');
$chain->addBlock($secondBlock);

//Check if valid
if($chain->isValid()){
    //The chain is valid
}