Bitcoin Forum
January 19, 2019, 03:42:07 AM *
News: Latest Bitcoin Core release: 0.17.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Solved+Fix] Issue with mined coins of my altcoin  (Read 92 times)
supermoney
Legendary
*
Offline Offline

Activity: 980
Merit: 1000



View Profile WWW
May 23, 2018, 01:18:47 PM
Last edit: May 24, 2018, 02:09:09 PM by supermoney
 #1

I'm facing a problem with my own altcoin when mining new blocks, I do not receive any mined coin to my coinbase address and of course Bitcoin Core keeps displaying me 0 BTC balance.

Setup:
Forked Bitcoin Core v0.16.0 (stable version), generated genesis block, reduced COINBASE_MATURITY from 100 to 1, changed PUBKEY_ADDRESS to 65 ('T') and SCRIPT_ADDRESS to 66 (alternative 'T', PS: I'm aware it looks confusing/weird especially in such test cases).

CPU Miner:
Code:
-O test:1234 -o http://127.0.0.1:15621/ --coinbase-addr=ToNdTui9QonxKutQA9W3rVTocwXYbUndf9 -a sha256d -D --no-longpoll --no-getwork --no-stratum

The block explorer I setup (bitcoin-abe) shows the mined coins are being forwarded to some unknown address TQ32UoQrhdL5WUkK8jAjNNC1zSGbt7zQXw not owned by me.

Block #1:


[click here for full screen image]



Coinbase Transaction:


[click here for full screen image]



ToNdTui9QonxKutQA9W3rVTocwXYbUndf9:


[click here for full screen image]



TQ32UoQrhdL5WUkK8jAjNNC1zSGbt7zQXw:


[click here for full screen image]

Join our new Telegram channel: https://t.me/master_of_cryptos | @master_of_cryptos
The crypto-community that gives you access to premium trading signals, latest crypto news, rumors, thoughts & much more!
No Hidden Fees / No Pay Services / No Recycled Shit
1547869327
Hero Member
*
Offline Offline

Posts: 1547869327

View Profile Personal Message (Offline)

Ignore
1547869327
Reply with quote  #2

1547869327
Report to moderator
1547869327
Hero Member
*
Offline Offline

Posts: 1547869327

View Profile Personal Message (Offline)

Ignore
1547869327
Reply with quote  #2

1547869327
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
supermoney
Legendary
*
Offline Offline

Activity: 980
Merit: 1000



View Profile WWW
May 23, 2018, 02:28:03 PM
Last edit: May 24, 2018, 02:03:57 PM by supermoney
 #2

It looks like ToNdTui9QonxKutQA9W3rVTocwXYbUndf9 is script address (P2SH) and TQ32UoQrhdL5WUkK8jAjNNC1zSGbt7zQXw is pubkey address (P2PKH).
What I don't understand is why cpuminer is sending the mined coins to that pubkey address and not to the script address I entered in coinbase-addr parameter?

Join our new Telegram channel: https://t.me/master_of_cryptos | @master_of_cryptos
The crypto-community that gives you access to premium trading signals, latest crypto news, rumors, thoughts & much more!
No Hidden Fees / No Pay Services / No Recycled Shit
supermoney
Legendary
*
Offline Offline

Activity: 980
Merit: 1000



View Profile WWW
May 24, 2018, 01:55:24 PM
 #3

[SOLVED+FIX]

I've managed to fix the issue by enabling CPU miner to read the PS2H prefix by editing util.c of CPU miner:

https://github.com/pooler/cpuminer/blob/master/util.c#L674

Change that value according to your SCRIPT_ADDRESS in chainparams.cpp of your coin's source code:

https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L141

Re-compile the CPU miner and run it. This is gonna be the success result:


Join our new Telegram channel: https://t.me/master_of_cryptos | @master_of_cryptos
The crypto-community that gives you access to premium trading signals, latest crypto news, rumors, thoughts & much more!
No Hidden Fees / No Pay Services / No Recycled Shit
Pages: [1]
  Print  
 
Jump to:  

Bitcointalk.org is not available or authorized for sale. Do not believe any fake listings.
Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!