Convert your BIP39 mnemonic to colors and vice versa
Convert your BIP39 mnemonic to colors and vice versa
Test the tool: https://enteropositivo.github.io/bip39colors/
NEVER USE ANY ONLINE TOOL WITH YOUR REAL SEED, use it only offline (see below)
Also you can clone this repo and use the provided libraries with your favourite language
You can use the javascript library with your browser based project or with NodeJS
let mnemonic = 'master milk advice kid insect siege riot arrive alcohol mutual mask stay';
// Convert mnemonic phrase to colors
if(BIP39Colors.fromSeed(mnemonic) ){
console.log(BIP39Colors.colors);
/* outputs:
['#01AB63', '#225531', '#3E8775', '#613911', '#7C5809', '#98BDC1', '#B8E412', '#E3AFE8']
*/
console.log(BIP39Colors.colorPalette);
/* outputs colors sorted as color palette:
['#613911', '#7C5809', '#B8E412', '#225531', '#01AB63', '#3E8775', '#98BDC1', '#E3AFE8']
*/
console.log(BIP39Colors.wordPositions);
/* outputs bip39 mnemonic words as their positions inside BIP39 word list :
[1094, 1125, 33, 979, 937, 1601, 1490, 101, 49, 1170, 1092, 1704]
*/
}else{
// Show current error
console.log(BIP39Colors.getError());
}
let colors = ['#613911', '#7C5809', '#B8E412', '#225531', '#01AB63', '#3E8775', '#98BDC1', '#E3AFE8'];
if( BIP39Colors.toSeed(colors.join(' ')) ){
console.log(BIP39Colors.seed);
/* outputs:
"master milk advice kid insect siege riot arrive alcohol mutual mask stay"
*/
}else{
// Show current error
console.log(BIP39Colors.getError());
}
Add the library /python/bip39colors.py to your project
from bip39colors import *
# Convert mnemonic phrase to colors
mnemonic = "master milk advice kid insect siege riot arrive alcohol mutual mask stay"
if BIP39Colors.fromSeed(mnemonic):
print(BIP39Colors.colors)
# outputs:
#['#01AB63', '#225531', '#3E8775', '#613911', '#7C5809', '#98BDC1', '#B8E412', '#E3AFE8']
print(BIP39Colors.colorPalette())
# outputs colors sorted as color palette:
#['#613911', '#7C5809', '#B8E412', '#225531', '#01AB63', '#3E8775', '#98BDC1', '#E3AFE8']
print(BIP39Colors.wordPositions)
# outputs bip39 mnemonic words as their positions inside BIP39 word list :
# [1094, 1125, 33, 979, 937, 1601, 1490, 101, 49, 1170, 1092, 1704]
else:
print(BIP39Colors.getError())
# Convert back colors to original mnemonic phrase
colors = ['#613911', '#7C5809', '#B8E412', '#225531', '#01AB63', '#3E8775', '#98BDC1', '#E3AFE8']
if( BIP39Colors.toSeed( ' '.join(str(elemento) for elemento in colors) ) ):
print(BIP39Colors.seed)
# outputs: "master milk advice kid insect siege riot arrive alcohol mutual mask stay"
else:
print(BIP39Colors.getError())
Add the library /php/bip39colors.php to your project
require "bip39colors.php";
$mnemonic = 'master milk advice kid insect siege riot arrive alcohol mutual mask stay';
if(BIP39Colors::fromSeed($mnemonic) ){
echo implode(', ', BIP39Colors::$colors);echo("<br/>");
/* outputs:
['#01AB63', '#225531', '#3E8775', '#613911', '#7C5809', '#98BDC1', '#B8E412', '#E3AFE8']
*/
echo implode(', ', BIP39Colors::colorPalette());echo("<br/>");
/* outputs colors sorted as color palette:
['#613911', '#7C5809', '#B8E412', '#225531', '#01AB63', '#3E8775', '#98BDC1', '#E3AFE8']
*/
echo implode(', ', BIP39Colors::$wordPositions);echo("<br/>");
/* outputs bip39 mnemonic words as their positions inside BIP39 word list :
[1094, 1125, 33, 979, 937, 1601, 1490, 101, 49, 1170, 1092, 1704]
*/
}else{
// Show current error
echo(BIP39Colors::getError());
}
$colors = ['#613911', '#7C5809', '#B8E412', '#225531', '#01AB63', '#3E8775', '#98BDC1', '#E3AFE8'];
if( BIP39Colors::toSeed(implode(' ', $colors)) ){
echo(BIP39Colors::$seed);
/* outputs:
"master milk advice kid insect siege riot arrive alcohol mutual mask stay"
*/
}else{
// Show current error
echo(BIP39Colors::getError());
}
You can encode or decode your BIP39Colors by hand using only a calculator, no need any external tool or library
This project is authored by @EnteroPositivo
This project is licensed under the CC BY License