Skip to content

A simple PHP library for reading Bitcoin wallet.dat file.

License

Notifications You must be signed in to change notification settings

andkom/php-bitcoin-wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Bitcoin Wallet

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";
}