# Use Bitcoin miner for Peercoin

**URL:** <https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469>\
**Category:** General\
**Created:** [July 9, 2021, 3:36pm UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469 "2021-07-09T15:36:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenz10](https://talk.peercoin.net/user_avatar/talk.peercoin.net/lorenz10/32/3764_2.png) [@lorenz10](https://talk.peercoin.net/u/lorenz10)\
**Post date:** [July 9, 2021, 3:36pm UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469/1 "2021-07-09T15:36:15Z")

</div>

Hi everyone,

I’m trying to start mining on my private Peercoin fork (Testnet) and I’ve choosen ntgbt miner to do it, a simple miner which exploits the RPC commands. [GitHub - vsergeev/ntgbtminer: A no thrills getblocktemplate Bitcoin miner, written in Python.](https://github.com/vsergeev/ntgbtminer)

It can connect with the chain, but when submitting the new block it returns an error.  
Submitting manually through the RPC with “submitblock” I get “Block does not start with a coinbase” and trying to decode the transaction with “decoderawtransaction” returns “TX decode failed”.

QUESTION

I was wondering if Bitcoin miners are still compatible with Peercoin ?  
If not, what is the problem with this block / transaction ?  
I was thinking to make this miner compatible also for Peercoin in case this is not too complicated…

TEMPLATE  
{  
“capabilities”: [  
“proposal”  
],  
“version”: 3,  
“rules”: [  
“csv”,  
“!segwit”  
],  
“previousblockhash”: “00005ba98b590b60c7df80b06a892993f5dd6235e54708480019426d38c1945f”,  
“transactions”: [  
],  
“coinbaseaux”: {  
},  
“coinbasevalue”: 8408120000,  
“longpollid”: “00005ba98b590b60c7df80b06a892993f5dd6235e54708480019426d38c1945f2”,  
“target”: “0007ffff00000000000000000000000000000000000000000000000000000000”,  
“mintime”: 1624194519,  
“mutable”: [  
“time”,  
“transactions”,  
“prevblock”  
],  
“noncerange”: “00000000ffffffff”,  
“sigoplimit”: 80000,  
“sizelimit”: 4000000,  
“weightlimit”: 4000000,  
“curtime”: 1625761879,  
“bits”: “1f07ffff”,  
“height”: 1,  
“default\_witness\_commitment”: “6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9”  
}

GENERATED BLOCK

030000005f94c1386d421900480847e53562ddf59329896ab080dfc7600b598ba95b000016e5f8cb4524b74c25af4849e2334bd66ea5f519ba92ac76f12d8d111c2fce658928e760ffff071f8d5500000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0c010161626364656600000000ffffffff01c0ba29f5010000001976a914aeae10fcd9256bbc45f8b2a09a4e2fba7e05178f88ac00000000

BLOCK DECOMPOSITION I DID (Reference: [Bitcoin Technical Guide | Simple Explanations of How Bitcoin Works](https://learnmeabitcoin.com/technical/))

version: 03000000

previous hash: 5f94c1386d421900480847e53562ddf59329896ab080dfc7600b598ba95b0000  
merkle root: 16e5f8cb4524b74c25af4849e2334bd66ea5f519ba92ac76f12d8d111c2fce65  
time: 8928e760  
bits: ffff071f  
nonce: 8d55000001

version:01000000

#input  
count: 01  
txid: 0000000000000000000000000000000000000000000000000000000000000000  
ffffffff

#scriptsig  
size: 0c  
scriptSig: 010161626364656600000000  
ffffffff

#output  
count: 01  
value: c0ba29f501000000  
size: 19  
scriptPubKey: 76 a9 14aeae10fcd9256bbc45f8b2a09a4e2fba7e05178f 88 ac #P2PKH

locktime: 00000000

NOTE

there was a similar unanswered question last year:

> [@Solo Mining on a private test net](https://talk.peercoin.net/t/solo-mining-on-a-private-test-net/10043):
>
> I want to explore peercoin core. I am trying to set up a private 2 or 3 nodes peercoin network just for exploration. I have compiled source code and disabled internal peers. I have also re-mined an updated genesis block with updated nTime. I am also able to connect two clients running in a virtual box vms. Now i want to start a miner similar to that internal miner in older versions. I have lower the difficulty so cpu can easily mine a block in 2 or 3 minutes. I have tried BFG Miner, CG Miner…

---

<div class="post-metadata">

**Author:** ![nohea](https://talk.peercoin.net/user_avatar/talk.peercoin.net/nohea/32/907_2.png) [@nohea](https://talk.peercoin.net/u/nohea)\
**Post date:** [July 10, 2021, 4:18am UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469/2 "2021-07-10T04:18:24Z")

</div>

the tx format in peercoin is different from bitcoin. It contains the timestamp. You may have more luck setting up your own mining pool, rather than “solo” mining.

---

<div class="post-metadata">

**Author:** ![lorenz10](https://talk.peercoin.net/user_avatar/talk.peercoin.net/lorenz10/32/3764_2.png) [@lorenz10](https://talk.peercoin.net/u/lorenz10)\
**Post date:** [July 12, 2021, 7:24am UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469/3 "2021-07-12T07:24:15Z")

</div>

ok thanks nohea, I will try this one because nothing I’ve done so far seems to work.

EDIT: So just adding the time to the transaction will fix the compatibility problem ?

EDIT2: ok, adding timestamp does not solve, decoderawtransaction now is ok, but submitblock returns “Block decode failed - CDataStream::read(): end of data: unspecified iostream\_category error”.

---

<div class="post-metadata">

**Author:** ![nohea](https://talk.peercoin.net/user_avatar/talk.peercoin.net/nohea/32/907_2.png) [@nohea](https://talk.peercoin.net/u/nohea)\
**Post date:** [July 18, 2021, 11:21pm UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469/4 "2021-07-18T23:21:40Z")

</div>

I used UNOMP a few years ago to do pooled mining with Peercoin and a forked chain. However that was before the Peercoin rebase on later bitcoin codebase. The tx binary format should be the same for the old and new Peercoin.  
Last month i tried setup of NOMP pool software with Peercoin 0.10.x, it seems to launch but i didn’t have a SHA256 miner to test at the time.  
If you are trying to fork your own, you got to learn all this stuff 😅

---

<div class="post-metadata">

**Author:** ![backpacker69](https://talk.peercoin.net/user_avatar/talk.peercoin.net/backpacker69/32/31_2.png) [@backpacker69](https://talk.peercoin.net/u/backpacker69)\
**Post date:** [July 20, 2021, 1:57pm UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469/5 "2021-07-20T13:57:38Z")

</div>

it would be worth your while to look at peercoin branch of peercoin’s poolserver repository.

---

<div class="post-metadata">

**Author:** ![lorenz10](https://talk.peercoin.net/user_avatar/talk.peercoin.net/lorenz10/32/3764_2.png) [@lorenz10](https://talk.peercoin.net/u/lorenz10)\
**Post date:** [July 22, 2021, 7:35am UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469/6 "2021-07-22T07:35:11Z")

</div>

Ok I see the repo.  
Thank you both, I’ll put my efforts on trying to set a pool. 👍

---

<div class="post-metadata">

**Author:** ![irritant](https://talk.peercoin.net/user_avatar/talk.peercoin.net/irritant/32/168_2.png) [@irritant](https://talk.peercoin.net/u/irritant)\
**Post date:** [July 22, 2021, 8:48pm UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469/7 "2021-07-22T20:48:55Z")

</div>

this might be too old, but it was running the D7 ppc pool iirc: [GitHub - chemicstry/poolserver: Cryptocurrency mining pool written in C++ for speed. Supports Stratum.](https://github.com/chemicstry/poolserver)  
or this [GitHub - hrobeers/poolserver: Cryptocurrency mining pool written in C++ for speed. Supports Stratum.](https://github.com/hrobeers/poolserver)

---

<div class="post-metadata">

**Author:** ![lorenz10](https://talk.peercoin.net/user_avatar/talk.peercoin.net/lorenz10/32/3764_2.png) [@lorenz10](https://talk.peercoin.net/u/lorenz10)\
**Post date:** [July 23, 2021, 4:30pm UTC](https://talk.peercoin.net/t/use-bitcoin-miner-for-peercoin/15469/8 "2021-07-23T16:30:52Z")

</div>

Thanks guys for your support, however for the moment I don’t know if I’ll have time to set up a pool since I’m running out of time with my thesis. 🙏

Thank you again, I hope you like the new Peercoin wallet UI. 📱
