Download the PHP package blocker/bip39 without Composer
On this page you can find all versions of the php package blocker/bip39. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blocker/bip39
More information about blocker/bip39
Files in blocker/bip39
Package bip39
Short Description Easy to use, multi-language BIP39 implementation for PHP.
License MIT
Informations about the package bip39
PHP BIP39
An easy to use, multilingual, stand alone, and blockchain independent implementation of the **BIP39 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.
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:
Standard composer installation:
3. Concepts:
While implementing this library in your projects, you will need to understand some key factors:
3.1. 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:
or, if you want to generate some data to then create a private key, one could:
3.2. Encoding and Decoding.
Just as simple as using the entropy, parsing from entropy into a word sequence and vice versa is really easy:
And, just as easy as encoding:
Easy right?
3.3. Supported Languages:
- [en] English
- [es] Spanish
- [fr] French
- [it] Italian
- [ja] Japanese
- [ko] Korean
- [zh] Chinese (Simplified).
Just use the language locale on the Bip39 constructor:
3.4. Special Features.
As mentioned earlier, this library was built with education also in mind, so, there's a buffered binary operations class, classed BitBuffer
and some utils that will help you understand a lot of different concepts.
Good Leaning!