|  | 
| 4 | 4 | 
 | 
| 5 | 5 | * [Installation](#installation) | 
| 6 | 6 | * [Channel recovery scenario](#channel-recovery-scenario) | 
|  | 7 | +* [Seed and passphrase input](#seed-and-passphrase-input) | 
| 7 | 8 | * [Command overview](#command-overview) | 
| 8 | 9 | * [Commands](#commands) | 
| 9 | 10 |   + [chanbackup](#chanbackup) | 
| @@ -192,6 +193,47 @@ file based backup or the recovered file from the crashed node). | 
| 192 | 193 |     with the `option_static_remote_key`, (`lnd v0.8.0` and later), the funds can | 
| 193 | 194 |     be swept by your node. | 
| 194 | 195 | 
 | 
|  | 196 | +## Seed and passphrase input | 
|  | 197 | + | 
|  | 198 | +All commands that require the seed (and, if set, the seed's passphrase) offer | 
|  | 199 | +three distinct possibilities to specify it: | 
|  | 200 | +1. **Enter manually on the terminal**: This is the safest option as it makes | 
|  | 201 | +  sure that the seed isn't stored in the terminal's command history. | 
|  | 202 | +2. **Pass the extened master root key as parameter**: This is added as an option | 
|  | 203 | +  for users who don't have the full seed anymore, possibly because they used | 
|  | 204 | +  `lnd`'s `--noseedbackup` flag and extracted the `xprv` from the wallet | 
|  | 205 | +   database with the `walletinfo` command. Those users can specify the master | 
|  | 206 | +   root key by passing the `--rootkey` command line flag to each command that | 
|  | 207 | +   requires the seed. | 
|  | 208 | +3. **Use environment variables**: This option makes it easy to automate usage of | 
|  | 209 | +  `chantools` by removing the need to type into the terminal. There are three | 
|  | 210 | +  environment variables that can be set to skip entering values through the | 
|  | 211 | +  terminal: | 
|  | 212 | +    - `AEZEED_MNEMONIC`: Specifies the 24 word `lnd` aezeed. | 
|  | 213 | +    - `AEZEED_PASSPHRASE`: Specifies the passphrase for the aezeed. If no | 
|  | 214 | +      passphrase was used during the creation of the seed, the special value | 
|  | 215 | +      `AEZEED_PASSPHRASE="-"` needs to be passed to indicate no passphrase | 
|  | 216 | +      should be used or read from the terminal. | 
|  | 217 | +    - `WALLET_PASSWORD`: Specifies the encryption password that is needed to | 
|  | 218 | +      access a `wallet.db` file. This is currently only used by the `walletinfo` | 
|  | 219 | +      command. | 
|  | 220 | + | 
|  | 221 | +Example using environment variables: | 
|  | 222 | + | 
|  | 223 | +```shell script | 
|  | 224 | +# We add a space in front of each command to tell bash we don't want this | 
|  | 225 | +# command stored in the history. | 
|  | 226 | +$    export AEZEED_MNEMONIC="abandon able ... ... ..." | 
|  | 227 | +# We didn't set a passphrase for this example seed, we need to indicate this by | 
|  | 228 | +# passing in a single dash character. | 
|  | 229 | +$    export AEZEED_PASSPHRASE="-" | 
|  | 230 | +$ chantools showrootkey | 
|  | 231 | + | 
|  | 232 | +2020-10-29 20:22:42.329 [INF] CHAN: chantools version v0.6.0 commit v0.6.0-3 | 
|  | 233 | + | 
|  | 234 | +Your BIP32 HD root key is: xprv9s21ZrQH1... | 
|  | 235 | +``` | 
|  | 236 | + | 
| 195 | 237 | ## Command overview | 
| 196 | 238 | 
 | 
| 197 | 239 | ```text | 
|  | 
0 commit comments