Practice your powers and learn how smart contract-based staking works.
Participate in Stake Wars, NEAR's road-to-MainNet program.
What is BetaNet?
No mind tricks happening here. We just want you to have an advantage when Mainnet launches.
The goal for BetaNet is to place the system under stress so we can promise our community performance and reliability at MainNet.
Researchers are encouraged to attack the Staking Pool smart contract, and find ways to subtract money or lock staked funds forever.
By adopting NEAR's contract-based delegation, validators leverage differentiation to secure the network and attract delegators.
Have Fun, Break Stuff
Because breaking stuff is fun.
Test Your Services
Moderate hardware specifications will be needed initially, and might rise as network use increases. Participating is the best way to test them.
Build your very own delegation solution, and get ready to attract your audience of delegators.
How it Works: Deploy and Test Delegation
Throughout this phase of Stake Wars, Validators will work to understand delegation for their end-users, differentiate their offering, and prepare technically to join MainNet.
Validators & Delegators
Stake Wars is back, and this time will be about contract-based delegation. Validators are technical teams who run their nodes and build NEAR's network infrastructure - staking tokens to do that. Delegators are users who own NEAR tokens and want to support network security by delegating their tokens to Validators.
Validators have to run their node 24/7 and should be sure they never miss a software update or hard fork. They join the Stake Wars community on Telegram and Discord to coordinate with other Validators. Delegators stake some of their tokens to Validators of choice, using their services to earn protocol rewards. Delegated tokens support validators with the stake to generate more blocks, thus making them more important in running the network.
Stake Wars Episode II is an opportunity to get confidence with the contract-based delegation and be ready to launch the service on MainNet.
Consensus & Staking
NEAR uses a Proof-of-Stake mechanism to ensure that transactions are validated correctly and that it is difficult and expensive for an adversary to attack the network - as creating new blocks with false information requires tokens. For this reason, validators must stake tokens in order to produce and verify blocks, and in return they earn rewards that come from token supply and transaction fees. Delegators provide additional stake to support the validators they think are better for the reliability and security of the network.
Stake Wars runs on a simple delegation smart contract, called Staking Pool, built to allocate worthless BetaNet tokens to Validators and test the network before using real tokens. Validators can deploy this reference, open-source Staking Pool smart contract from Github, to test their systems and get confidence with contract-based delegation. Validators are also free to customize their delegation contract, build their web applications, and integrate the Staking Pool with their existing systems.
The second phase of Stake Wars doesn't give incentives for running a node on BetaNet. Instead, it will open the opportunity to join the Restricted MainNet, and receive delegated tokens from anyone who already own NEAR tokens.
Additionally, because Restricted MainNet doesn’t have inflation yet, to cover the costs and motivate to join this group, such validators will be receiving 10,000 $NEAR a month.
A leaderboard of Validators will be maintained in the Github repo of Stake Wars, measuring the number of generated blocks and the usage of the Staking Pool Contract. At this stage of the Stake Wars, the leaderboard will not measure the number of delegators for each validator or the stake coming from them, as the priority will be to correctly deploy and manage the contract itself.
Stake Wars is also part of the NEAR Contribution Program, so extra rewards may be available if you find bugs or vulnerabilities, if you want to create original content, or if you build extra tooling that is useful for other Validators and Delegators. To be eligible, you have first to open an issue in the Stake Wars repository and link your original content, then NEAR team will get in touch with you.
Good motives, we have.
To take an opportunity to practice delegation and be ready to join "MainNet Restricted"
To find and squash bugs in this testing phase of the network
To build NEAR technical governance as a community
To be prepared to engage our audience of delegators
Follow the rules, you will.
DO run a node and create your Staking Pool
DO ask other validators to stake to your Staking Pool, and vice-versa
Do NOT use social engineering or scripting to alter the metrics
Do NOT utilize brute-force attacks
Do NOT hack into machines of other participants. Instead, please report these vulnerabilities privately to the affected entity
May the FAQ be with you.
How do I become a validator?
If you already participated in the Stake Wars, you already applied to receive BetaNet tokens, and you already are a validator on BetaNet, you only have to deploy your Staking Pool contract and update the VALIDATORS.md file to receive extra delegation.
If you just learned about NEAR, you are already a validator, and you want to run a node on MainNet, you can follow docs on how to run your Stake Wars node here: https://github.com/nearprotocol/stakewars
The basic steps are:
- Create the new BetaNet wallet that will be used to deploy your staking pool smart contract
- Deploy the node and generate your new validator_key.json file
- Issue your staking pool contract using the wallet / CLI, taking the information from your validator_key.json file
- Add your validator node and the staking pool info to GitHub, to receive extra delegation
- Wait until your node becomes a validator (after two epochs, or six hours)
What is Staking?
We call “staking” the process done by a validator of locking a certain amount of funds to begin securing the network. The network will lock this stake and, if a validator submits fake transactions or try to game the system, destroys the funds (slashing).
Technically, staking consists of sending a specific transaction to the entire network, saying that a given account wants to become a validator. This transaction must provide a public key and staking amount.
When you deploy the Staking Pool, it will automatically broadcast the validator information for you, locking its funds. Every time that you or any delegator stake/unstake or “ping” the Staking Pool, the protocol will take care of the rest, updating your Staking Pool information – you don’t have to issue again the staking transaction.
NEAR automatically re-stakes all the rewards, so if you want to get back some of them, you have to manually un-stake and withdraw a portion of the locked funds. Once unstaked, the funds are unlocked within three epochs, or less than 9 hours on BetaNet (36 on TestNet and MainNet).
What is Delegation?
Delegation is very similar to a staking transaction: your funds will be locked following the same rules, but you will select a validator, and you will stake your funds with them, using their Staking Pool contract.
The Validator will not be able to touch your funds, and if they misbehave, you will not get slashed. However, delegation is almost as important as running a node, and spending time looking at how validators behave makes sure that only the best and most virtuous nodes are running the network. In that way, as a delegator, you can support NEAR security without running a validator node.
What is a Staking Pool Contract?
NEAR Protocol supports delegation via smart contracts, which we call Staking Pools. As a validator, you have to compile and deploy your Staking Pool contract by following the instructions on Github.
The steps are:
- Clone and compile the Staking Pool contract using Rustup
- Deploy the contract to your validator account, using Near Shell
- Use the Call method on the Staking Pool contract to setup the validator public key and the pool fees
- Use the Call method on the Staking Pool to delegate your own tokens to the contract, and become a validator
Once the Staking Pool is deployed, any delegator will be able to stake their funds with you, managing their rewards autonomously.
Pro-tip: you don’t have to deploy the Staking Pool contract directly from your validator node, you can use your own machine to do that.
Running a node is expensive, why no rewards for that?
We already rewarded this activity in the previous Stake Wars phase, and we believe that today learning how to run a node on NEAR is trivial if you are already a validator. As mentioned above, you will receive tokens and delegation once you join Restricted MainNet.
However, Stake Wars will offer periodic challenges in the community channels and will ask validators to perform activities to complete them. For example, the most challenging ones will offer rewards in exchange for original content, such as guides or small reports that will help other validators.