Overview
Introduction to Mavryk: Nodes and Validating
This page delves into two fundamental components of Mavryk: nodes and validating.
This page gives an overview of what a node is and how you can deploy one yourself, then introduces validating and how you can become a validator.
It links to the different sections of the node and validating modules, where you can find detailed information and tutorials about each topic.
Nodes
Nodes serve as the vital organs of the Mavryk network, facilitating communication, synchronization, and data storage. Each node represents a machine that maintains a copy of the blockchain's current state and updates it based on transactions sent by users. These transactions are propagated through the network and subsequently added to the chain.
How Nodes work
- Communication: Nodes constantly exchange information to ensure that all participants have a consistent view of the blockchain.
- Validation: Before accepting new transactions, nodes check their validity, thereby ensuring the security and integrity of the network.
Anyone can run a node and join the Mavryk network. Nodes can keep different amounts of the blockchain history, depending on their configuration:
- Rolling mode: The most lightweight mode. It stores recent blocks with their current context.
- Full mode (default mode): It also stores the content of every block since genesis so that it can handle requests about them, or even recompute the ledger state of every block of the chain.
- Archive mode: Also stores the history of the context, allowing services like indexers to enquire about balances or staking rights from any past block.
Deploying your own node
If you would like to contribute to the Mavryk network with your own node, you will need to:
- Install and setup a node on your own machine.
- Keep track of protocol and Mavkit upgrades and keep your node in optimal working condition.
- Monitor your node's performance and activity to keep it running smoothly.
- Connect your node to the network of your choice (mainnet, atlasnet, etc.).
- Adhere to the best practices for maintaining and operating a node, enhancing its performance and your overall experience.
Finally, for heavy use cases, you may choose to deploy a cluster of nodes, streamlining the process and ensuring a robust, well-organized node infrastructure.
Validating
Validating is the mechanism through which new blocks are forged and added to the Mavryk blockchain. It implies running a dedicated piece of software that interacts with the network through an associated node. Validators get the opportunity to create blocks, depending on how many tokens they put at stake, following a Proof of Stake mechanism.
In return, they receive rewards in the form of transaction fees and newly minted MVRK for that block.
Key aspects of validating
- Validating Rights: Validating rights are assigned randomly, in proportion to the staking balance of the validator, consisting of its own MVRK, and MVRK delegated to it by other accounts. The higher this balance is, the higher the chance of the validator obtaining the right to create a block.
- Attestations: Once a validator proposes a new block, other validators take part in a process involving propagating pre-attestations and attestations, so that this block is permanently added to the blockchain (what we call finality).
- Rewards: Validators and delegators earn MVRK rewards for their active participation in securing and operating the network.
- Penalties/Risks: Validating comes with some risks. Validators who act maliciously or negligently by proposing multiple blocks at once (double validating) or signing conflicting attestations (double attesting) are punished by slashing: they lose part of their staked MVRK.
To learn more about the basics of validating, check out What is validating? and How does validating work? sections
Delegating
For those who either lack 6,000 MVRK (plus fees) or don’t have the resources or willingness to setup infrastructure, there's the option to delegate their tokens to a validator, to augment its validating rights. In exchange, delegators receive a portion of the rewards that validators pledge to distribute. Delegated MVRK are neither frozen nor at risk of being slashed.
Interaction between Nodes and Validating
A validator connects to the network through a node. The node supplies pending operations, which the validator then evaluates for validity. The validator selects a subset of these operations to form a block that it then propagates through the entire network.
It's essential to recognize that, like any software based on a peer-to-peer network, Mavryk nodes are susceptible to attacks, especially for validators. Therefore, it's crucial for validators to protect communication channels and secure their keys. Active validating requires hot keys for signing blocks and attestations, but the consensus key mechanism allows validators to keep their main funds in a cold wallet while signing with a separate hot key.
Why deploy a node or become a validator?
Deploying a node allows you to:
- Interact with the blockchain without relying on a public node hosted by a third party.
- Contribute to the decentralization of the blockchain, therefore its resilience and security.
Becoming a validator allows you to:
- Be rewarded for validating new blocks and attesting other validators’ blocks.
- Increase the security of the blockchain by helping to spread the responsibility and power associated with creating new blocks.
- Ensure your ability to add your transactions to the blockchain, at a predictable rate and cost.
Advanced aspects of validating
- Learn how to create a validator's consensus key as an option to secure your funds.
- Learn how to run a persistent validating node to maintain a constant presence on the network, validating transactions and creating new blocks.
- Learn how to submit transactions to a specific validator, to leverage the security and efficiency of Mavryk's validation process.
Finally, you can check out the glossary and make sure you get familiar with the key terms and concepts associated with validating on Mavryk.