The MainNet is generally composed of three components: Nodes, Gateways, and clients. Within themselves, all three of these components handle two functions: interacting with cMix, the private communications layer, and the xx chain.
- Nodes: The core operators of the network; they execute the cMix protocol and act as validators within the xx chain.
- Gateways: The public-facing components of Nodes, one exists per Node. They store received messages, provide public access to data, and run a light node for public access.
- Clients: Clients come in two versions, cMix clients and xx chain clients. cMix clients access the communications layer and can send and receive private communications. xx chain clients are currently limited to block explorers and other interactions with the blockchain.
The initial version of the xx chain is built on Substrate, an open-source framework for efficiently and securely creating blockchain networks. For its consensus algorithm, xx chain uses the most secure BFT approach offered by Substrate, which consists of BABE for block authoring and GRANDPA for block finality.
The xx chain uses Nominated Proof of Stake (NPoS) to secure the network economically. Anyone wishing to become a validator must stake coins, with a network governed minimum, expected to start at 5000 coins. Users of the network that do not want to become validators can still contribute by staking their coins and nominating validators. Each era (a period currently defined as 24 hours) an election determines which validators get selected based on their staked amounts, the nominations they have received, and the size of the validator set. Once elected, every validator is equal, i.e., rewards are not proportional to the validator’s stake. Instead, a point-based system measures general blockchain performance: uptime, block production, and each validator get a percentage of the total reward based on their point total for each era. To find out more about these topics, please visit the Network Economics and Staking pages.
The xx chain has decentralized governance that allows every coin holder to propose, second, and vote in referendums. There is also a Council with a limited number of seats that can propose motions and other essential decisions that users can vote on. In addition, any user can run and become a candidate to the Council, and all users of the network can vote on candidates, with a fixed number getting elected each week. Finally, a smaller Technical Committee, appointed by the Council, carries out technical decisions that are of significant importance to a smooth and secure operation of the network. To find out more about this topic, please visit the Governance page.
For cMix, Node and Gateways pair together; every Node has a Gateway. Their relationship is a Scheduler-Worker design. In the initial design, this will be tiered with a Scheduling server orchestrating Nodes that then orchestrate their Gateways, which then pass schedules onto Clients. The Scheduling server takes its instruction from the blockchain; network participation is defined by staking and consensus. The network will rapidly remove scheduling functions from the scheduling server and move them to adjudication by xx chain.
Currently, all components of cMix are controlled either directly or recursively by a central Scheduling server. Each member polls the entity above them in the hierarchy for information, as shown in the figure. Bi-directional communication only exists within the same level. There are two primary components of this data that are communicated: the Network Definition File (NDF) and the
The Network Definition File (NDF) contains all the connection information for the entities in the network and is provided by the Scheduling server through the hierarchy shown. The Nodes provide the hash of their current NDF to Scheduling; if they differ, then the updated NDF is provided to the Node. The Gateways poll the Nodes and Clients poll Gateways for the new NDF in the same fashion.
Nodes, Gateways, and Clients also receive scheduling instructions from the Scheduling server. These instructions are contained within
RoundInfo structures, which are both prescriptive and descriptive of changes to rounds, which groups a set of Nodes to anonymize communications. A round is created when RoundInfo is issued to start a round’s precomputation. When the Nodes finish the precomputation, Scheduling issues a new
RoundInfo that schedules it for realtime, which can be delayed depending on the number of queued rounds. Finally, a further
RoundInfo is issued when a round completes or fails.
Full cMix Decentralization
In a future update, the scheduling server will be eliminated and replaced by an on-chain consensus operation which will work as follows:
- To be scheduled, a Node will submit a transaction to the network known as a waiting bid. Once accepted into a block, the Node will be written into the “waiting pool” for a maximum number of blocks.
- The waiting pool will not be exhausted below 30% of the total number of online cMix Nodes (in the waiting pool + currently running rounds) to ensure proper mixing between Nodes in a team. Every block producer will use the block randomly to execute a fisher-yates shuffle on the waiting pool, selecting Nodes 1 through 5 as the first team, nodes 6 through 10 as the second team, etcetera until the waiting pool is exhausted.
- The teams will see their formation and work together to execute their precomputation. Once completed, they will select a time to execute their realtime based upon network congestion and generate a joint certificate on the round realtime start. This will be passed to the Gateways and gossiped throughout the Gateway network.
- Clients, who are polling the Gateways, will see realtime certificates as well as the scheduling of the team within the block and select a round to submit messages to.
- Once a realtime time has been reached, the nodes will begin the realtime, rapidly anonymizing the messages.
- Once complete, the mixed messages will be delivered to the Gateway and the team will form a joint certificate stating the completion of the round. This will be submitted as a transaction to the blockchain.
- Once the certificate of completion is received from the team, they will be awarded points towards compensation for the era and entered back into the waiting pool automatically. If the certificate does not get received by the blockchain before a predefined number of blocks, the round will be considered failed and the team will not be re-entered back into the waiting pool until they submit another waiting bid.
At any time, any member of the team can submit a failure certificate for the round, canceling it and allowing the team members to bid back into the waiting pool.