The parts that make this work
Masternodes and the 10 million XDC stake
Anyone can become a candidate by locking 10,000,000 XDC in the network's staking contract, and other holders can add stake to a candidate they trust. Only the 108 highest-staked candidates run consensus; on mainnet a few hundred more sit on a standby list. The stake is what makes misbehaviour expensive: a masternode caught breaking the rules can be penalised and drop out of the active set, and its XDC stays locked while it does.
Epochs and elections
An epoch is 900 consensus rounds, roughly half an hour at two seconds a round. At each epoch boundary the candidates are re-ranked by stake, penalised nodes are left out, and the new top 108 take over. The same boundary block pays out the rewards for the epoch just finished, shared according to how many blocks each masternode signed, with a portion to the XDC foundation. Because the round counter keeps running through timeouts, epoch boundaries fall on rounds, not on fixed block numbers.
Rounds, leaders and certificates
XDPoS 2.0 is a chained HotStuff protocol. Each round has one leader, masternode number round mod 108, and it proposes exactly one block. The other masternodes sign a vote if the block is valid and extends the highest certificate they know. Any 73 of the 108 signatures (⌈108 × ⅔⌉) form a quorum certificate, and the next block embeds that certificate in its header. That's why every XDC block header carries the round number, the certificate for its parent, and dozens of signatures.
The three-chain rule
A single certificate proves that two thirds of the masternodes saw a block, but not that they all agree it's the only block at that height. HotStuff settles that with three certified blocks in consecutive rounds: when a block, its child and its grandchild each carry a certificate, the first one is committed and can never be replaced, and so is everything before it. Every honest node reaches the same conclusion from the same headers, without another message.
Timeouts, forensics and penalties
A leader that is offline or slow produces nothing, so masternodes wait a fixed period and then broadcast a signed timeout for the round. Two thirds of those form a timeout certificate, the round is skipped and the next leader proposes. Every vote and timeout is a signature, so a masternode that signs two conflicting blocks, or lies about its round, leaves proof. The forensics part of the design uses those signatures to identify the offenders. Missed rounds are recorded per epoch, and a masternode that signs nothing for a whole epoch is moved to the penalty list and sits out several epochs.
Finality in about six seconds
A block is proposed, certified when the next block lands, and committed when the one after that is certified: three blocks, about six seconds. Ethereum's proof of stake needs two full epochs, around thirteen minutes, before a block is finalised. Bitcoin never finalises at all; it only makes reorganisation less likely with each block. On XDC a payment in a committed block is settled, and the explorer's view of it can't change.
What a transaction costs
XDC uses Ethereum's gas model, so a plain transfer takes 21,000 gas and a contract call takes more. Blocks carry a base fee, which on mainnet sits at 12.5 gwei, and wallets usually pay a little above it. At that price a transfer costs about 0.00026 XDC. Nothing is burned: the whole fee goes to the masternode that proposed the block. The system transactions masternodes send to sign blocks are free.
What live mode shows
Live mode polls a public XDC mainnet JSON-RPC node every second and draws each new block as it lands. The masternode that lights up is the block's real proposer, found from the round number in the header, and the inner ring is the real list of 108 masternodes for this epoch, with the standby and penalised candidates outside it. Each dot is a real transaction, red if it reverted. The signature count on the certificate is read from the header, but the node doesn't say which masternodes signed, so the vote beams are spread around the ring. Rounds that were skipped show as timeouts in the feed. Block numbers, hashes, gas and the finalised height are real.
What the animation simplifies
Step-by-step mode shows an election and a timeout in every cycle so you can see them; on mainnet an election happens every 900 rounds and timeouts are rare. Votes are drawn one by one, though real masternodes vote at once, and the transaction counts are illustrative. The full protocol, including the locking rule that stops a masternode voting for two conflicting branches, is in the XDC Network documentation and the XDPoS 2.0 paper.