Recently, I had a long discussion on why masternodes are useful to a cryptocurrency network. During my time spent in discord over the last few months, I’ve heard all kinds of legends about masternodes, and what they do, and why they are so useful. A lot of people think that masternodes are capable of a lot more than they actually are, and this comes mostly down to misused terminologies. So, we will first clear up some of those, and then dive into how a (simplified) cryptocurrency network works.
A word beforehand: I’m not a blockchain developer myself, so there may be some blind spots. If you find any, let me know and I’ll correct them!
A wallet is a piece of software that connects to other wallets and runs a blockchain. All wallets in the same network are connected to each other (not necessarily directly) along a graph like this (and yes it’s MS Paint, I’m a software engineer not an artist sorry):
So, each wallet is represented as a node, and here we are with the first terminological misconception! Before masternodes ever existed, each blockchain still had nodes. It’s just the wallet that’s connected inside the network. A connected wallet (No matter if it’s a QT wallet, Daemon, or whatever) is a node. In this case, it also doesn’t matter if the wallet holds any coins. It still participates in the blockchain just the same.
A Masternode connects to the network like any other node does. It just provides extra services which are enabled in the wallet software. In order to do so, there is a collateral required. A node is only allowed to offer special services to the network if the collateral is locked. If a node becomes a masternode it is still a node. What that means is: each masternode is a node. Not each node is a masternode! The two words are NOT synonyms even if widely used as such.
Hot, Cold and Controller Wallets
So before proof of stake, there were hot wallets and cold wallets. A hot wallet is a wallet that WAS, or IS, connected to the network in any way, and includes coins. Cold wallets can be generated with — for example — paper wallets. Those are addresses that were never in any way connected to the network. You can still send coins to it. If a wallet was connected to the network it means the private key was also exposed to the internet. Even if it was only on your own computer. If you have a virus, someone can steal it, and no matter when and how the address was connected, it MIGHT be able to be compromised. This isn’t the case for cold wallets. They were never connected, so no one from the internet can compromise them. Someone can still steal your USB sticks or paper prints though. So be careful ;)
In the masternode space, running a hot wallet means that the wallet with coins also acts as a masternode itself. If this is not the case (i.e. you split masternode wallets and the wallet that controls your masternode), then the masternode wallets are called cold wallets. They hold no coins, so even if they’re compromised, no one can steal anything from you. The wallet that holds your coins — no matter if it’s behind a firewall on your own computer or a VPS — is NOT a cold wallet. It is the controller wallet. The controller wallet is a special kind of hot wallet.
A lot of wallets have a -qt at the end in the file name, so people call them qt-wallets. But what’s a qt wallet actually? QT is a graphical user interface framework. It just shows stuff in a normal, non-tech, human way. QT is the most used framework in the crypto space, but there are also others, so please call it GUI-Wallet and not QT!
In the following section, we finally come to what masternodes do and don’t do. So, we’ll view a simplified model of how a blockchain works. For this, we’ll run through a proof of stake network. It’s actually pretty much the same for proof of work, but the examples are easier to explain with proof of stake.
So how does proof of stake work
Each node in the network with mature coins is eligible to stake. Staking means it gathers all previously unconfirmed transactions, validates, and encodes them into a new block. This block is then broadcasted to the network. All other nodes in the network will confirm the calculations of the staking node. With each new block in the chain, older blocks receive a new confirmation. If the network does not approve the calculations of a newly broadcasted block, then it’s rejected, and the status will show as conflicted in the wallet. This is called stale (in communities this is also often called ‘orphan,’ though the terminology is not quite right).
So, the above has a lot of terminology again. Unconfirmed transactions will first be validated, and the block they’re encoded in will subsequently be confirmed by the network.
I wrote that each wallet with mature coins can make a new block and get the blockreward in the introduction of this section. This is actually overly simplified. There are a lot of constraints to that in the network. In general, the more coins you have — and the older your coins are — the more likely it is for you to stake. “Older” resets every time coins are used to create a new block. So if 100 coins are used for staking after maturing for 5 days, then the 101 coins (assuming you get 1 coin as stake) are 0 days old afterwards, and they have to mature again. For the purposes of the following explanations, we’ll ignore the very complicated processes of how a node is selected to stake. It isn’t too important right now.
A stake is born
Let’s go through the processes that occur in the network where a node has staked. To illustrate it: More MS Paint!
What happens if two nodes think they should stake the same block? Two blocks must not have the same transactions encoded for the same block number. A network consists of thousands of nodes and fights with latencies. Therefore, it can happen that two nodes stake the same block. Let’s see a possible result of this.
A conflict like this is not easy to solve. One of the blocks needs to be rejected. But which? To be honest, I don’t exactly know how blocks are rejected in this case, so I won’t give you any half-wrong information on this.
Update thanks to Martin:
There’s actually a consensus on how those conflicts are resolved. Blocks are created with a hash like this: 0000000000000000000c95… this string represents a hex number. The lower the number is, the higher the difficulty to calculate that block (To go into detail on this is far beyond scope here). The block with the lower hash number will take precedence.
The blockchain will invalidate the higher block and the wallets on that block will roll back:
In the above example, the consensus worked and all nodes accepted the green block instead of the orange one. But what happens if this isn’t the case?
We get a divorce now. There is no consensus between the two parts of the network, so they split.
The nodes individually don’t really know who the majority is because they’re only connected to a small part of the network directly. This is a simplified explanation for why your wallet goes off-chain and you get an unnaturally high amount of PoS rewards, for example. The three nodes in the upper left will confirm each other’s transactions in their very own chain, and only those three can stake on that chain.
Now time for the magic orphan: If the nodes resync to the correct chain, the transactions mined there will still be visible in the wallet. But the blocks have no father in the real chain, and so they’re called “orphans,” and the transactions are not counted to anyone’s balance.
Proof of Work
So, all of this was simplified proof of stake to explain an example. How does this work in PoW? — It’s pretty much the same. Miners are connected to nodes, and act as a processor for the validation and gathering of unconfirmed transactions. Mining pools cluster all hashing power against a single node. If the node drops out, all the hashpower drops out.
So what have Masternodes to do with all that?
You will tell yourself by now… “XeZZ. Why do you explain this shit to me, I know masternodes are securing the network and preventing such things from happening. Don’t they?“ — No they do not!
All that we’ve talked about so far is what nodes do. But not each node is a masternode. It doesn’t matter whatsoever in the above examples whether one of the nodes is a masternode or not. In the confirmation and validation process of transactions, masternodes serve exactly the same function as normal nodes. Nothing more. After all, they are nodes. Masternodes perform special services on top of their normal node duties. So let’s finally come to the stuff masternodes don’t do.
Masternodes do not stake!
A masternode does not stake. The reward you get for running masternodes are a fraction of the blockreward the STAKER (Or Miner in PoW) receives. So the node with coins stakes, receives a block reward, and SENDS the coins to the MN address. The MN coins themselves do not stake and the MN itself does not stake.
Dash is not PoS!
Yes, Dash has masternodes. But its masternodes do not generate blocks. They just receive rewards for being there. Dash generates new blocks via Proof of Work. Yes, masternodes receive rewards, but Dash isn’t Proof of Stake, it’s just a payment for providing a service.
Masternodes are not mandatory for the blockchain
A PoW or PoS blockchain with masternodes will continue to run normally without a single masternode active. If all masternodes die, the blockchain runs as smoothly as before. It really doesn’t matter at all.
This is actually a half-truth. There are Sporks, which can require a payout to at least one masternode or else the chain will become stuck. But this spork can be deactivated, and then the chain will run normally. Sporks are complicated shit. In essence: They allow you to break the rules of the blockchain by activating and deactivating them. It enables features that would normally require a hardfork. They also work without masternodes and it’s a little off topic here, so watch this later if you’re interested: https://www.youtube.com/watch?v=rp-ebgbgK-M&feature=youtu.be
Masternodes do not secure the network
This one is only half-true. This is because a MN is a wallet that confirms blocks like any other wallet, and acts as a node securing the network like any other node. As MNs tend to be cold wallets, the amount of nodes in the network is generally higher than without them. But the MN has no special feature that makes the network more secure.
So what are they good for?
Well, masternodes are not useless, and they can perform special services. There are currently not a lot of services most masternodes implement, but in the future there might be several more use cases for this young technology. Some examples:
* Privacy features like ZeroCoin, ZCoin, Mixing
* Governance Voting
So this services doesn’t seem too important to you right now. But they are, and they will be. The Governance/Budgeting stuff is an especially cool mechanism to involve communities with spending of developer funds where each MN has a vote, and the more you are invested the more votes you get. Without being public because you just vote on the blockchain.
From the documentation:
Instant Transactions: SwiftTX transactions are confirmed and spendable within seconds, guaranteed by the network of masternodes, with no need to wait for multiple confirmations in order to be confident in the validity of the transaction.
This is actually the only way masternodes really confirm transactions outside of their normal node duties. The masternode acts as a kind of escrow in this case.
There is also a hell of a lot in development like validation of smart contracts off chain, crosschain transactions (MN as “escrow”) and more to come. The technology is very young and we will see lots of developments in the future!
Wallet best practice
For this I give the mic to mike! Chop Chop and watch that carefully if you do not want to lose your coins ;)
That’s it… But it has something good
I feel like I have to say it again. I am not a blockchain developer myself (in fact my c++ sucks), and the information here is a little simplified. I feel most of the misconceptions come down to the node = masternode synonymizing, which is just not the case.
Something good to find in all this terminological mess? Yeah, I’m often asked questions by coin developers and I do my research. If I’m in contact with the salesman or community guy I just try to educate them about their misconceptions. If I get a chain dev and he tells me the chain is shitty because there are not enough masternodes: Take your money and run! It’s amazing how little “Developers” (Synonym for scriptkiddies that fork a shitcoin and presale it) know about the chains and what their own masternodes actually do, but it helps me evaluate if I want to invest or not ;).
So happy masternoding. If anything is incorrect, please let me know so I can correct this!
At the very last some shameless promo
Some info about coins I really like. In most of them, I am active in the community too (No particular order). This is not financial advice! Do your own research!
The roadmap was recently updated and is looking nice. The founders are US based but the wider team is spread around the world. Join the discord ;)
ZEST is an awesome poject which currently lacks trading volume. It was only recently started and the community is slowly growing. If you have a big heart just read the very well written white paper. It focusses on a charitable vision and developments are done in the coming weeks. Join the discord for talk:
APR is a coin that focuses on loyalty and establishing its own little ecosystem. There are already 4 Shops in Istanbul that will accept APR as payment as soon as the mobile wallets are released, which is scheduled for end of July! The US based team is moving forward pretty well. It had some setbacks with TopBTC (Which is a really scammy exchange) but the project goes on and the roadmap is right on track.
Blocknode is also a loyality based coin but with a little different focus. The team is from south africa one of the leading banking countries in the world. They are really nice and already have some partners in the industry to use their program.
Recently swapped from NihiloCoin and with a huge partner (Actually its now integrated). This one has huge potential to become a widely used and demanded coin! Join the discord if you want to talk to the devs:
I love the wallet with the governance tab and really like their approach of a community driven project. They are developing a payment portal which can be used like bitpay but also with other coins then bitcoin.
One of the older ones which built a payment portal “like paypal”. Their community manager recently left and made a lot of waves. They are currently behind schedule in their roadmap but IF they finally release their stuff, this has good potential.
GIN has a very easy-to-use masternode hosting system. If you lack the technical knowledge to setup your own masternodes, the GIN-Platform can help you. They also have a good helpful community!
Currently developing a new tracking app specifically for PoS coins. It allows you to register your addresses and masternodes to get push notifications on rewards or the more crucial failing of masternodes.