Gocoin Logo

Wallet config file

The offline wallet configuration file is named wallet.cfg
The wallet looks for this file in the folder where it is being launched from, though you can point it somewhere else with the GOCOIN_WALLET_CONFIG environment variable, or with the -cfg <filename> command line switch (which has the priority over the variable).

The file is a plain text one, with a single name=value pair per line. Lines starting with # are ignored, so an example config with all the values commented out is shipped along with the source code.

Command line switches have priority over the config file. Most of the values below have a corresponding switch of the same name (run wallet -h to see them all).

Note: the config file itself does not contain any secrets, but it does decide which keys the wallet creates from your seed password. Two different configs, with the same password, will give you two different wallets - so make sure to remember what you have set here.

Wallet type and key derivation

Field name Type Default value (if not specified) Description
type int 3 Type of the deterministic wallet, from 1 to 4.
Use 4 for a HD wallet (BIP32) - this is the type you want for any compatibility with other wallets.
The default of 3 is the Gocoin proprietary wallet.
hdpath string m/0' BIP32 derivation path, leading to the first key.
Ignored for wallet types other than 4. Common values:
m/84'/0'/0'/0/0 - Wasabi, Mycelium, Samourai (native segwit / bech32)
m/49'/0'/0'/0/0 - Mycelium, Samourai (segwit compatible / P2SH)
m/44'/0'/0'/0/0 - Mycelium, Samourai (legacy P2KH)
m/44'/0'/0'/0 - Coinomi, Ledger
m/0'/0'/0' - Bitcoin Core
m/0/0 - Electrum
hdsubs int 1 Number of the HD wallet's sub-accounts to calculate the keys for. Typically used to also include the change addresses, along with the deposit ones.
For example with hdpath=m/84'/0'/0'/0/0 and hdsubs=2 it calculates the addresses for both m/84'/0'/0'/0/n and m/84'/0'/0'/1/n.
Ignored for wallet types other than 4.
bip39 int 0 Creates the HD wallet in BIP39 mode, with a mnemonic of 12, 15, 18, 21 or 24 words.
The default of 0 creates a wallet that is not BIP39 compatible.
The value of -1 means that the seed password itself is a BIP39 mnemonic.
Ignored for wallet types other than 4. See the BIP39 compatibility section.
keycnt int 250 How many deterministic addresses to pre-generate. Raise it if you use more addresses than that.
atype string p2kh The type of the deposit addresses dumped by wallet -l. Possible values:
p2kh - the old base58 encoded addresses
segwit - base58 encoded segwit version 0 addresses
bech32 - bech32 encoded segwit version 0 addresses
tap - bech32 encoded segwit version 1 (taproot) addresses
pks - raw public keys
It changes only how the addresses are presented, not the keys behind them - but pick one that matches your hdpath, or the addresses will look different than in the wallet you want to be compatible with.
testnet bool false Generate testnet addresses.
litecoin bool false Work in Litecoin (LTC) mode.
uncompressed bool false Deprecated. Kept only for the compatibility with very old wallets.

The seed and the key files

Field name Type Default value (if not specified) Description
secret string .secret Path to the file with the seed password. If the file does not exist, the wallet asks you to type the password in.
others string .others Path to the file with additional private keys, in the base58 format (one key per line, optionally followed by a space and the key's label).
seed string "" If specified, your seed password gets appended to this string.
The point is that a keyboard logger, which sees only what you type, does not see the entire secret. Note that it goes the other way around as well: whoever gets your config file still needs the password.
scrypt int 0 Use an extra scrypt function to convert the seed password into the master private key. The value is the CPU/memory cost parameter, as a power of two - recommended between 15 and 20.
It makes each brute force guess expensive, so it is the single most useful setting here if your password is memorable. 0 disables it (a less secure, backward compatible mode).
Cannot be used with bip39=-1 - the wallet will refuse to start.

Making transactions

Field name Type Default value (if not specified) Description
fee string 0.001 The transaction fee to be used, in BTC.
prompt bool false Decode the signed transaction and ask you to confirm it, before writing it to disk. Recommended - see Spending BTC.
apply2bal bool true Apply the changes to balance/unspent.txt after each send, so that the coins you have just spent are not used again by the next transaction.
rfc6979 bool false Create deterministic ECDSA signatures, as defined by RFC6979.
The signing nonce is then derived from the key and the message, instead of being drawn at random, which removes the risk of a faulty random generator leaking your private key.
minsig bool false Keep signing until both R and S inside the ECDSA signature are only 32 bytes long, which makes the transaction a byte or two smaller.
Ignored when rfc6979 is used, as there the signature is not being drawn again.