Filecoin (FIL)
Filecoin wallet structure
The Filecoin wallet has the following structure.
- Main address
- Child address
TIP Filecoin does not use a fee address.
Deposit
Deposit status
When an asset from the outside arrives at the main or a child address, Octet recognizes it as a deposit. However, the deposit is not finalized even if the deposit transaction is included in the blocks. Additional blocks must be generated to finalize (FINALIZED) the transaction to ensure the integrity of the transaction. When an asset is sent to a main or a child address but has not arrived, that transaction is not recognized. Therefore, there is no FAILED status for the deposit transaction.
| Status name | Description |
|---|---|
UNFINALIZED | Deposit transaction is included in the blocks |
FINALIZED | Deposit transaction is included in the blocks and the next block is generated |
Gathering
Gathering is only available for centralized wallets.
Gathering process and fees
Assets stored in child addresses don't move to the main address unless gathering is requested. Therefore, gatherings should be made regularly to avoid a deficit in the main address.
When gathering of a specific asset is requested, all FIL stored in every child address gets transferred to the main address. At this point, one transaction occurs per child address. For example, if FIL is stored in 10 child addresses, 10 transactions will occur in total.
A gathering fee occurs once per transaction, and it is deducted from the asset to be gathered. Gathering will not be made for child addresses with assets less than the estimated fees. The gathering process is as follows.
- Request gathering.
- Generate a transaction for each child address to be gathered.
- Calculate the optimal fees and propagate the transactions.
- Gathering is completed when the transactions are confirmed in the blocks.
Gathering status
Gathering status can be specified into four types, depending on the process. The asset stored in the child address is in AWAITING_GATHERING status.
When gathering is requested and a gathering transaction is generated, the status of the asset changes to GATHERING. When the transaction is included in the blocks, the status of the asset is processed to COMPLETED and the gathering is finished.
When a gathering is tried and the transaction failed, the status of the asset remains as GATHERING_FAILED. Assets in gathering failed status are included in the gathering target again. When a gathering is tried but failed to generate a transaction due to insufficient fees, it remains in AWAITING_GATHERING status.
| Status name | Description |
|---|---|
AWAITING_GATHERING | Awaiting gathering |
GATHERING | Generate gathering transaction |
COMPLETED | Complete gathering transaction |
GATHERING_FAILED | Failed gathering transaction |
Withdrawal
Withdrawal status
Unlike a deposit, a withdrawal is finalized (FINALIZED) at the moment when the transaction is included in the blocks.
| Status name | Description |
|---|---|
AWAITING_DECISION | Awaiting withdrawal approval |
REJECTED | Withdrawal is rejected |
AWAITING_WITHDRAWAL | Approved and awaiting withdrawal |
PENDING | Withdrawal transaction is generated |
FINALIZED | Withdrawal transaction is included in the blocks |
FAILED | Withdrawal transaction failed |
Balance lookup criteria
You can check the balance of the asset stored in a specific address by calling the Get Address Balance API. The accessed balances are divided into total balance and liquid balance.
- Total balance means all assets with a confirmation of 1 or above.
- Liquid balance means the assets that can be gathered or withdrawn. The liquid balance of a child address represents the assets that can be gathered, while the liquid balance of the main address represents the assets that can be withdrawn.
Fees
Estimated fees (maximum fees)
Estimated fees are calculated by multiplying the gas limit and the maximum gas price.
Estimated Fees = Gas Limit x Gas Fee Cap
- Gas Limit is the maximum gas usage. The actual gas usage could be less than that, and the fees are charged only for the actual gas usage.
- Gas Fee Cap is the maximum price per gas. You can access the value by calling the Get Fee API. The actual price per gas could be less than that.
Transaction fees
Transaction fees are calculated by multiplying the amount of gas used and the gas price. In addition, a tip is paid to the block producer within the maximum fee cap.
Transaction Fees = {Gas Used x Base Fee} + {Gas Premium x Gas Limit}
- Gas Used is the amount of gas used until the transaction is included in a block.
- Base Fee is the gas price.
- Gas Premium is the price per gas of the tip paid to the block producer.