PHPackages                             blocker/bip39 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. blocker/bip39

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

blocker/bip39
=============

Easy to use, multi-language BIP39 implementation for PHP.

0.10.0(7y ago)142.6k11MITPHPPHP &gt;=7.1.0

Since Mar 20Pushed 7y ago2 watchersCompare

[ Source](https://github.com/blocker-solutions/bip39)[ Packagist](https://packagist.org/packages/blocker/bip39)[ RSS](/packages/blocker-bip39/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

PHP BIP39
=========

[](#php-bip39)

[![Latest Stable Version](https://camo.githubusercontent.com/a33ca02bc2dd4366a5e92dfe9c03a4f1255fde569214b05b0ba74d515513cf11/68747470733a2f2f706f7365722e707567782e6f72672f626c6f636b65722f62697033392f762f737461626c65)](https://packagist.org/packages/blocker/bip39)[![License](https://camo.githubusercontent.com/173d594b5f83fba28397abd37e24e8ad30ae39b18e7a9f7459d980bb1a1bca4d/68747470733a2f2f706f7365722e707567782e6f72672f626c6f636b65722f62697033392f6c6963656e7365)](https://packagist.org/packages/blocker/bip39)

An easy to use, multilingual, stand alone, and blockchain independent implementation of the \*\*[BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) proposal for PHP.

This library allows encoding and decoding data, on the 128-256 bit range into Mnemonic word lists.

Have you ever used a local Bitcoin wallet? remember those 12 words you type to backup your private key? This library allows that functionality on PHP.

1. Background.
--------------

[](#1-background)

This library was built with both, production usage readiness and conceptual learning in mind.

It means all code is over commented with detailed information about each single aspect of encoding and decoding BIP39 word sequences.

2. Install:
-----------

[](#2-install)

Standard composer installation:

```
composer require blocker/bip39
```

3. Concepts:
------------

[](#3-concepts)

While implementing this library in your projects, you will need to understand some key factors:

### 3.1. Entropy:

[](#31-entropy)

On this library implementation, we call entropy a given set of data, which bits are within the 128 bit to 256 bit.

This means, for example, that you may generate a 256 bit private key for `ECDSA`, and allow your users to encode this random, hard to remember key into a set of words.

Ways for obtaining entropy:

If you already have a value you want to encode:

```
