Reserve balance

if i am minting, and use a reserve balance

how is the reserve balance chosen, from what addresses…does it matter?

what happens in I change reserve balance during minting

(a) up

(b) down

I imagine I should turn minting off before changing reserve balance

[quote=“jubalix, post:1, topic:2011”]if i am minting, and use a serve balance

how is the reserve balance chosen, from what addresses…does it matter?[/quote]

The code is here and here.

Here’s how I understand the algorithm (in the situation you describe):

  • all your received transactions are shuffled
  • only valid transactions are kept (not spent, etc.)
  • if a transaction amount matches the requested amount (i.e. balance - reserve), it’s used
  • it tries 1000 random sets of transactions and selects the closest to the requested amount
  • if you have any single transaction whose amount is closer than this set, use it
  • else use the set

So it tries to find a set of transactions whose sum is the closest to your balance minus the reserve. This process may involve randomness.

[quote=“jubalix, post:1, topic:2011”]what happens in I change reserve balance during minting

(a) up
(b) down

I imagine I should turn minting off before changing reserve balance[/quote]

If you change it using RPC, it’s stored immediatly and used the next time the algorithm above is run (about 0.5s later if minting is enabled). If you change it in the config file I think you must restart it.

thanks!!!

I think it may matter because the coin age is ignored during this selection. For example if you have a transaction output that equals the requested coins, it will always be used even if it doesn’t have enough coin age. It will be dismissed only later during PoS check. If you have other transactions with enough coin age they won’t be used at all.

But I guess this is a rare case where the consequences are not tragic (you miss some chances to find a PoS, but you still accumulate coin age and do not reduce the reward you’ll eventually get). It’s solvable but probably not worth the work right now.

The code says you can use a -printselectcoin debug flag to log the selected set.

[quote=“sigmike, post:2, topic:2011”]The code is here and here.

Here’s how I understand the algorithm (in the situation you describe):

  • all your received transactions are shuffled
  • only valid transactions are kept (not spent, etc.)
  • if a transaction amount matches the requested amount (i.e. balance - reserve), it’s used
  • it tries 1000 random sets of transactions and selects the closest to the requested amount
  • if you have any single transaction whose amount is closer than this set, use it
  • else use the set

So it tries to find a set of transactions whose sum is the closest to your balance minus the reserve. This process may involve randomness.[/quote]

Thank You very much Sigmike!

I really appreciate you reducing some of these processes in the code to English language logic.

This type of effort from you really helps me understand better.

Please do more like this on any aspect of PoS minting whenever you get the desire.

I applaud you. And, if you will post a Public Address I will send you a PPC donation.

Because, unfortunately, I am not a coder here is something I am reduced to just wonder about:
Paper Wallet Proof-of-Stake minting?
Could software be designed to be a PoS-minting Watch-only wallet? That is could a wallet possibly have a PPC Public Address but not have the Private Key and still participate in PoS minting? Perhaps if the Private Key has signed to allow minting?

[quote=“NewMoneyEra, post:5, topic:2011”]I really appreciate you reducing some of these processes in the code to English language logic.

This type of effort from you really helps me understand better.

Please do more like this on any aspect of PoS minting whenever you get the desire.[/quote]

I will try. I’m considering drawing schematics of some of the internal processes of peercoin (for example in Drakon). I think this kind of schematics are understandable by everyone if the steps are in plain english with the least possible technical terms. But I’m not sure I’ll have time for that. I may at least write a technical FAQ.

Thank you. I put an address in my signature.

[quote=“NewMoneyEra, post:5, topic:2011”]Because, unfortunately, I am not a coder here is something I am reduced to just wonder about:
Paper Wallet Proof-of-Stake minting?
Could software be designed to be a PoS-minting Watch-only wallet? That is could a wallet possibly have a PPC Public Address but not have the Private Key and still participate in PoS minting? Perhaps if the Private Key has signed to allow minting?[/quote]

I think Sunny King is already planning a solution but I don’t know if he mentioned how or when.

For the network to be secure, you need to prove you own aged coins to generate a PoS block (otherwise anyone could easily destroy the network by generating as many blocks as they want). Right now the only way to prove that you own them is by signing a transaction with the private key of your coins.

But the bitcoin system is very flexible so we can quite easily change the protocol to allow special transaction (that was done to allow multisig for example).

Most of the transactions are simple “pay to address”. That means they have a script attached that says “you can do whatever you want with these coins if you can sign with the private key of address X.”
On multisig transactions, the script says (for example) “you can do whatever you want if you can sign with 2 private keys of addresses X, Y and Z.”

In our case we could allow transactions with a script that says “you can generate a PoS block if you can sign with the private key of address X, and whatever you want if you can sign with the private key of address Y.”
This way you could have a private key that can only be used as PoS. You could keep it unlocked without too much risk.

We would have to force the output to be the same as the input in this PoS block (which is not the case right now: you can change your client to make it move your coin when it finds a PoS block).

I don’t know if there already are such transactions in bitcoin where a signature is only valid in a specific context. I think it should work. It’d probably require a new script “word” (something like “are we doing PoS?”).

It would also help on the issue mentioned above where you don’t know which coins are really used for minting.

Building a good user interface for that may take some time.

I think that’s one possible solution. There are certainly others.

Anyway I think we can’t implement a solution only on the client side because when you received your coin it was explicitly said that only your private key can use them and the protocol obeys that even during PoS. We need to change the protocol (i.e. all clients).

[quote=“sigmike, post:6, topic:2011”][quote=“NewMoneyEra, post:5, topic:2011”]I really appreciate you reducing some of these processes in the code to English language logic.

This type of effort from you really helps me understand better.

Please do more like this on any aspect of PoS minting whenever you get the desire.[/quote]

I will try. I’m considering drawing schematics of some of the internal processes of peercoin (for example in Drakon). I think this kind of schematics are understandable by everyone if the steps are in plain english with the least possible technical terms. But I’m not sure I’ll have time for that. I may at least write a technical FAQ.

Thank you. I put an address in my signature.

[quote=“NewMoneyEra, post:5, topic:2011”]Because, unfortunately, I am not a coder here is something I am reduced to just wonder about:
Paper Wallet Proof-of-Stake minting?
Could software be designed to be a PoS-minting Watch-only wallet? That is could a wallet possibly have a PPC Public Address but not have the Private Key and still participate in PoS minting? Perhaps if the Private Key has signed to allow minting?[/quote]

I think Sunny King is already planning a solution but I don’t know if he mentioned how or when.

For the network to be secure, you need to prove you own aged coins to generate a PoS block (otherwise anyone could easily destroy the network by generating as many blocks as they want). Right now the only way to prove that you own them is by signing a transaction with the private key of your coins.

But the bitcoin system is very flexible so we can quite easily change the protocol to allow special transaction (that was done to allow multisig for example).

Most of the transactions are simple “pay to address”. That means they have a script attached that says “you can do whatever you want with these coins if you can sign with the private key of address X.”
On multisig transactions, the script says (for example) “you can do whatever you want if you can sign with 2 private keys of addresses X, Y and Z.”

In our case we could allow transactions with a script that says “you can generate a PoS block if you can sign with the private key of address X, and whatever you want if you can sign with the private key of address Y.”
This way you could have a private key that can only be used as PoS. You could keep it unlocked without too much risk.

We would have to force the output to be the same as the input in this PoS block (which is not the case right now: you can change your client to make it move your coin when it finds a PoS block).

I don’t know if there already are such transactions in bitcoin where a signature is only valid in a specific context. I think it should work. It’d probably require a new script “word” (something like “are we doing PoS?”).

It would also help on the issue mentioned above where you don’t know which coins are really used for minting.

Building a good user interface for that may take some time.

I think that’s one possible solution. There are certainly others.

Anyway I think we can’t implement a solution only on the client side because when you received your coin it was explicitly said that only your private key can use them and the protocol obeys that even during PoS. We need to change the protocol (i.e. all clients).[/quote]

Wow! SigMike - that was pretty much my dream answer.
I sent you a PPC donation.

The Drakon looks great! Having the algorithms laid out in Drakon would be excellent for me as I am much more a visual thinker than a logical linear word-based thinker. Seeing the Algorithms in Drakon would be fantastic!!! And, I suspect not just for me but for many others too. I know you said you don’t have much extra time - I understand - and I’m wondering if I could help somehow?

If you have a university near by, or even if you don’t, maybe you could find some intelligent young computer science student, or equivalent, who is needing a little temporary part-time work for some extra $ and he could help you with the Drakon charts. You know, you tell him what to do in short order, he takes the time and effort getting it laid out - then you briefly critique - he works long and hard trying to make it right. It would be a great deal for him as he would be learning about Peercoin and Drakon and making a few bucks. It might save you a lot of time and effort - while making something genuinely useful.

I don’t know what is fair for temporary intelligent-student wages these days? Fifteen dollars an hour? Twenty hours a week? That would be $1,200/month. If you would like to try it for two or three months and see how it goes? I could send PPC, BTC or US dollars if that could help you amplify your output with the same effort. What do you think? Could this be workable?

Anyway, if there is any way I can help you, please let me know. Ok?

That was a pretty great looking debate you were engaged in over in the “What stops me from POS minting several different chains at once?” thread, but again I need a better ‘picture’ of the algorithms in my mind to really even understand the debate. (Need Drakon Charts of Peercoin Processes!!!)

May I ask? What brought you to peercoin? Are there other coins you are investing yourself into? Are you involved with Peercoin fully now? You are much more knowledgeable than me about the robustness, ability-to-defend, scale-ability and general dynamics of the algorithms: Are you personally confident in the long-term prospects for Peercoin?

I haven’t said it but my favorite part of your answer was your intelligent reply to the Paper Wallet PoS minting question. Thank You.

Ok I’ll try do draw some schematics in Drakon. Is there a particular process that would interest most people?

Keep asking unanswered technical questions.
I like challenges and if a question tickles me, I’ll want the answer as much as you and I’ll look for it.
On most of the questions I answered I didn’t have the answer when it was asked. I looked at the code and thought about it to find an answer.

Of course donations also help me to free up some time. Thank you for that.

I think that would take me more time than I’d gain. And it wouldn’t be as fun as doing it myself.

Yes, that’d be a good start. I’d like to summarize this thread too.

It’s not only an algorithm though. But maybe the individual processes can also be illustrated in Drakon. For example “Are there 2 competing chains?” Yes => “Did I change my client to mint on all chains?” Yes => “I send 2 PoS block” => “Have most of the nodes changed their client to allow duplicate PoS?” No => “Only one of my PoS blocks is propagated” => “Same result as if I didn’t change my client”.

The efficiency. Wasting power to secure a coin is fine given the benefits, but only as long as we don’t have cleaner solution. Peercoin seemed like a good solution.

What made me stay and invest myself is a little different though:
I came to the conclusion (with the help of blog posts and other things) that the biggest danger in bitcoin is the diverging interests of the people who use it and the people who secure it. Their interests are different, and the power is only on one side. If there’s a conflict it’s the miners who will have the final word to change the protocol or to block a change. And with the mining pools it’s even worse: the power is in the hands of a few pool managers.
I can’t see how they can fix that.
Peercoin solves this brilliantly. There’s almost only one side.

There are other problems with bitcoin (like the huge blockchain) but I think they will be solved.

I’m still very interested in bitcoin, but I don’t invest my time working on it. They certainly have enough people already.

I still haven’t seen another coin providing any significant improvement that would tickle my interest. I looked at NXT a little bit, but the partially closed source and the initial distribution lost me very quickly.

I am confident it’s technically robust yes, but I’m still looking for supposed flaws to put them to the test, if you know any (in another thread maybe).

Also, I’m quite new to this cryptocurrency world so I’m not that knowledgeable. I read and understand source code quite well, that’s true.

As for the prospects, I have no idea. The technical part is one thing, but for peercoin to become big there are so many other things in play like community, marketing, economics, politics, psychology, etc.