6

I am pretty confused. What I understand is that when I buy a Trezor then it gives me some words that I need to copy down. When the Trezor starts up does it then automatically create some Bitcoin addresses and keys?

If I lose my Trezor, then how does a replacement know about my previously created Bitcoin addresses and keys?

6

Trezor implements BIP32/BIP39 (hierarchical deterministic wallet and mnemonic encoded seeds, respectively).

The mnemonic (12 words) is just a way of encoding a hex seed like 6c5f9d00018f2a2030afcc6f3057e5a4dea6dfb905dd4b0197a9a047bcfe0501662332a3caa846b1223ff3d20cfb295e7f94fe51c94472e3f8429c97754132e9 (whose mnemonic would be business weird season glimpse pole robot surprise next term toddler doctor fresh). The hex seed is then used for a master private key and a master public key pair (in this example, xprv9s21ZrQH143K29DbrSg2YgC2iyW3Gx3FhNExbxEacDWJCmz9xmsxKjon93FSC85Bv4AkszKLK1d3FA6PKS1Wb6xYotbDppezTMQaazbPL6h and xpub661MyMwAqRbcEdJ4xUD2up8mH1LXgQm74bAZQLeCAZ3H5aKJWKCCsY8FzL33Ay3XxoX7xWyq4pejzuSQEQw2hA2CvWvKBgMGTJLgZXRzdbf, respectively).

So if we look at this bip39 tool, the mnemonic business weird season glimpse pole robot surprise next term toddler doctor fresh has a list of addresses which will be used by the Trezor, in order (in this example, the first listed address begins with 18SKy...).

All of this is just demonstrating how it works (do not enter your mnemonic into a website as this example shows!), or as TL;DR: the mnemonic is all you need to recover the keys for Trezor addresses

4

BIP 32/39 allows key portability across different wallet implementations. To complement the "Wizard of Ozzie" answer above, a different method (C++ based, not JavaScript based code) is provided below to reconstruct the results above using the bitcoin-explorer (bx) command line interface that should be executed offline with "real" mnemonics and keys.

Without having high Evaluation Assurance Level (EAL) pedigree ratings ranging from 1 to 7 that also address supply chain risks, one should not put much trust in HD key generators without cross correlating results between different genetically independent key generator implementations.

Results below were created without a BIP 39 passphrase to reconstruct results shown above. Results below also provide reconstruction details for m/44'/0'/0'/0 (BIP 44 extended private branch key) and M/44'/0'/0'/0 (BIP 44 extended public branch key) that can be used to synthesize over 4 billion private/public key pairs and Bitcoin addresses from a wallet's BIP 39 backup mnemonic words. Only the first 3 private keys and associated public addresses are computed below to establish patterns used to compute 4 billion private/public key pairs and Bitcoin addresses from a wallet's BIP 39 backup mnemonic words.

1) Reconstituting master seed using BIP 39:

% bx mnemonic-to-seed business weird season glimpse pole robot surprise next term toddler doctor fresh

6c5f9d00018f2a2030afcc6f3057e5a4dea6dfb905dd4b0197a9a047bcfe0501662332a3caa846b1223ff3d20cfb295e7f94fe51c94472e3f8429c97754132e9

2) Reconstituting extended private keys:

% bx mnemonic-to-seed business weird season glimpse pole robot surprise next term toddler doctor fresh | bx hd-new -v 76066276

xprv9s21ZrQH143K29DbrSg2YgC2iyW3Gx3FhNExbxEacDWJCmz9xmsxKjon93FSC85Bv4AkszKLK1d3FA6PKS1Wb6xYotbDppezTMQaazbPL6h

Note that 76066276 is a base10 four byte version prefix of 0x0488ADE4 (base16) that cause the extended BIP 32 private keys to start with "xprv".

JavaScript BIP 44 tab results can be verified by the following:

% bx mnemonic-to-seed business weird season glimpse pole robot surprise next term toddler doctor fresh | bx hd-new -v 76066276 | bx hd-private -d -i 44 | bx hd-private -d -i 0 | bx hd-private -d -i 0 | bx hd-private -i 0

xprvA1hRqX7kSHXAfsq8pNTYtwvgZXDRuUT6MtZ7WHgC8WTquy3LnzZFHRsZfH7shWEqjUPDBgFhXj4o53QPoapPVZUUic944UFbtofrAvzCvmt

A) BIP 44 WIF private key m/44'/0'/0'/0/0:

% echo 'xprvA1hRqX7kSHXAfsq8pNTYtwvgZXDRuUT6MtZ7WHgC8WTquy3LnzZFHRsZfH7shWEqjUPDBgFhXj4o53QPoapPVZUUic944UFbtofrAvzCvmt' | bx hd-private -i 0 | bx hd-to-ec | bx ec-to-wif -v 128

L5TPeiMKRnMbvQF6z1EYa3gmpwP6xSJN21nfAipXnJoD2CVEXGBH

B) BIP 44 WIF private key m/44'/0'/0'/0/1:

% echo 'xprvA1hRqX7kSHXAfsq8pNTYtwvgZXDRuUT6MtZ7WHgC8WTquy3LnzZFHRsZfH7shWEqjUPDBgFhXj4o53QPoapPVZUUic944UFbtofrAvzCvmt' | bx hd-private -i 1 | bx hd-to-ec | bx ec-to-wif -v 128

Kx3GxX5o8KynsJAs9jWKYyqKnPmAjVApBr1TNuuXdFkknG8nvJHr

C) BIP 44 WIF private key m/44'/0'/0'/0/2:

% echo 'xprvA1hRqX7kSHXAfsq8pNTYtwvgZXDRuUT6MtZ7WHgC8WTquy3LnzZFHRsZfH7shWEqjUPDBgFhXj4o53QPoapPVZUUic944UFbtofrAvzCvmt' | bx hd-private -i 2 | bx hd-to-ec | bx ec-to-wif -v 128

L16rfuc8mPts63KcovJH57rwqGfQP48q6hV3mHgbi9fbiX9gAEPp

3) Reconstituting extended public keys:

% bx mnemonic-to-seed business weird season glimpse pole robot surprise next term toddler doctor fresh | bx hd-new -v 76067358

xpub661MyMwAqRbcEdJ4xUD2up8mH1LXgQm74bAZQLeCAZ3H5aKJWKCCsY8FzEPiHJDnKncknSSFymNVrbeBD6W4LxYiKtubg9U3PDHpM7DEZx7

Note that 76067358 is a base10 four byte version prefix of 0x0488B21E (base16) that causes the extended BIP 32 public keys to start with "xpub".

JavaScript BIP 44 tab results can be verified by the following:

% bx mnemonic-to-seed business weird season glimpse pole robot surprise next term toddler doctor fresh | bx hd-new -v 76066276 | bx hd-private -d -i 44 | bx hd-private -d -i 0 | bx hd-private -d -i 0 | bx hd-public -i 0

xpub6EgnF2eeGf5TtMubvPzZG5sR7Z3vJwAwj7UiJg5ogqzpnmNVLXsVqEC3Wa4g8djxA9JcPFB9rSW9qvjYYCNbhJHkh7Pnm2uWUh5ZJ3pYNBj

A) Address for BIP 44 public key M/44'/0'/0'/0/0:

% echo 'xpub6EgnF2eeGf5TtMubvPzZG5sR7Z3vJwAwj7UiJg5ogqzpnmNVLXsVqEC3Wa4g8djxA9JcPFB9rSW9qvjYYCNbhJHkh7Pnm2uWUh5ZJ3pYNBj' | bx hd-public -i 0 | bx hd-to-ec | bx ec-to-address -v 0

18SKy9bqE57Mif4p1iGbGqPP2vgV8YXFw8

B) Address for BIP 44 public key M/44'/0'/0'/0/1:

% echo 'xpub6EgnF2eeGf5TtMubvPzZG5sR7Z3vJwAwj7UiJg5ogqzpnmNVLXsVqEC3Wa4g8djxA9JcPFB9rSW9qvjYYCNbhJHkh7Pnm2uWUh5ZJ3pYNBj' | bx hd-public -i 1 | bx hd-to-ec | bx ec-to-address -v 0

13EGK6DifQ6jsx5habBz4SoNYitPaqYUTL

C) Address for BIP 44 public key M/44'/0'/0'/0/2:

% echo 'xpub6EgnF2eeGf5TtMubvPzZG5sR7Z3vJwAwj7UiJg5ogqzpnmNVLXsVqEC3Wa4g8djxA9JcPFB9rSW9qvjYYCNbhJHkh7Pnm2uWUh5ZJ3pYNBj' | bx hd-public -i 2 | bx hd-to-ec | bx ec-to-address -v 0

1JMeSGf1AB6vsRQxRJsVFBtRmqWdbNcn5D

It is worth noting bx unifies key HD key/address generation across 100+ altcoins, see BIP 44 related Table.

0

The words you write down are used by Trezor to generate the bitcoin keys and addresses. If you have the words, you can re-generate the keys in another Trezor or compatible wallet (by telling it to restore an existing wallet and entering the words, instead of generating a new one). Conversely, if somebody else has your words, they can also access your bitcoins, so they need to be kept securely offline.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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