After spending 2 days debugging getblocktemplate requests my conclusion is:
Most mining software implements a subset of GBT to make it work for them and doesn't follow the standard strictly.
Miners also introduce some other rules in agreement with pools that are not documented.
If you are working on a pool you will have to manually test it against miners to be sure it works (good luck).
I couldn't get cgminer to work with my pool proxy. The problem is that it differentiates between solo and pool mining (what I don't think is part of the getblocktemplate specification). After reading the source code I found this
https://github.com/ckolivas/cgminer/blob/master/cgminer.c#L6512. So, cgminer will only treat you as a pool if you submit "coinbase/append" and "submit/coinbase" as mutables. This is not really explained anywhere and it took me some time to figure it out. I can understand the idea behind this choice, but it still looks a bit arbitrary to me. It will just reject you with a message that you are not a pool without clarification. I can see users breaking their head over this.
To answer some of the questions myself after 2 days of researching:
1. Stratum is much better defined and smaller. It is also more popular between pools. This makes it easier to implement and find information about. It's straight forward, there is basically only one way to do it. You loose some flexibility, but at least you don't need to deal with the mess of BIP22 and BIP23. I will try to write a tutorial how to implement GBT correctly if I find time.
2. Because of cgminer behavior the proxy needs to do much more. Now it needs to understand "submit/coinbase" and keep track of the transactions submited to the miner. It makes it more complicated. But using a bitcoin node to get information from the network and not implementing your own is still a good idea.
I didn't get to experiment with setting the difficulty. I hope I will soon have a proof of concept pool running on testnet to try more advanced stuff.
P.S. What is wrong with you guys? Accusing me of scaming. Casually requesting me to send you 25btc. Promoting your own pools. From my perspective this doesn't look like a welcoming community.
I never accused you of scamming - I was responding to the comments made by Phil. I think it's cool that you're trying to understand the processes behind the scenes and are experimenting with your own software. Personally, I'd recommend taking a look at some of the existing implementations (ckpool, NOMP, UNOMP, stratum-mining, eloipool, etc). See how those guys tackled the problems you're facing. Who knows, maybe you'll be inspired and write the next great thing
.
Also, I apologized previously, but let me do so again in case you missed it. I didn't mean to hijack your thread chatting about my pool. A lot of us were just scammed by some guy running a long con. He opened up a pool this past summer. Was active on the boards and responsive to queries and support on his pool. Right up until I found the pool's first block. Within minutes, the pool went down, the website went dark, email servers were taken down. The pool operator took the 25
BTC and ran. So, as a gesture of goodwill, I am providing a place for miners to point their hash. That's all.
Both Phil and -ck have made the same offer - which I personally think is very generous of them. If you're a newbie account and want to open up a pool, they are willing to escrow the 25
BTC for the first block. That way, miners will know that they'll at least get paid for the first block. It's not a perfect solution - but at least it's something to try and prevent the scammers from continually taking advantage of folks.