# Participating in Consensus
:::info
This document explains the high-level concepts involved with running validators, including staking requirements, election criteria, and incentives.
Definitions of Terms:
* **Staking**: Locking an amount of **FIRE** of the account for certain purpose. In this document, this is GV registration.
* **One Round**: A time period lasting exactly 75 seconds.
* **One Cycle**: Exactly 1,152 rounds, which is approximately one day.
* **Staking Address**: The candidate's registered and bonded address.
* **Block Creation Address**: The candidate's block signing address.
:::
## Registration
Registering to participate in the global consensus group is free and permissionless. In order to be eligible, an account must first **stake** to become bonded.
* **Node ID**: A public-facing identifier consisting of up to 40 characters. IDs are primarily used for display purposes. Must be unique.
* **Staking Amount:** *1,000,000 FIRE* (subject to change via governance)
* **Lock-Up Period:** *~3 months* (7,776,000 global blocks, to be precise). During this time, the registrant's stake remains locked in the governance contract. Any time thereafter, the node may revoke their registration and retrieve their staked tokens.
To register, an account must send a **Registration** transaction to Firechain's built-in consensus smart contract with the requisite stake. As soon as the transaction is confirmed, the registration is immediately effective. In other words, the newly registered node may participate in global consensus as soon as the next round, provided they receive enough votes to be elected to the global group. It's recommended (but not required) to use different addresses for staking and block signing for security reasons.
Once the lock-up period has expired, the registrant can send a **Cancel Registration** transaction to the consensus contract. As soon as the transaction is confirmed, the node will become ineligible to participate in consensus and will be removed from global validator set immediately.
## Global Consensus Mechanics
### Round
A round is approximately 75 seconds. Voting result are snapshotted every 75 seconds in order to select the nodes for next round. Each validator will be expected to produce 3 consecutive blocks within a round.
### Selection
In each round, 25 global validators are selected according to following rules:
* 23 are randomly selected from the top 25 global validators (ranked by vote).
* 2 are randomly selected from global validators ranking from 26 to 100. (Each validator ranked 26-100 has a $2:75$ chance of being selected.)
### Rewards
An annual inflation of ~3% of FIRE are minted as block rewards. Currently, the reward for each global block is ~${0.951294}$ **FIRE**
#### Allocation
The validator reward allocations are split into two buckets:
* The **Block Creation Reward**, currently 50%, goes to the validators that signed global blocks during the round, subject to the following rules:
* Each validator's "liveness" is estimated using $\frac{CreatedBlocks}{ExpectedBlocks}$.
* Validator rewards are weighted according to liveness (`2/3 expected blocks = 66.6%`, `1/3 = 33.3%`, etc.), which is to say that any reduction in liveness results in a proportional reduction in rewards.
* A validator who was expected to produce blocks but fails to do so receives no rewards, and such non-performers may be penalized (including loss of a portion of their stake, or even being replaced in the consensus group) for repeated failures.
* The **Participation Reward**, currently 50%, goes to the remaining 75 of the top 100 ranked global validators, proportionally distributed based on the number of votes received toward the current cycle.
In both cases, rewards are calculated once per round, immediately before the round ends. Rewards are eligible for redemption after 48 rounds (~1 hour).
#### Calculation
The reward calculation formula is as follows:
$$Q = \frac{n}{m}\times\frac{V}{W}\times X \times 0.5R + n\times 0.5R$$
* `Q`: the total cycle reward;
* `X`: the total number of blocks produced by all validators during the cycle
* `n`: the number of blocks a validator actually produces in the cycle;
* `m`: the number of blocks a validator was expected to produce in the cycle;
* `V`: the number of votes a validator received in the last round of the cycle, plus the number of tokens staked for the node;
* `W`: the total number of votes received by the top 100 ranked validators in the last round of the cycle, plus the total stakes of the top 100 nodes;
* `R`: The current block reward amount;
#### Claiming Rewards
Validators can claim their rewards by sending a **Reward Withdrawal** transaction from the staking address to the consensus contract. If no specific cycle is specified, all available rewards will be withdrawn. Because all rewards are withheld for 48 rounds after the end of the cycle, "available rewards" are those which were earned between the time of last withdrawal and not less than 48 rounds ago. The claiming request will generate $3.2476 H$, and the tokens earned will be minted directly to the node's registered reward address.
## FAQ
### I don't have enough **FIRE** to register on my own. Can I pool together with others to register and share rewards?
There's no group staking solution provided natively, however there's no restriction preventing anyone from deploying a staking contract that registers on behalf of a group once enough FIRE are collected. This is a common practice in the Ethereum community (for example, Lido is quite popular), and we expect to see similar solutions in the Firechain ecosystem. Of course, the contract will be responsible for determining how to share rewards and/or penalties among the group members, and the group will be subject to the same rules as any other validator.
### If a node's reward is weighted down due to downtime or misbehavior, does their reward go to other validators?
No, undue rewards will not be distributed at all. This is because rewards are issued on a per-validator basis, where each validator must claim their own rewards. If one validator's reward is reduced, it will not be distributed to other validators. In other words, the target block reward is the maximum reward, not a fixed amount that must be distributed.
### If I register but don't actually run a node, will I earn rewards?
No. Your rewards will always be 0 due to the 100% downtime penalty. Additionally, you run the risk of performance penalties if you are elected to the global group and fail to produce blocks as expected. If you are not planning to run a node and perform the duties of an elected validator, you should not register.
### My node is up, but my downtime appears to be 100%. What's going on?
This may be the result of poor connectivity (e.g. high latency), or if your node wasn't elected to the global group. If you are not elected, you will not be expected to produce blocks, and your downtime will therefore be infinite (0/0 blocks produced). If you were elected, your network connectivity is strong, and you are still seeing 100% downtime, please reach out to us on [Discord](https://discord.gg/firechain) for further assistance.
### If my validator is elected and produces global blocks, do I earn both the block creation and participation rewards?
Yes, you will earn both rewards. The participation reward is calculated based on the number of votes received in the last round of the cycle, and the block creation reward is calculated based on the number of blocks produced in the cycle. If you are eligible, you will earn both rewards as they are calculated independently.
### Does my validator stake count towards heat capacity as well?
No, your validator stake is specifically for consensus and does not count towards heat capacity. You can stake additional tokens for heat capacity if you wish, or cancel your validator registration to free up your tokens for that purpose.
### How many validator nodes can I register?
Technically, you can register as many times as you want. You just need to have enough FIRE to stake for each node. However, every validator must produce blocks with a unique signing key, so you will actually need to run a separate node for each registration.
### Can I cancel my registration and get my stake back?
Yes. You can send a **Cancel Registration** transaction to the consensus contract. As soon as the transaction is confirmed, the node will become ineligible to participate in consensus and will be removed from global validator set immediately. The staked FIRE will be returned to the staking address, less any penalties that may have been incurred.
### Is there a way to withdraw my rewards before the 48 round lock-up period ends?
No. The lock-up period is designed to prevent validator registration by speculators, and to ensure that validators are committed to running a node for the duration of the lock-up period. The lock-up period is not intended to prevent validators from withdrawing their stake if they decide to stop running a node. Validators can cancel their registration at any time to withdraw their stake, and they will not be penalized for doing so, except that they will forfeit any rewards still within the lock-up period.