This development dispatch covers work completed since the Decred v0.1.1 release from April 25th, 2016. Since then, developers have merged 37 pull requests of code into 7 software repositories. New repositories were created created and populated for a consolidated miner known as
gominer as part of RFP-5 and a statistical dashboard known as
dcr-netstats as part of RFP-3 (in addition to
decred-dashboard that is hosted at
https://dcrstats.com). During this period, a total of 19 commits occurred in these repositories and represent modifications to the effect of 3,777 lines of code added to and 920 lines removed from the Decred codebase (dcrd, dcrwallet, dcrprclient, gominer). 25 commits also occurred in other Decred repositories (dcr-netstats, ccminer, cgminer).
A series of RFP milestones were achieved and paid for from the development subsidy. Milestones paid for include (See:
Status and Expenditures):
- RFP-6: Pool has been successfully tested for 1 week on testnet and configuration verified (x2) (1c640e9, ef20c2e)
Binaries:
https://github.com/decred/decred-release/releases/tag/v0.1.2dcrd- getstakedifficulty now returns the calculated stake difficulty of the next block. When the next block is a stake difficulty readjustment, users will now see the upcoming stake difficulty (137-8207e4d)
- Improved fee handling (139-c9a0afa)
- Moved non-mempool specific functions to a new file and added more test coverage (140-14c7cc9)
- Fixed an issue with mempool fees where the memory pool would incorrectly eliminate transactions sent over sendrawtransaction that had high fees while also always rejecting high priority transactions (141-4328736)
- Added a new estimatestakediff RPC command to estimate the minimum and maximum next stake difficulty. The caller can also estimate a new difficulty given a passed number of tickets to be mined in the remaining difficulty period (143-7fd213b)
- Added two new RPC commands designed for wallets running stake pools (stakepooluserinfo and addticket) (144-f1796b0, 148-084edf8)
- Added two new RPC commands to calculate the volume weighted average price of tickets (ticketvwap) and to get the transaction fee information for regular transactions in blocks, the mempool, and a height range (txfeeinfo) (145-29f116c)
- Updated documentation (147-5623458) and versioning (150-f93cb9f)
dcrwallet- Added a non-default allowhighfees flag to wallet that enables users to send transactions that are not safety checked for high fees (214-ec2c1c2)
- Fixed an issue that could cause lock-ups in wallet (219-0e7558d)
- Improved error handling (224-d4ea045)
- Updated versioning (225-e545bec)
dcrrpcclient- Added a number of new RPC commands (addticket, estimatestakediff, settxfee, stakepooluserinfo, ticketpoolvalue, ticketfeeinfo, ticketvwap, txfeeinfo) (16-a5a51f5)
gominer- Enabled TLS, improved configuration, added a sample config file, and updated licensing (3-39550c6)
- Updated configuration (1-d43cd3e, 2-43e6a84)
ccminer/cgminerDeveloper NotesAdded stake pool fee functionalityWe have added new config flags for dcrwallet. Let's go over each option to make crystal clear its usage:
stakepoolcoldextkeyWhen this option is set it turns on stake pool functionality for wallet. When stake pool is enabled for wallet, there are a series of transaction checks to verify whether this wallet will vote for a ticket that has used this stake pool's address as the ticketaddress. This option requires the extended public key of the stake pool's cold wallet that will receive the pool's fees. So on simnet for instance this option looks like this:
--stakepoolcoldextkey=spubVWAdividNTiSM9SdLRA5JX6LYNwt58cd51TFnpnULGQ8oqNMNskfkQwU7rjWMCY7phBguVr4XTmAWyDVRKpo2dFyjFb6QG4ihB8w64UPNuu:1000
The first portion (spub..., or dpub... on mainnet) is the extended public key and the second (1000) is the number of addresses to derive. Every user of the pool gets their own cold fee wallet address derived, so we recommend using at least 1000 in anticipation of the relative number of users in the stake pool. When a vote is created by the stake pool to vote on a ticket that has been given voting rights, it pays the pool fee to the address derived for the cold wallet from this extended public key.
pooladdressThis is for use by the stake pool user. It will be an address provided to the user by the stake pool. If set, this address is used during ticket purchase and will commit to a small output in the ticket that gives the stake pool its required fees.
ticketaddressSame as the old option. This is the address that the stake pool user is giving the ticket's voting rights to.
poolfeesThis is the required ticket fee as requested by the stake pool. The value set by the user needs to be greater than or equal to that of the pool. The fee is a percentage based fee, based on the stake subsidy. Here is a concrete example from simnet:
The ticket price of this ticket was 46.0551008, and the ticket relay fees were 0.00000100 per kB. The pool fees were set to 1.00%. The subsidy on simnet at this block height is approximately 29.40888 Coins per vote. This is the ticket as purchased by the user:
"vin": [
... ,
],
"vout": [
{
"value": 46.0551008,
"n": 0,
"version": 0,
"scriptPubKey": {
... ,
"reqSigs": 1,
"type": "stakesubmission",
"addresses": [
"SsYZMHeeixdNRTkk6afzHBPL4unYDsFNd4r"
]
}
},
{
"value": 0,
"n": 1,
"version": 0,
"scriptPubKey": {
... ,
"type": "sstxcommitment",
"addresses": [
"Ssghjx8PvQVV3FM3w5FcGi9kWGvDpDkQDTV"
],
"commitamt": 0.17948021
}
},
{
... ,
},
{
"value": 0,
"n": 3,
"version": 0,
"scriptPubKey": {
... ,
"type": "sstxcommitment",
"addresses": [
"SsYUi5tbXfqHnTPgvHcajNW4yiGeSP6n7Xq"
],
"commitamt": 45.87562609
}
},
{
... ,
}
],
And here's the vote that the stake pool created for that user's ticket:
"vin": [
{
... ,
},
{
... ,
}
],
"vout": [
{
... ,
},
{
... ,
},
{
"value": 0.2940888,
"n": 2,
"version": 0,
"scriptPubKey": {
... ,
"type": "stakegen",
"addresses": [
"Ssghjx8PvQVV3FM3w5FcGi9kWGvDpDkQDTV"
]
}
},
{
"value": 75.16989347,
"n": 3,
"version": 0,
"scriptPubKey": {
... ,
"type": "stakegen",
"addresses": [
"SsYUi5tbXfqHnTPgvHcajNW4yiGeSP6n7Xq"
]
}
}
]
As you can see '"n": 2,', the third output, is the stake pool fee of 0.2940888. This is 1% of the vote reward at that point (0.2940888/29.40888). The remaining subsidy and the original coins are returned to the take pool user in output '"n": 3,'. For more information about stake fees, please refer to
dcrwallet/wallet/txrules/doc.go.