PHPackages                             akondas/php-blockchain - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. akondas/php-blockchain

ActiveLibrary

akondas/php-blockchain
======================

Minimal working blockchain implemented in PHP

1.1.0(3y ago)1604450[1 issues](https://github.com/akondas/php-blockchain/issues)MITPHPPHP ^8.1

Since Mar 14Pushed 3y ago13 watchersCompare

[ Source](https://github.com/akondas/php-blockchain)[ Packagist](https://packagist.org/packages/akondas/php-blockchain)[ RSS](/packages/akondas-php-blockchain/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Blockchain implementation in PHP
================================

[](#blockchain-implementation-in-php)

[![Minimum PHP Version](https://camo.githubusercontent.com/183804d09fec16ca7b6209b007250b7d8db1b915042feb093a9f20e6e1f25359/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d3838393242462e737667)](https://php.net/)[![Build](https://github.com/akondas/php-blockchain/actions/workflows/build.yaml/badge.svg)](https://github.com/akondas/php-blockchain/actions/workflows/build.yaml)[![License](https://camo.githubusercontent.com/9774a329f95168a2d6292e39f739d112f51d0157fc6169097ecde2feea70ee33/68747470733a2f2f706f7365722e707567782e6f72672f616b6f6e6461732f7068702d626c6f636b636861696e2f6c6963656e73652e737667)](https://packagist.org/packages/akondas/php-blockchain)

Clean code approach to blockchain technology. Learn blockchain by reading source code.

Roadmap
-------

[](#roadmap)

- Block structure and hashing
- Genesis block
- Storing and validate Blockchain
- Proof of Work with difficulty (missing consensus on the difficulty)
- Communicating with other nodes &amp; controlling the node (based on ReactPHP)
- Simple persistence layer
- Going serverless with AWS Lambda (experiment)
- Start working on KondasCoin [akondas/coin](https://github.com/akondas/coin) 🚀 (Transactions, Wallet, Transaction relaying, Maybe some UI)

Node
----

[](#node)

To start the node:

```
bin/node

```

Default web server port is 8080 but you can change it with `--http-port` param:

```
bin/node --http-port=9090

```

Default p2p server port is 3030 but you can change it with `--p2p-port` param:

```
bin/node --p2p-port=2020

```

API
---

[](#api)

To control node you can use simple (pseudo) REST API:

**\[GET\] /blocks**Response (list of all blocks):

```
[{"index":0,"hash":"8b31c9ec8c2df21968aca3edd2bda8fc77ed45b0b3bc8bc39fa27d5c795bc829","previousHash":"","createdAt":"2018-02-23 23:59:59","data":"PHP is awesome!","difficulty":0,"nonce":0}]

```

**\[POST\] /mine**Request (raw):

```
Data to mine (any string).

```

Response (mined block):

```
{"index":1,"hash":"a6eba6325a677802536337dc83268e524ffae5dc7db0950c98ff970846118f80","previousHash":"8b31c9ec8c2df21968aca3edd2bda8fc77ed45b0b3bc8bc39fa27d5c795bc829","createdAt":"2018-03-13 22:37:07","data":"Something goof","difficulty":0,"nonce":0}

```

**\[GET\] /peers**Response (list of all connected peers):

```
[{"host":"127.0.0.1","port":3131}]

```

**\[POST\] /peers/add**Request (json with peer):

```
{"host":"127.0.0.1", "port":"3131"}

```

Response: 204 (empty)

Tests
-----

[](#tests)

To run test suite:

```
composer tests

```

Coding standards
----------------

[](#coding-standards)

Checkers and fixers are in `coding-standard.neon`. To run:

```
composer fix-cs

```

License
-------

[](#license)

php-blockchain is released under the MIT Licence. See the bundled LICENSE file for details.

Author
------

[](#author)

Arkadiusz Kondas (@ArkadiuszKondas)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~765 days

Total

3

Last Release

1448d ago

Major Versions

0.1.0 → 1.0.02022-05-22

PHP version history (3 changes)0.1.0PHP ^7.2

1.0.0PHP ^8.0

1.1.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d00e1e73a4ff379162b943421469055929a95e7a6ce4c3808976dcc1fa28f4f?d=identicon)[akondas](/maintainers/akondas)

---

Top Contributors

[![akondas](https://avatars.githubusercontent.com/u/8239917?v=4)](https://github.com/akondas "akondas (27 commits)")

---

Tags

blockchainphpphp-blockchain

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/akondas-php-blockchain/health.svg)

```
[![Health](https://phpackages.com/badges/akondas-php-blockchain/health.svg)](https://phpackages.com/packages/akondas-php-blockchain)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

41.5k328.9k1](/packages/ccxt-ccxt)[ergebnis/php-cs-fixer-config

Provides a configuration factory and rule set factories for friendsofphp/php-cs-fixer.

692.9M162](/packages/ergebnis-php-cs-fixer-config)[clue/docker-react

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.

113154.9k1](/packages/clue-docker-react)[discord-php/http

Handles HTTP requests to Discord servers

25318.7k8](/packages/discord-php-http)[clue/reactphp-eventsource

Instant real-time updates. Lightweight EventSource client receiving live messages via HTML5 Server-Sent Events (SSE). Fast stream processing built on top of ReactPHP's event-driven architecture.

5818.5k3](/packages/clue-reactphp-eventsource)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
