On Mining

Q: What does the mining and creation of coins look like?

A: It’s a Proof of Work (PoW) called “Cuckoo Cycle”, which was created by John Tromp who is fairly well known in the mining community. He worked on the equihash solver for Zcash, I believe. I won’t go into detail on how it actually works, but it’s a very memory-intensive PoW. At launch it’s likely you’ll need at least 8Gb worth of memory on your graphic card. It’s morphed a bit over time, at first it was latency-bound and then it was memory bandwidth-bound and now there’s been some talks about what we’ll do about ASIC-resistance in the future. But the PoW is very sound, I think. John wrote the first version of the solvers, and we’ve since had some other people come around and they’ve managed to decrease the solve time by a factor of 4. In this context we’re talking about number of searches through a graph per second, which is how Cuckoo Cycle works. What we’re looking for in a PoW is to try and keep it distributed. You don’t want to rush towards centralisation you want to make sure everybody has a chance to mine it, at least initially. And I think this PoW does a good job at that because even with GPUs and the work that’s been done recently to speed that up, CPU mining is still viable at this point. And you get a ratio, maybe CPU will be an 1/8th as useful or a 1/10th as useful as a GPU but it’s still useful and you can still use it. So if we can keep that up for a little while I think it will have done it’s job until you know, the big actors swoop in, build an ASIC and the game changes. You’d like to avoid it and keep this from happening for as long as possible and keep it non-centralised, but we’re planning for it to happen at some point. Because I think it’s probably inevitable. When there’s enough value, somebody is going to do it, there’s no doubt about that.

Q: What about the emission rate?

A: Right now it’s planned to be linear. 60 grins every minute for the rest of eternity. We can argue about this one way or the other. We hear people coming new into the project and saying “well Bitcoin has a successful model, why don’t you just follow that?”. I don’t think Bitcoin’s model is actually that successful, not as a currency. I think the approach taken by Grin is fairly unique amongst other coins. The rate of inflation is not going to look as bad as it does on paper–as you need to take into accounts for the amount of lost coins. The inflation rate will cover the amount of lost coins, and that’s about it. In fact the inflation rate actually approaches zero over time. So if anything there’s going to be too few grins going out. There are a lot of people with a lot of opinions on this topic, people seem to be passionate about it. We are aware of both sides of the argument and try to take them into consideration, like we do with most things on the project. We all believe the work and technology is important. But you’re not going to find any ideologues on the project. People are listening to arguments, listening to reason. And we make all decision knowing that whatever we decide is probably going to be the wrong thing to do, but there’s no way of knowing right now. So you try to design your code to make sure you can handle eventualities when they come in.

Q: Is there a difficulty adjustment with the mining?

A: Yes, it’s based on Digiwave/Digishield algorithm. It’s dynamic, looks at the past 60 blocks, finds the median and does some calculations and adjusts up and down from there. We think this is a good approach that makes us less open to attacks.

Q: Is there a pool protocol for the miner?

A: A version of Stratum has been implemented, there’s a stratum server running now. I did some work to split out the mining out of the core code. There’s been some interest in shown for running a pool.

Q: Is there something like a block-size limit?

A: We do it by weights as opposed to a particular block-size limit. So if you’re creating an output, it would give you greater weight in a transaction, as you end up creating a range proof which adds to the block size, which adds to bandwidth needs. There is a formula that weighs the number of inputs/outputs in the transaction. It’s not set in stone, it’s not like there’s a constant. I don’t expect to see a big political debate about big blocks versus small blocks in Grin. The way that the protocol is built has a natural disincentive to create big massive blocks. We’ll have to see if there’s something we would need to address further down the line.

Q: And the block time right now?

A: It’s aimed at one minute. It is more than that at the moment as there’s so little mining power for Testnet grins of no value.

Q: What factored into the decision for one minute?

A: It makes for a nice, useable chain. It does creates challenges as it obviously creates more blocks. You’re more than likely going to have a lot of orphans going on. But it’s not the minimum it could be. I think one minute is fast enough for the most part. Again this is another philosophical debate that I don’t have a strong opinion on. Everybody has opinions and they are probably right at the same time.

Q: Can you have zero confirmation transactions that happen faster than one minute?

A: You can, yes. You can do zero confirmations and cut them right through. If you just sold a porsche you’d probably want to wait for a confirmation or two though.

Q: Why, is there a double spend possibility?

A: No, but you could have two people with the same wallet key putting up a transaction at the same time. It’s unlikely but it could happen. So you do want to wait for at least one confirmation.

Q: How are the fees calculated?

A: They are adjustable, there’s a minimum fee calculation. It’s a consensus decision, based on the number of inputs and outputs. Outputs creates stress on the chain. And you can choose to include a larger fee if you wish to get prioritised by the miners. It’s up to the miners to figure the right fees out.