This should be an intriguing question/problem for anyone involved with bitcoin development or altcoin development.
I’m currently in development of an altcoin based on the bitcoin source code, which is designed to help charities raise capital. It does this by sending 20% of the coinbase reward to a pre-defined wallet address, whenever a successful block is mined by a miner. Lets call this wallet
the fund wallet. This 20% is used to fund the charity. As the coin is adopted and mined, this wallet receives a steady stream of coins.
The Part That Works…
I have made some changes to the original bitcoin code so that the mining reward can be split over multiple wallets when the coin is mined in the QT wallet.
src/miner.cpp the coinbase transaction is an object of type
CMutableTransaction, which has a vector of outputs called
Now, when a miner mines a block, the coinbase transaction’s output is split into two parts. First I resized the vector of outputs:
Then I define a hardcoded fund wallet like this:
std::string fundWallet = "A WALLET ADDRESS"; CTxDestination fundWalletDest = CBitcoinAddress(fundWallet).Get(); CScript fundCScript = GetScriptForDestination(fundWalletDest); coinbaseTx.vout.scriptPubKey = fundCScript;
Then I simply split the coinbase reward like this:
coinbaseTx.vout.nValue = 0.8 * (nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus())); coinbaseTx.vout.nValue = 0.2 * (nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus()));
This method seems to work beautifully, and on a network of 100 QT miners, it seems like every coin that the fund is owed is given to it correctly. I also added some code into the validation rules to ensure that blocks whose coinbase transaction vector is less than two in size, or whose second input is not the fund wallet, should be rejected.
After the mining difficulty got too high for solo-mining with the QT software, a number of pools started opening and the miners moved to the pools to continue mining my coin.
HOWEVER – When mining in a pool, the coinbase transaction is not being split correctly and the part that should be given to the fund is never arriving. The miners are still getting their 80% of the coinbase reward, but for some reason the 20% that should go to the fund is going missing and never arriving. In fact it is never being written into the blockchain
Pool Mining is Different to QT Mining
I am aware that the pool mining is a different section of the code to the QT mining. However, they both access the
CreateNewBlock function which includes the new logic. I am not sure why the 20% is being lost.
Why is the pool mining disregarding the 20% block reward for the fund when it accesses the same code which creates the blocks? What do I need to add to the code to ensure that the pool splits the coinbase reward correctly?
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!