{"id":20346025,"url":"https://github.com/andkom/php-bitcoin-blockchain","last_synced_at":"2025-10-11T22:21:52.967Z","repository":{"id":56947744,"uuid":"148055992","full_name":"andkom/php-bitcoin-blockchain","owner":"andkom","description":"A simple PHP library for reading Bitcoin blockchain database.","archived":false,"fork":false,"pushed_at":"2019-12-14T14:11:47.000Z","size":76,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T00:42:42.858Z","etag":null,"topics":["bitcoin","bitcoin-blockchain","bitcoin-blocks","bitcoin-protocol","php","php-library"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andkom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-09T18:55:13.000Z","updated_at":"2025-03-08T01:37:27.000Z","dependencies_parsed_at":"2022-08-21T08:20:09.358Z","dependency_job_id":null,"html_url":"https://github.com/andkom/php-bitcoin-blockchain","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andkom%2Fphp-bitcoin-blockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andkom%2Fphp-bitcoin-blockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andkom%2Fphp-bitcoin-blockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andkom%2Fphp-bitcoin-blockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andkom","download_url":"https://codeload.github.com/andkom/php-bitcoin-blockchain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501959,"owners_count":21114681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","bitcoin-blockchain","bitcoin-blocks","bitcoin-protocol","php","php-library"],"created_at":"2024-11-14T22:11:01.721Z","updated_at":"2025-10-11T22:21:47.917Z","avatar_url":"https://github.com/andkom.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PHP Bitcoin Blockchain Parser\n\nA PHP implementation of Bitcoin blockchain database parser.\n\n### Features:\n\n- Parse unordered block data\n- Parse ordered block data\n- Parse block index\n- Parse chain state (UTXO database)\n\n### Requirements\n\n- PHP \u003e= 7.1\n- Bitcoin Core \u003e= 0.15.1\n- leveldb \u003e= 1.20\n- php-leveldb \u003e= 0.2.1\n- php-gmp \u003e= 7.1\n\n### Installation\n\n```\ncomposer require andkom/php-bitcoin-blockchain\n```\n\n### Examples\n\n```php\n$databaseReader = new DatabaseReader('/path/to/bitcoin');\n\n// read ordered blocks\nforeach ($databaseReader-\u003ereadBlocks() as $block) {\n}\n\n// read unordered blocks\nforeach ($databaseReader-\u003ereadBlocksUnordered() as $block) {\n}\n\n// read UTXO \nforeach ($databaseReader-\u003egetChainstate()-\u003eread() as $utxo) {\n}\n\n// get block by hash\n$block = $databaseReader-\u003egetBlockByHash('binary hash in little endian'); \n\n// get block by height\n$block = $databaseReader-\u003egetBlockByHeight(12345);\n\n// get best block hash\n$hash = $databaseReader-\u003egetChainstate()-\u003egetBestBlock();\n```\n\nSee more examples in the examples dir.\n\n### LevelDB installation\n\nUbuntu/Debian:\n\n```bash\napt-get install libleveldb-dev\npecl install leveldb-0.2.1\n```\n\nMac OS:\n\n```bash\nbrew install leveldb\npecl install leveldb-0.2.1\n```\n\nOr compile from source:\n\n```bash\ngit clone https://github.com/google/leveldb.git\ncd leveldb\nmkdir -p build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release .. \u0026\u0026 cmake --build .\nmake install\ncd ../../\ngit clone https://github.com/reeze/php-leveldb.git\ncd php-leveldb\nphpize\n./configure --with-leveldb\nmake\nmake install\n```\n\nMake sure you've enabled leveldb.so extension in your php.ini.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandkom%2Fphp-bitcoin-blockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandkom%2Fphp-bitcoin-blockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandkom%2Fphp-bitcoin-blockchain/lists"}