# Lotus Miner: Wallets

A miner can be configured with an owner address, a worker address and additional control addresses. These allow granularity in how the funds sent and received from the miner are managed and provide additional security to the mining operation.

During miner initialization, a miner actor is created on the chain. This actor gives the miner its ID: t0.... The miner actor is in charge of collecting all the payments sent to the miner when, for example, honoring the different types of deals.

The Lotus Miner daemon, in turn, performs the operations as required by the network during and can use different Lotus Node wallets to pay the fees or interact with the miner actor. Information on how to manage Lotus wallets can be found here.

TIP

We use the terms wallet and address rather interchangeably in this document. A Lotus wallet is identified by its address.

The currently configured wallets used by a miner can be listed with:

lotus-miner actor control list

The different types of wallets associated to a miner are described below:

# The owner address

The owner address corresponds to a Lotus Node wallet address that is provided during the miner initialization. The owner address is only needed when:

  • Changing the owner or the worker address in the miner actor
  • Withdrawing balance from the miner actor
  • Submit WindowPoSts (unless control addresses are defined and have enough balance, see below)

The wallet associated to the owner address is designed to be kept offline as a cold wallet, given that it should not be used often and it is critical to safeguard the miner's funds. In production environments, we strongly recommend using separate owner and worker addresses.

The owner address can be updated with the following command:

lotus-miner actor set-owner --really-do-it <address>

The old and the new address must be available in the Lotus node. For the new address, you can create a new one or import an existing one.

# The worker address

The worker address is used to send and pay for day-to-day operations performed by the miner:

  • Initializing the miner on the chain
  • Changing the miner peer id or the multiaddresses
  • Interacting with market and payment channel actors
  • Signing new blocks
  • Submitting proofs, declaring faults. WindowPoSts are submitted using the worker address if:
    • Control addresses are not defined or do not have enough balance
    • The owner address does not have enough balance

Thus, unlike the owner wallet, the worker wallet must necessarily be a hot wallet. The Lotus Miner will trigger all the necessary transactions using the Lotus Node to which it is connected. The worker address must have enough funds to pay for the day-to-day operations of the miner, including initialization.

# Control addresses

Control addresses can be used to submit WindowPoSts proofs to the chain. WindowPoSt is the mechanism through which storage is verified in Filecoin and which requires miners to submit proofs for all sectors every 24h. Those proofs are submitted as messages to the chain and therefore need to pay the respective fees.

Many mining related actions require sending messages to the chain but not all of those are as "high value" as WindowPoSts. For this reason, it is recommended to use control addresses as a way to avoid head-of-line blocking problems in congested chain conditions.

Multiple control addresses can be created and configured in a Lotus Miner. The first control address found to have enough funds to submit a WindowPoSt transaction will be used. Otherwise Lotus fails over to the owner and ultimately to the worker address.

To set up a control address, first, create a new wallet and send it some funds to it for gas fees:

lotus wallet new bls
f3defg...

lotus send --from <address> f3defg... 100

Next, let the miner know about the new address:

$ lotus-miner actor control set --really-do-it f3defg...
Add f3defg...
Message CID: bafy2..

Wait for the message to land on chain:

lotus state wait-msg bafy2..
...
Exit Code: 0
...

Finally, check the miner control address list to make sure the address was correctly added:

$ lotus-miner actor control list
name       ID      key           use    balance
owner      t01111  f3abcd...  other  300 FIL
worker     t01111  f3abcd...  other  300 FIL
control-0  t02222  f3defg...  post   100 FIL

You can repeat this procedure to add additional addresses.

# Managing balances

To get the balances associated with your miner wallet, run:

$ lotus-miner info
Miner: t01000
Sector Size: 2 KiB
Byte Power:   100 KiB / 100 KiB (100.0000%)
Actual Power: 1e+03 Ki / 1e+03 Ki (100.0000%)
	Committed: 100 KiB
	Proving: 100 KiB
Below minimum power threshold, no blocks will be won
Deals: 0, 0 B
	Active: 0, 0 B (Verified: 0, 0 B)

Miner Balance: 10582.321501530685596531 FIL
	PreCommit:   0.000000286878768791 FIL
	Pledge:      0.00002980232192 FIL
	Locked:      10582.321420164834231291 FIL
	Available:   0.000051276650676449 FIL
Worker Balance: 49999999.999834359275302423 FIL
Market (Escrow):  0 FIL
Market (Locked):  0 FIL

Here, miner id is t01000, and it has total balance of 10582.321501530685596531 FIL with an available balance of 0.000051276650676449 FIL that can be used as collateral/pay for the pledge. The worker balance is 49999999.999834359275302423 FIL.

# Withdrawing funds from the Miner actor

The funds in the Miner actor can be withdrawn to the owner address using:

lotus-miner actor withdraw <amount>

TIP

Note that the owner address will need to be available in the Lotus Node and have enough funds to pay for the gas for this transaction. Thus, cold wallets will need to be temporally imported for the operation to succeed.