A question came up on Reddit, " This is confusing, care to explain? (PoS minting)," that reminded me of a feature request that I’ve meant to discuss with the community.
Basically, the confusion exists due to a misconception between the what a user perceives “stake” to mean, and how the client (or the daemon) uses the term “stake”. From talking to other users (and from my own experiences, initially), the expectation is that somewhere in the client you would be able to see how many of your coins are mature and actively being used to solve for a block. Even though proof-of-stake is a fundamentally important part of the protocol (arguably the most important part), there’s no way for a user to gain insight into what’s happening behind the scenes when ‘CPUMinter’ is active.
Proposal
I’d like to propose the addition of a new method that can be called from the command line, or from the Peercoin-Qt client, that would output a list of the current input transactions that the CPUMinter process would look to after a block was solved. The (tentatively titled) method, listminting, in a hypothetical scenario, would report back to the user the following information, for each transaction:
[font=courier]$ ./ppcoind listminting
[
{
“account” : “A really old input transaction from an address kept offline until two minutes ago”,
“address” : “PLLxYKXkBxp2baP7Fn2sxcr1fCUjDxsHX6”,
“input_txid” : “e74b4543b44bfcfd431481dc641e25dcc9f3f63895293796757fdf9c1fcaa2e6”,
“amount” : 10000.001,
“status” : “mature”,
“age-in-days” : 568.21,
“coindayweight” : 900000.09,
“time” : 1394480691,
“proof-of-stake-difficulty” : 10.68816069,
“target” : 10987012,
“search-interval-in-sec” : 1,
“attempts” : 274
},
{
“account” : “A large input transaction that is over 90 days old”,
“address” : “PYK7Fn2sxcr1fCUjDxsHXXkBxp2baP6LLx”,
“input_txid” : “31481dc641e25dcc9f3f63895293796757fdf9c1fcaa2e6e74b4543b44bfcfd4”,
“time” : 1394780691,
“amount” : 10000.001,
“status” : “mature”,
“age-in-days” : 91.00,
“coindayweight” : 900000.09,
“proof-of-stake-difficulty” : 10.68816069,
“target” : 10987012,
“search-interval-in-sec” : 1,
“attempts” : 5270400
},
{
“account” : “Consulting Work”,
“address” : “PxsHLxYKX12baUjDP7Fn2sxcr1fCkBxX6L”,
“input_txid” : “c95293796757fdf91fcaa2e6e74b4543b44bfcfd431481dc641e25dcc9f3f638”,
“time” : 1396980691,
“amount” : 134.51289,
“status” : “mature”,
“age-in-days” : 37.901,
“coindayweight” : 5098.17304389,
“proof-of-stake-difficulty” : 10.68816069,
“target” : 10987012,
“search-interval-in-sec” : 1,
“attempts” : 682646
},
{
“account” : “An input transaction that has not yet matured”,
“address” : “Pp2baUjDxsHX6LLxYKXP7Fn2sxcr1fCkBx”,
“input_txid” : “481dc641e25dcc9f3f63895293796757fdf9c1fcaa2e6e74b4543b44bfcfd431”,
“time” : 1398480691,
“amount” : 8.001,
“status” : “immature”,
“age-in-days” : 7.21,
“coindayweight” : 57.68721,
“proof-of-stake-difficulty” : 10.68816069,
“target” : 10987012,
“search-interval-in-sec” : 1,
“attempts” : 0
},
][/font]
I’m not positive that it’s something that you could calculate (I assume it is, but need to re-read the code), but if we could include a “maxHashValue” report, it could be possible to then do a probability calculation to see how likely it is that a given transaction will come up with a hash that passes the test, [font=courier](target * coinDayWeight) / maxHashValue[/font].
Also, I’m still thinking about arguments that could be passed to the method. Presumably, you’d want a couple of related methods that covered all of the important ways to segment the data and to keep the scope of each more concise (I don’t know if you’d want all of these to be separate, but I wanted to cover the different ways of pulling back data):
[font=courier]./ppcoind listmintingbyaccount [count=10] [from=0] [minconf=1]
./ppcoind listmintingbyaddress [count=10] [from=0] [minconf=1]
./ppcoind listmintingbytransaction [count=10] [from=0] [minconf=1]
./ppcoind listmintingbyage [count=10] [from=0] [minconf=1]
./ppcoind listmintingbyweight [count=10] [from=0] [minconf=1]
./ppcoind listmintingbyattempts [count=10] [from=0] [minconf=1][/font]
Did I miss anything? Are there other values that would be useful to report on?
Edit: Added method variations section