Code Monkey home page Code Monkey logo

bitcoin-utility's Introduction

bitcoin-utility

This repository contains a simple extendable PHP console utility.

The purpose of this utility is provide to you full control on your own Bitcoins without external wallets.

You can generate new Bitcoin address with keys stored in strangely named archive (wallet), encrypted with password. Then you can see some basic info on your address and transactions corresponding with this address, or transfer some BTC to another address, providing amount and fee yourself (don't forget to remember the password to your wallet - there is no way to restore it).

Dependencies

Requires PHP version 7.x because of https://github.com/Bit-Wasp/bitcoin package requirements.

Depends on https://blockchain.info web resource functionality via https://github.com/blockchain/api-v1-client-php package.

Install

Download this project and inside its directory execute

composer install

Usage

php bin/console wallet create --file=<<<Path to wallet>>>
- create the private/public keys for new Bitcoin address and store them in a regular archive (wallet), encrypted with password

php bin/console wallet address --file=<<<Path to wallet>>>
- obtain the Base58 Bitcoin address from the wallet

php bin/console wallet info --file=<<<Path to wallet>>>
- obtain basic information about Bitcoin address from the wallet and transactions corresponding with it

php bin/console address <<<Base58 address>>>
- obtain basic information about Bitcoin address and transactions corresponding with it

php bin/console transaction <<<Transaction hash>>>
- obtain basic information about Bitcoin transaction

php bin/console transfer --file=<<<Path to wallet>>> --to=<<<Base58 address>>> --amount=<<<Amount>>> --fee=<<<Fee>>>
- perform P2PKH payment from Bitcoin address in your wallet to another address, amount and fee in format like 0.00000000

extra option --out==<<<Path to log>>> redirect console output to the file

Extending the implementations

BitcoinClientInterface - defines the functions to access Bitcoin network

  • now via blockchain/blockchain package

CredentialsInterface - contains credentials to access the wallet

  • now the password is enough to access the archive
  • may be the keys, fingers ot retina in the future :)

CredentialsProviderInterface - provides credentials to access the wallet

  • now reading the password from Win/Unix console
  • may be getting from the form in web application in the future

WalletInterface - contains keys for Bitcoin address

WalletProviderInterface - provides access to wallet with keys

  • now zip archive in file system, encrypted with password
  • may be special key storage, DB or QR-code in the future

RendererInterface - outputs program results to user

  • now writing to STDOUT or file
  • may be using HTML or template engine like TWIG in the future

bitcoin-utility's People

Contributors

qwatos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.