Download the PHP package dan-da/hd-wallet-addrs without Composer

On this page you can find all versions of the php package dan-da/hd-wallet-addrs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hd-wallet-addrs

hd-wallet-addrs

A command-line tool for finding bitcoin hd-wallet addresses that have received funds.

This tool does two primary things:

  1. derive hd-wallet addresses (both change and receive) according to bip32 rules.
  2. examines the blockchain to find the addresses that have actually been used. (received funds at least once)

A web frontend for this tool is available at: https://mybitprices.info/hd-wallet-addrs.html

Both regular HD wallets (single address) and multi-sig wallets (eg Copay) are supported.

Segwit addresses are generated if a ypub or zpub key is provided. (ypub: segwit-p2sh, zpub: bech32)

Reports are available in json, plaintext, and html. Columns can be changed or re-ordered via command-line.

hd-wallet-addrs is general purpose for anyone needing to discover which addresses are actually used in their wallet, including change addresses.

The motivation for building this tool was to simplify extracting used wallet addresses for accounting purposes. In particular for use with:

See also: hd-wallet-derive -- a tool that derives bip32 addresses and private keys.

Let's see some examples.

We can change up the fields and specify to use bip44 derivation to generate an absolute path.

Tip: The abspath column is empty when --derivation=relative, which is the default.

Or get a list for easy copy/paste.

Or JSON

Or CSV

multi-sig examples.

So far multi-sig has been tested with copay (bip44 and bip45) only. Older versions of Copay using bip45 require the --derivation=copaylegacy flag.

multisig requires multiple xpub keys and use of the --numsig flag to indicate the required number of signers. (m of n)

discovering an empty Copay 1.6.3+ (bip44) 2 of 3 wallet.

This test wallet has no funds, so we use --include-unused to obtain the initial addresses up to the gap limit. The gap limit default is 20, but we use 2 here for brevity.

discovering an empty Copay 1.1.x (bip45) 1 of 1 wallet.

Legacy versions of Copay used bip45 in a special way that the tool cannot detect without help.

Note the use of --derivation=copaylegacy

(Copay 1.6.3+ 1 of 1 wallets use bip44 derivation and do not require any special arguments.)

Warning for users of Copay 1.6.2 and below

Older Copay versions made it possible to generate gaps larger than 20. This is because it would generate a new address each time the receive screen was viewed and did not respect the standard gap-limit of 20.

Checking only 20 addresses could possibly leave you without discovering funds. If you suspect this may be happening, a workaround is to specify a larger gap limit such as 100 via the gap-limit argument.

discovering an empty Copay 1.1.x (bip45) 2 of 2 wallet.

Again we must use --derivation=copaylegacy

How discovery works

In plain english, discovery works by mathematically deriving the addresses for your wallet in order and checking if each one has been used or not.

A slightly more technical description of the process:

Privacy implications

An important thing to recognize is that unless you are running a toshi or insight server locally, the discovery process will send your public addresses to a third party. ie: BlockChain.info, BitPay (insight), or CoinBase (toshi)

The third party will have no way to spend your funds.

The third party could track your requests and guess/assume that your addresses are associated with your IP, or are associated with eachother.

If that is something you care about, then you should investigate how to run toshi or insight locally and use the --toshi or --insight flags to specify the local server URL.

There is now a feature that helps to improve privacy when using third-party API servers. The --api=roundrobin flag will cycle through the available blockchain providers and send individual addresses to each. In this way, no single provider will have access to all the queried wallet addresses.

Querying for individual addresses is slow. The --batch-size flag may be used to increase the number of addresses sent to each provider.

Use at your own risk.

The author makes no claims or guarantees of correctness.

Output formats

The report may be printed in the following formats:

Additionally, the report may contain incoming transactions only, outgoing transactions only, or both types.

Usage

Installation and Running.

PHP's gmp extension is required. Here's how to install on ubuntu.

Basics

Try an example

Or to hide log messages

Run Test cases

It is really slow to generate keys in PHP. For a huge speedup, you can install the secp256k1 extension from:

https://github.com/Bit-Wasp/secp256k1-php

Blockchain API provider notes.

tip! use the --api flag to switch between blockchain API providers.

Each API has strengths and weaknesses. Some are faster than others, or easier/harder to run locally. The blockchain.info service is recommended because it presently has the fastest API, and it is the default.

For best privacy, one should query an oracle that is running locally. Esplora, Insight, toshi, and btcd can be operated this way.

blockchain.info

as of 2024-06-03: tested WORKING.

as of 2015-12-30:

esplora (by blockstream.info)

as of 2024-6-03: tested WORKING.

as of 2019-08-06:

btc.com

as of 2024-6-03: tested NOT WORKING.

as of 2019-08-06

as of 2018-07-23:

bitcoin-core

as of 2019-08-06:

as of 2015-12-30:

blockcypher.com

as of 2024-6-03: tested NOT WORKING.

as of 2018-07-23:

Insight

as of 2024-06-03: tested NOT WORKING.

as of 2019-08-06

as of 2015-12-30:

blockr.io

as of 2017-09-04:

as of 2016-02-16:

btcd

as of 2017-05-21:

as of 2015-12-30:

Toshi

as of 2019-08-06:

as of 2017-05-21:

as of 2015-12-30:

Embed in your own PHP project

Here's a quick example how you one can access the API directly without invoking the CLI program.

in your project's composer.json:

yourproject.php

Thanks

A big thank-you to the author of bitwasp/bitcoin-php. This library does the heavy lifting of dealing with deterministic keys and multisig, amongst other things.

Todos


All versions of hd-wallet-addrs with dependencies

PHP Build Version
Package Version
Requires protonlabs/bitcoin Version ^1.0.10
dan-da/strictmode-php Version ^1.0.2
ext-json Version *
php Version >=8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dan-da/hd-wallet-addrs contains the following files

Loading the files please wait ....