andkom / php-bitcoin-wallet
A simple PHP library for reading Bitcoin wallet.dat file.
2.1.0
2022-10-16 11:58 UTC
Requires
- php: ^7.1
- andkom/php-bcdatastream: ^1.1
- andkom/php-berkeley-db: ^1.1
Requires (Dev)
- phpunit/phpunit: >=5.0
This package is auto-updated.
Last update: 2025-03-16 17:14:03 UTC
README
A simple PHP library for reading Bitcoin wallet.dat file.
Installation
composer require andkom/php-bitcoin-wallet
Usage
<?php use AndKom\Bitcoin\Wallet\Wallet; // create wallet instance $wallet = new Wallet(); $wallet->read("/path/to/wallet.dat"); // check if wallet is encrypted if ($wallet->isEncrypted()) { // print wallet master key echo $wallet->getMasterKey()->getEncryptedKey() . "\n"; // decrypt wallet $wallet->decrypt("password"); } // print stored keys foreach ($wallet->getKeys() as $key) { echo $key->getPrivateKey()->toWif() . " => " . $key->getPublicKey()->getAddress()->getAddress() . "\n"; }