Using trezorctl with passphrase

From Trezor Wiki
Jump to: navigation, search

These commands can be used if you want to use trezorctl with multiple commands in a row without retyping your passphrase.

WarningThese commands will leave the passphrase in your computer's operative memory, even if you use the "unset" command below. Please use with caution.

See also

1. Set the Trezor passphrase source to "HOST," so that you will not be prompted for the passphrase every time a new address is generated:

trezorctl set_passphrase_source 2

2. Save your passphrase to the environment variable PASSPHRASE.

Prompt for a passphrase (you will not see what you are typing)

read -s PASSPHRASE  

Make it an environment variable, so trezorctl can see it.

export PASSPHRASE   

If you want to check that the passphrase is correct, you can print it to the terminal using this command:


3. Now you can use multiple commands with your saved passphrase.

Generate 100 SegWit addresses:

for i in {0..99}; do trezorctl get_address -n "m/49'/0'/0'/0/$i" -t p2shsegwit; done

4. To unset the variable, run:

Like Trezor? Get one here!