--- layout: post title: Development Update - June 2, 2015 date: 2015-06-02 11:15:08.000000000 -04:00 type: post published: true status: publish categories: - Development Updates tags: [] meta: _edit_last: '2' _et_pb_page_layout: et_right_sidebar _et_pb_side_nav: 'off' _et_post_bg_color: "#ffffff" _et_post_bg_layout: light _webdados_fb_open_graph_specific_image: '' author: login: fernando email: gutierrezf@gmail.com display_name: Fernando Gutierrez first_name: Fernando last_name: Gutierrez ---

Hello Everyone!

We’re just starting to wind down active development of version 12, which is gearing up to be the largest release we’ve ever done. At this point it includes:

- The removal of the reference node
- A new quorum based masternode payment consensus system. This means masternodes will be elected each block to “vote” on who gets paid.
- New budgeting protocol and a whole new list of commands for interacting with the budgeting system
  There’s a hard fork and sporks that will activate and reduce the blockchain by 10%, after that superblocks will become available for a maximum value of 10% of the monthly reward.
- Updated to Bitcoin v10 with headers first blocks
- New improved masternode broadcast/ping architecture
- New wallet repair buttons
- New website for submitting proposals
- Improvements to DS

At this point active development is going to slow down and we’re going to open private testing of the new functionality for the core team. This should last less than 2 weeks, then we’ll open public testing and development soon after. The public phase should be between 2 weeks and a month then we’ll do a full release.

At this point we’re looking for public comment and evaluation of the new source code for any issues that might be present.

Are you a skilled developer?

Feel free to checkout all of the new code and give us feedback via evan@dashpay.io or jump on slack chat and join the #development channel.

Full v12 source code:
https://github.com/dashpay/dash/tree/v0.12.0.x

Budgeting Code:
https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternode-budget.cpp
https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternode-budget.h

New Payment Code:
https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternode-payments.cpp
https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternode-payments.h

Description of Budgeting and Payment process:

In the new model, each block a random selection of 10 masternodes are elected to tell the network who should get paid. This is computed using the masternode input hashes for the first payment, then after a last payment is known a valid masternode with the longest wait time is selected.

Selection Algorithm:
https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternodeman.cpp#L368

Masternode Selection and Broadcast:
https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternode-payments.cpp#L460

Block Validation:
https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternode-payments.cpp#L280

Consensus disagreements are handled by the block validation code. After a period of time, the network should form complete consensus about who is suppose to get paid on which blocks. If there’s a disagreement, multiple payees per block can be valid. After the whole masternode network has been paid, only 1 payee should be valid each block. This gives us a pretty robust system that’s quorum based instead of blockchain based, so we don’t have to keep a complete history, but yet it’s just as secure.

Budget System Implementation

We now have a complete implementation of the budget system now in v12. Described Here and Here:

To submit a budget all one has to do is execute the following command:

`'mnbudget vote PROPOSAL-NAME URL PAYMENT_COUNT BLOCK_START DASH_ADDRESS DASH_AMOUNT YES|NO|ABSTAIN’
dash-cli mnbudget vote proposal-one http://www.dashpay.io/one.json 100 58381 y7B3r6SBi1E1RN39DS5WFJpdeS9EifDjMB 1000 yes
`

`dash-cli mnbudget show
{
"proposal-one" : {
"URL" : "http://www.dashpay.io/one.json",
"Hash" : "22a7fab3765b0aca926f71117114b5019ab616dda3d6bae520a27d76912228dd",
"BlockStart" : 58381,
"BlockEnd" : 63375,
"TotalPaymentCount" : 100,
"RemainingPaymentCount" : 100,
"PaymentAddress" : "y7B3r6SBi1E1RN39DS5WFJpdeS9EifDjMB",
"Ratio" : 1.00000000,
"Yeas" : 1,
"Nays" : 0,
"Abstains" : 0,
"Alloted" : 348214275,
"TotalBudgetAlloted" : 348214275
}
}
`

Any masternode can submit a budget directly through the API. The proposal managing website will simply have access to a masternode ,so it will have the capability of drafting then submitting new budgets to the network. This system is designed to be 100% decentralized and is built around the idea of storing all important budget information on the network itself, so that the proposal websites can run independently of the network, but still interact with it.

After a budget has been submitting to the network, other masternodes can calculate the hash of the budget in order to vote on it. By changing any piece of data associated with the proposal, the hash will be changed. Because of this once a proposal is in the system and being voted on, it can’t be changed without making a completely new proposal and requesting the masternodes vote on that one instead.

Finalized Budget

Once each month, a finalized budget will be suggested by the network. This is simply calculated by taking the list of budgets, sorted by “Yes Count”, then adding them to the final budget until 10% of the monthly reward is reached.

Masternodes will automatically vote on the finalized budget, which is then read by the network to authorize a super blocks at the end of the month.

https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternode-payments.cpp#L22
https://github.com/dashpay/dash/blob/v0.12.0.x/src/masternode-payments.cpp#L50

`dash-cli mnfinalbudget show
{
"main" : {
"SubmittedBy" : "0000000000000000000000000000000000000000000000000000000000000000-4294967295",
"Hash" : "34000e61801cb0df633839a3090c9241461b33e4d031c42632d64a3a109dc132",
"BlockStart" : 58400,
"BlockEnd" : 58400,
"Proposals" : ",22a7fab3765b0aca926f71117114b5019ab616dda3d6bae520a27d76912228dd",
"VoteCount" : 1
}
}
`