On the page of BIP39 specs there's test vector array from Trezor link. It looks like this:


 "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong",



When I try to use any of these mnemonic phrases I can't get matching xpriv... form any of these samples using Bip39 JS lib.

For example:

const MNEMONIC = "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong";
const seed = Bip39.mnemonicToSeed(MNEMONIC);
console.log("Seed =", seed.toString("hex"));

const rootNode = Bip32.fromSeed(seed, Bitcoin.networks.bitcoin);
console.log("Bip32 Root key =", rootNode.toBase58());

returns totally different results

Seed = b6a6d8921942dd9806607ebc2750416b289adea669198769f2e15ed926c3aa92bf88ece232317b4ea463e84b0fcd3b53577812ee449ccc448eb45e6f544e25b6
Bip32 Root key = xprv9s21ZrQH143K2PfMvkNViFc1fgumGqBew45JD8SxA59Jc5M66n3diqb92JjvaR61zT9P89Grys12kdtV4EFVo6tMwER7U2hcUmZ9VfMYPLC

How can I get these c5525... and xpriv... and what is it exactly?


as user3074620 suggested, I tried to use 'TREZOR' password, as it's works!

here's code to play someone is interested.

2 Answers 2


You must add 'TREZOR' to your second line:

const seed = Bip39.mnemonicToSeed(MNEMONIC, 'TREZOR');

Then it should work.

You can see this in the BIP39 test cases in the BitcoinJS repo:


function testVector (description, wordlist, password, v, i) {
  var ventropy = v[0]
  var vmnemonic = v[1]
  var vseedHex = v[2]

  test('for ' + description + '(' + i + '), ' + ventropy, function (t) {

    t.equal(bip39.mnemonicToEntropy(vmnemonic, wordlist), ventropy, 'mnemonicToEntropy returns ' + ventropy.slice(0, 40) + '...')
    t.equal(bip39.mnemonicToSeedHex(vmnemonic, password), vseedHex, 'mnemonicToSeedHex returns ' + vseedHex.slice(0, 40) + '...')
    t.equal(bip39.entropyToMnemonic(ventropy, wordlist), vmnemonic, 'entropyToMnemonic returns ' + vmnemonic.slice(0, 40) + '...')

    function rng () { return Buffer.from(ventropy, 'hex') }
    t.equal(bip39.generateMnemonic(undefined, rng, wordlist), vmnemonic, 'generateMnemonic returns RNG entropy unmodified')
    t.equal(bip39.validateMnemonic(vmnemonic, wordlist), true, 'validateMnemonic returns true')

vectors.english.forEach(function (v, i) { testVector('English', undefined, 'TREZOR', v, i) })
vectors.japanese.forEach(function (v, i) { testVector('Japanese', WORDLISTS.japanese, '㍍ガバヴァぱばぐゞちぢ十人十色', v, i) })
vectors.custom.forEach(function (v, i) { testVector('Custom', WORDLISTS.custom, undefined, v, i) })

Could not resist providing the even more succinct results below that uses simple UNIX and bitcoin-explorer commands:

% echo "ffffffffffffffffffffffffffffffff" | bx mnemonic-new

zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong

% echo "ffffffffffffffffffffffffffffffff" | bx mnemonic-new | bx mnemonic-to-seed -p "TREZOR"


% echo "ffffffffffffffffffffffffffffffff" | bx mnemonic-new | bx mnemonic-to-seed -p "TREZOR" | bx hd-new


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.