About MasternodesMasternodes are nodes which have a certain amount of Spreadcoin locked within them and add additional functionality to the Spreadcoin network. In return for this functionality, Spreadcoin masternode owners receive a percentage of Spreadcoin mined in each block (currently 30% on testnet). The concept was originally developed by Evan Duffield of Darkcoin fame but Spreadcoin masternodes have been rewritten from scratch.
All the numbers in this post describe testnet, they can change when we introduce masternodes to mainnet.
Is SpreadCoin implementation based on DarkCoin code?No, this is original implementation.
How is it different from DarkCoin?In SpreadCoin there are no centralized reference nodes to decide which masternodes should receive payments, it is decided by the network in decentralized manner. In DarkCoin the messages which select masternodes are separate from the blockchain and are distributed independently. This way it is possible that nodes will have different opinion on what masternode should receive next payment. In SpreadCoin all votes for masternodes will be stored in blocks and the payee will be uniquely determined from the previous blocks. Just like you can check that any transaction included in the block is correct by comparing its inputs with outputs in previous blocks you will be able to check that masternode payment is correct by checking previous blocks. Why bitcoin is so reliable? Because all nodes have exactly the same rules how to determine which blockchains are correct and which one is better (required more work) than others, these rules are only depended on blocks themselves, not on the order in which they were received them nor on any other messages which you may or may not receive in time. The network can be unstable in the case of some major event which will break connectivity between nodes but once connectivity between nodes is reestablished all nodes will stick to the same blockchain. The same will apply to SpreadCoin.
How masternodes are elected?Each node monitor the network and assign scores to each masternode. This scores depend on how well masternodes provide their services, for instant transactions this will be time delay between transaction and its confimation by masternode. Since there may be no transactions and only elected masternodes will confirm transactions there is an empty service - each masternode will broadcast messages signining certain blocks to prove that it is running. Miners will include votes in their blocks. Votes can either be positive (elect not yet elected masternode) or negative (deelect already elected masternode). If masternode has more than 30 positive votes in the last 60 blocks then it is added to the list of elected masternodes. If masternode has more then 30 negative votes in the last 60 blocks then it is removed from the list of elected masternodes. Note that it is possible to determine which masternodes were elected at each particular block.
Can miners cheat to elect their own masternodes?The system is designed in such a way that all miners will make almost the same votes. Thus, unless you control more than 50% of the hashrate you couldn't actually affect the voting process because you will be outvoted by the rest of the network.
Wouldn't storing votes in blockchain make it too large?No, there is a limit of 10 votes per block and most blocks will have less votes.
How will masternodes receive payments?In each block part of the reward (30%) will go to masternode instead of the miner. Elected masternodes are sorted according to their identifiers and receive payments in order, there is no randomness in this process. Since it is possible to uniquely determine which masternodes are elected solely from the blockchain it is also possible to uniquely determine which masternode should receive the payment, nodes cannot disagree on this.
How much SPR is required to run a masternode?There is a limit of 1440 masternodes, only masternodes with top 1000 amounts will be elected to receive payments, therefore the exact amount you will need to lock will be determined by the market. This amount is locked but it is still yours, when you don't want to run your masternode anymore you can spend it.
Is static IP required to run a masternode?It is not required and for instant transactions this is not necessary.
What is instant transaction?It is a transaction which is confirmed by masternodes within seconds after broadcasting. Once confirmed there is guarantee that this transaction (and not any conflicting one) will be included in the blockchain.
What is the state of instant transactions implementation in SpreadCoin?Most effort was put into developing masternode election/payments mechanism, instant transactions are currenrly not fully implemented. Although masternodes confirm them there is no logic in place to replace unconfirmed transactions with the confirmed ones in the case of double spending attacks and to reject blocks with conflicting transactions. Note that rejecting blocks based on whether or not it includes transactions which conflict with confirmed instant transactions can lead to forks but this can be solved.
Which transactions can be made instantly?Currently these are all transactions with less than 15 inputs and fee of at least 0.001 SPR per input.
How To Create a MasternodeAt present, masternodes are being tested on Spreadcointalk.org. You are welcome to join us there and this guide will work. Or, once masternodes are released on mainnet, simply do the following:
1. Go to the, "Receive" tab and create a new address. Many of us like to label our masternodes in a way we can keep track such as, "Masternode1", "Masternode 2" and so on.
2. Go to the, "Sent" tab and send at least 100 SPR to that address. Note that once 1440 masternodes are created, the masternodes with the least number of SPR in them become delisted. As such, you may want to fund your masternode with more than 100.
3. On either the, "Overview" or, "Transactions" tab, wait for 50 confirmations on the coins.
4. Once you have 50 confirmations, go to the, "Masternodes" tab and enter the amazing GUI that Mr. Spread created. There you will see:
http://i.imgur.com/HaKeuKc.png5. Under the, "Control" column you should see your masternode with an empty checkbox. If you don't, click the, "Update" button and wait a couple seconds. Check the box for your masternode.
THAT IS IT! Yes, really. Once your masternode gets elected, you'll start receiving payments. Yes, Mr. Spread made setting up a masternode that easy! And yes, you can have more than one masternode per IP.
How To Setup a Masternode On Your VPSMany of us have VPS's and want to setup masternodes that way. This guide was created by Vertoe and
the discussion can be found here. If this helps you, Vertoe's SPR address is at the bottom of this guide, feel free to send him some SPR love!
VPS: I used Amazon Webservice running Ubuntu 14.10. This will be running the masternode.
Local: I used a Qt wallet to generate the transaction input and masternode secret.
Single masternode on one VPS.1 VPS: Get dependencies for building spreadcoin daemon:
sudo apt-get install git build-essential autoconf libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev libqrencode-dev libdb-dev libdb++-dev libminiupnpc-dev
http://i.imgur.com/h9PG2Ujl.png2 VPS: Get the source code:
git clone https://github.com/spreadcoin-project/spreadcoin
3 VPS: And switch directory:
http://i.imgur.com/rlIbJ4kl.png4 VPS: Checkout mn-test branch:
http://i.imgur.com/gxbRahUl.png5 VPS: Compile the daemon:
make -j $(nproc) -f makefile.unix
http://i.imgur.com/6ss0ng1l.png6 VPS: Create a config file:
mkdir -p ~/.spreadtestcoin
cat > ~/.spreadtestcoin/spreadcoin.conf <rpcuser=spreadcoinrpc
rpcpassword=3btqdvnaaY8Lsv934ZeULWRcgnv4KblablablaB2S5FHB # change this to something usefull
daemon=1
server=1
testnet=1
EOF
7 VPS: ...and "Install" the daemon:
sudo cp spreadcoind /usr/bin/spreadcoind
http://i.imgur.com/5LkPI6ql.png8 VPS: Run the daemon:
spreadcoind -daemon -server
http://i.imgur.com/Zajcc0Ql.png9 On your local wallet, get a new address and send at least 100 coins to that address and wait for 50 confirmations.
mnQEmuD8yC4UAkc8Fm6A49JfKaqAqTZEk5
10 On your local wallet, copy the transaction id.
7f7bbb802daa9723b1e060cfa28b6e1a1b6d5ad68f1136ca8f6aa9450edee6f7
11 Local: Generate a masternode secret from the transaction input by going to the console at tools > debug console. if input:0 fails, try:1, and so on until you get what you want:
mnsecret 7f7bbb802daa9723b1e060cfa28b6e1a1b6d5ad68f1136ca8f6aa9450edee6f7:1
http://i.imgur.com/sMkOyOll.png12 On the VPS, put it directly into the config file:
echo "mnstart=7f7bbb802daa9723b1e060cfa28b6e1a1b6d5ad68f1136ca8f6aa9450edee6f7:1:1c574e216511919b4578586843198d6c006171592001003986fccae864a3db9b78b6e08037f30fcbbfd33aeec23a6d2130e06556ae66a4796c731b778ad790f0d6:925EuDdYmiQvgq1S6em6kQ1WR5wU5qB8t7treVVFBhwxFLrkN27" >> ~/.spreadtestcoin/spreadcoin.conf
http://i.imgur.com/3zkeTtIl.png... wait for 50 confirmations of the tx ...
13 VPS: ...and start the masternode:
spreadcoind mnstart 7f7bbb802daa9723b1e060cfa28b6e1a1b6d5ad68f1136ca8f6aa9450edee6f7:1:1c574e216511919b4578586843198d6c006171592001003986fccae864a3db9b78b6e08037f30fcbbfd33aeec23a6d2130e06556ae66a4796c731b778ad790f0d6:925EuDdYmiQvgq1S6em6kQ1WR5wU5qB8t7treVVFBhwxFLrkN27
http://i.imgur.com/v4hXywIl.pngIf it says "true", you are done!!!einself
Multiple masternodes on one VPS.Repeat steps
9-13 for each masternode input with >100 SPR and >50 confirmations you have. Happy masternoding.
Worked?
SSHUvYeyGQcV6z1QvFiu2SppKDTbb2ZFC1